5 Replies Latest reply on Sep 5, 2009 4:21 PM by Joe Weinstein-Oracle

    Unexpected Error message - java.sql.SQLException: Exhausted Resultset

    549379

      Hi,

      I am facing the serious problem while executing one of the methods which call Oracle SQL DB and trying to query the particular record from it.


      try {
      stat = _connection.createStatement();
      rs = stat.executeQuery(sql);
      rs.next();
      temp = rs.getString("SITE_NAME");
      if (temp.equals("") || temp == null) {
      throw new Exception();
      }
      } catch (Exception e) {
      e.printStackTrace(); //error thrown here
      } finally {
      if (rs != null) {
      try {
      rs.close();
      } catch (SQLException e) {
      e.printStackTrace();
      }
      }


      The following error occured:
      java.sql.SQLException: Exhausted Resultset
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
      at oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java:382)
      at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1515)
      at com.keygen.getSiteName(Generator.java:1514)
      at com.keygen.generate(Generator.java:530)
      at com..keygen.main(Generator.java:1679)

      Edited by: Pannar on Sep 2, 2009 10:22 PM