SQL exception, Exhausted ResultSet

Ads
 

SQL exception, Exhausted ResultSet

javax.servlet.ServletException: java.sql.SQLException: Exhausted Resultset

iam getting this error messege whenever i run my code. what would be the possible reasons??

View Answers

May 9, 2013 at 10:19 PM

how can i destroy a resultset object explicitly?


May 22, 2013 at 1:27 PM

hi friend,

java.sql.SQLException: Exhausted ResultSet exception may be thrown when you would be tried to access the column value after processing the ResultSet i.e. the result set is closed. For example if you tried to access the column value like the code given below then this exception may be thrown.

ps = con.prepareStatement(sql);
rs = ps.executeQuery();         
 while(rs.next())
  {
    name = rs.getString(1);
  }
  name = rs.getString(2);

Thanks.

Ads









Related Tutorials/Questions & Answers:
SQL exception, Exhausted ResultSet
SQL exception, Exhausted ResultSet  javax.servlet.ServletException: java.sql.SQLException: Exhausted Resultset iam getting this error messege whenever i run my code. what would be the possible reasons
Resultset Issue in SQL
Resultset Issue in SQL  when i call rs.next() in my code it is returning false, though im having valid query to execute and fetch a row from database.how can i resolve this issue. My code is: SELECT JOBDESCRIPTION,CATEGORY
Advertisements
SQL Exception
SQL Exception  I want stores data in to the databse table but it can't be stores it shows an error about sql exception. blackberry.html <...(Exception e) { out.println("Failed to success
Executing anonymous pl/sql block and get resultset in Java
Executing anonymous pl/sql block and get resultset in Java  Hello All, I would like to execute the anonymous pl sql block and need to get the resultset object. I got the code which can be done by using cursors inside the pl sql
jdbc sql exception.
jdbc sql exception.  import java.sql.*; import java.io.*; class InsertEx { public static void main(String args[])throws Exception { Class.forName... Employee salary 9000 Enter Employee address hyd Exception in thread "main
jdbc odbc sql server exception
jdbc odbc sql server exception  Hi, I am trying to use sql server with java jdbc odbc but I am getting this exception java.sql.SQLException: [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near '@P1
ResultSet
database.how to do it using resultset or Resultsetmetadata.Can you please tell me what... = con.createStatement(); ResultSet rs = st.executeQuery...----------------------); } } catch (Exception e
multiple resultset in one resultset
multiple resultset in one resultset  how to retrive multiple resultsets in one resultset in java.? plz help
resultset metadta
resultset metadta  import java.sql.Connection; import... Employee Details Using resultset metadata: "); Connection con = null...(); ResultSet rs = st.executeQuery("SELECT * FROM employee
exception
exception  Identify the reason for SQLException exception, which... (?,?)"; PreparedStatement ps = con.prepareStatement(str); ResultSet rs=ps.createResultset..."); ps.executeUpdate(); } catch(Exception e
exception
exception  wHEN RUNTIME EXCEPTION CLASS IS SUB OF EXCEPTION CLASS HOW CAN'T HANDLE UNCHECKED EXCEPTION
exception
exception  chek in and check out exception in java   Please visit the following link: Checked and Unchecked Exception
exception
arguments are not equalto two,throw a user defined exception "invalid parameter exception" ,otherwise display the two parameters.   Here is an example... is not equal to two then invalid parameter exception is thrown ,otherwise display the two
exception
exception  what is the use of catch block even though we have predefined exception object
exception
defined checked exception ââ?¬Å?InvalidCharcterFoundExceptionââ?¬Â? and creater a block of codes that will handle the exception
Exception
Exception  whis is the Arithmetic Exception in java? or define Arithmetic Exception with exp?   Arithmetic Exception occurs, when you divide a number by zero. Example public class TryCatch { public static void main
Exception
Exception  public class FooException extends Exception { public..."); } public void calculate() throws FooException, Exception { try { int.... ex.printStackTrace(); System.exit(1); } catch(Exception ex
Exception
Exception   I was creating a table dynamically but it shows exception i.e shown down Suplier created0 Suplier created0 Suplier created0 Product created0 Product created0 Product created0 Product created0 could not fetch initial
exception
user defined unchecked exception  can we create user defined unchecked exceptions? if so what is the exact use of it in real time?   Please visit the following links: http://www.roseindia.net/java/java-exception/user
JTable populate with resultset.
(); ResultSet resultSet = statement.executeQuery(sql...JTable populate with resultset.  How to diplay data of resultset...) JTable(Vector data, Vector columneNames) Here is a JTable populate with resultset
ResultSet In Java
executing the SQL queries. Object of ResultSet also maintains the current position...= null; PreparedStatement ps = null; ResultSet rs = null; String sql...ResultSet In Java In this section we will learn about the ResultSet in Java
Printing Values of Resultset to Html Table
Printing Values of Resultset to Html Table  I have a resultset and I need to collect the resultset values into the arraylist into a table... in advance   JSP Display values of ResultSet to HTML table: <%@page
sql
difference between sql and oracle  what is the difference between sql and oracle
sql
sql  how to get first row in sql with using where condition in sql? how to get last row in sql with using where condition in sql
Resultset - JSP-Servlet
Resultset  I am writing while(rs.next){} but if resultset is null then it cannot enter in while block. I want,if resultset is null then it will enter into the while block.  Hi friend, A ResultSet object
sql
sql  I want interview sql questions   Please visit the following link: SQL Tutorials
Sql
Sql  how to find maximum of a101,a102,a103 from a table in sql
sql
sql  returning value from a store procedure in sql with example   Please visit the following links: http://www.roseindia.net/mysql/mysql5/stored-procedures-and-functions.shtml http://www.roseindia.net/sql/create
Resultset with one to many relationship
Resultset with one to many relationship   Suppose there are 5 tables in database named A,B,C,D and E. A has one to many relationship with B,C,D and D... populate my bean classes from resultset without using hibernate, so
SQL
SQL  In my computer i have microsoft sql 2008.how can i set that in the cmd.i want to use that in cmd.what is the default username and password
Spring JdbcTemplate and ResultSet is too slow..
Spring JdbcTemplate and ResultSet is too slow..  Hi.. I am using spring jdbctemplate to fetch the records from oracle database. But it is taking... am using java jdbcTemplate.query(sql, params, RowMapper object) and each record

Ads