Issue Details (XML | Word | Printable)

Key: DERBY-213
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Philip Wilder
Reporter: Kathey Marsden
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

ResultSet.next() after last row of FORWARD_ONLY cursor throws an SQL Exception with Network Server

Created: 11/Apr/05 10:43 AM   Updated: 26/Jan/06 01:49 AM
Return to search
Component/s: Network Client
Affects Version/s: 10.1.1.0
Fix Version/s: 10.2.1.6

Time Tracking:
Issue & Sub-Tasks
Issue Only
Not Specified

File Attachments:
  Size
Java Source File Client.java 2005-06-03 03:09 AM Philip Wilder 6 kB
Java Source File Create.java 2005-05-31 08:54 PM Philip Wilder 4 kB
Text File DERBY-213_6_13_2005.txt 2005-06-15 04:29 AM Philip Wilder 12 kB
Text File DERBY-213_6_9_2005.txt 2005-06-10 03:16 AM Philip Wilder 14 kB
Text File DERBY-213_irc_6_3_2005 2005-06-04 03:08 PM Kathey Marsden 12 kB
Text File DERBY-213_irc_6_7_2005.txt 2005-06-07 11:35 PM Philip Wilder 9 kB
Text File DERBY-213_irc_6_8_2005 2005-06-08 11:20 PM Kathey Marsden 9 kB
Text File Licensed for inclusion in ASF works Derby213patch_Aug112005.patch 2005-08-11 10:37 PM Philip Wilder 466 kB
Text File Licensed for inclusion in ASF works Derby213patch_Aug242005.patch 2005-08-25 05:14 AM Philip Wilder 38 kB
Text File IRCTranscript_June2_2005.txt 2005-06-03 03:06 AM Philip Wilder 13 kB
PDF File ResultSet Outline.pdf 2005-06-15 04:33 AM Philip Wilder 11 kB
Java Source File Licensed for inclusion in ASF works resultset.java 2005-06-03 03:11 AM Philip Wilder 30 kB
Java Source File Server.java 2005-05-31 08:54 PM Philip Wilder 0.3 kB
Issue Links:
Reference
 

Resolution Date: 30/Aug/05 09:28 PM

Sub-Tasks  All   Open   
No sub-tasks match this view.

 Description  « Hide
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();
}



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.