Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2009
    Posts
    5

    Red face Unanswered: Nothing in ResultSet??pls help

    Hello all,
    I m just a beginner..I have connecting to oracle from JAVA..
    i have enteries in table but wen I used while(rs.next()){}
    it never goes inside de loop.
    no error or exception is got..
    Wat could be de possible prob??

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >Wat could be de possible prob??
    the Java code has a problem.

    I suggest you find a Java forum & post your code there.

    Code:
    import java.sql.*;
    class Conn {
      public static void main (String args []) throws SQLException
      {
           try {
                 Class.forName ("oracle.jdbc.driver.OracleDriver");
           } catch (ClassNotFoundException e) {
                 e.printStackTrace();
           }
    
            Connection conn = DriverManager.getConnection
                ("jdbc:oracle:thin:@localhost:1521:orcl", "scott", "tiger");
                                // @machineName:port:SID,   userid,  password
    
            Statement stmt = conn.createStatement();
            ResultSet rset = stmt.executeQuery("select BANNER from SYS.V_$VERSION");
            while (rset.next())
                  System.out.println (rset.getString(1));   // Print col 1
            stmt.close();
      }
    }
    Last edited by anacedent; 06-30-10 at 17:34.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Nov 2009
    Posts
    5
    ok thanks...
    I got it finally...
    nothin wrong with db..

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >nothin wrong with db..
    Never thought there ever was a problem with Oracle DB.
    Problem Existed Between Keyboard And Chair.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Nov 2009
    Posts
    5
    Sadly S...
    I agree..
    But der s no better way 2 learn dan by learnin from errors..
    atleast it works 4 me..

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •