db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (JIRA)" <derby-...@db.apache.org>
Subject [jira] Created: (DERBY-213) ResultSet.next() after last row of FORWARD_ONLY cursor throws an SQL Exception with Network Server
Date Mon, 11 Apr 2005 01:44:17 GMT
ResultSet.next() after last row of FORWARD_ONLY cursor throws an SQL Exception with Network
Server
--------------------------------------------------------------------------------------------------

         Key: DERBY-213
         URL: http://issues.apache.org/jira/browse/DERBY-213
     Project: Derby
        Type: Bug
  Components: Network Server  
    Versions: 10.1.0.0    
    Reporter: Kathey Marsden


Network Server closes the result set if ResultSet.next() is 
called after the last row of the result set.  The test code 
below throws the following exception.

SQLState:   null
Severity: -99999
Message:  Invalid operation: result set closed
com.ibm.db2.jcc.am.SqlException: Invalid operation: result set 
closed
        at 
com.ibm.db2.jcc.am.ResultSet.checkForClosedResultSet(ResultSet.j
ava:3419)
        at 
com.ibm.db2.jcc.am.ResultSet.nextX(ResultSet.java:290)
        at 
com.ibm.db2.jcc.am.ResultSet.next(ResultSet.java:277)
        at AfterLast.test(AfterLast.java:75)
        at AfterLast.main(AfterLast.java:32)


stmt.executeUpdate("CREATE  TABLE TAB ( I INT)");
stmt.executeUpdate("INSERT INTO TAB VALUES(1)");
stmt.executeUpdate("INSERT INTO TAB VALUES(2)");
String sql ="SELECT * from tab";		
ps = conn.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
System.out.println(sql);
while (rs.next())
System.out.println(rs.getInt(1));
try {
	System.out.println("one more next");
	rs.next();
		}
    catch (Exception e)
		{
		System.out.println("FAIL: next should return false not throw 
exception");
		e.printStackTrace();
		}



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message