title: JDBC Connection connected but no query result to the resultset
body: <p>I am trying to do this project but it has a major problem.  I created table test2 with attribute cid.  I added a user into the cid by using these command line in the sql command line: </p>
  
  <pre><code>create table test2(cid varchar(20));
  insert into test2 values('hello');
  
  select cid from test2;
  </code></pre>
  
  <p>Then I get the result as </p>
  
  <pre><code>CID
  -----------------------
  HELLO
  </code></pre>
  
  <p>My question is that when I tried to use jdbc with eclipe to the server, I get rs.next() as false (rs is resultset). clearly I do have 'hello' inside the table test2.  Here is my code, if anyone could help me out with this, I would appreciate it:</p>
  
  <pre><code>public boolean connect(String username, String password)
  {
      String connectURL = "jdbc:oracle:thin:@dbhost.xxx.xx.xxx.ca:1522:ug"; 
  
      try 
      {
          con = DriverManager.getConnection(connectURL,username,password);
          System.out.println("\nConnected to Oracle!");
          ResultSet  rs;
          try
          {
              Statement stmt = con.createStatement();
  
              rs = stmt.executeQuery("SELECT cid FROM test2");
              System.out.println("here");
              while(rs.next())
              {
                  System.out.println("there");
                  System.out.println("cid isssssssssss: " + rs.getString("cid"));
  
              }
              System.out.println("after here");
              stmt.close();
          }
          catch (SQLException ex)
          {
              System.out.print("Message: " + ex.getMessage());
          }
          try {
              con.close();
          } catch (SQLException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
          }
          return true;
      }
      catch (SQLException ex)
      {
          System.out.println("Message: " + ex.getMessage());
          return false;
      }
  }
  </code></pre>
  
  <p>Connection is there because when I change cid into something else the sqlexception gave me an error message.  So it connects but not getting any query from the server.</p>
  
  <pre><code>rs = stmt.executeQuery("SELECT something FROM test2");
  
  Connected to Oracle!
  Message: ORA-00904: "SOMETHING": invalid identifier
  </code></pre>
  
  <p>Puzzling me.  Thanks again.</p>