[jira] Commented: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.
[ http://issues.apache.org/jira/browse/DERBY-276?page=comments#action_12314781 ] Daniel John Debrunner commented on DERBY-276: - I'll look at committing this, it seems to have been forgotten about. :-( > ResultSet.relative(int row) cannot be called when the cursor is not > positioned on a row. > > > Key: DERBY-276 > URL: http://issues.apache.org/jira/browse/DERBY-276 > Project: Derby > Type: Improvement > Components: JDBC > Reporter: Bernt M. Johnsen > Assignee: Bernt M. Johnsen > Priority: Minor > Attachments: DERBY-276-V2.diff > > If the cursor is not positioned on a row, calling ResultSet.relative() causes > the following exception: > Exception in thread "main" ERROR X0X87: ResultSet.relative(int row) cannot be > called when the cursor is not positioned on a row. > at > org.apache.derby.iapi.error.StandardException.newException(StandardException.java:301) > at > org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getRelativeRow(ScrollInsensitiveResultSet.java:336) > at > org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(EmbedResultSet.java:366) > at > org.apache.derby.impl.jdbc.EmbedResultSet.relative(EmbedResultSet.java:1840) > However, The 1.4.2 Javadoc says: > Note: Calling the method relative(1) is identical to calling the method > next() and calling the method relative(-1) is identical to calling the method > previous(). (This is confirmed by the JDBC 3.0 spec, ch. 14.2.2) > Since next() is valid, so should rs.relative(1) (and all other arguments, > since a too large value will position the > cursor after the last row, and a too low value will position it before the > first). -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [jira] Commented: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.
Myrna van Lunteren (JIRA) wrote (2005-06-21 15:30:24): > [ > http://issues.apache.org/jira/browse/DERBY-276?page=comments#action_12314148 > ] > > Myrna van Lunteren commented on DERBY-276: > -- > > The latest patch looks good to me. > I had to svn update to the revision used in the patch to make it apply, > though... > > This now needs a committer's attention... :-) Thanks Myrna. -- Bernt Marius Johnsen, Database Technology Group, Sun Microsystems, Trondheim, Norway
[jira] Commented: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.
[ http://issues.apache.org/jira/browse/DERBY-276?page=comments#action_12314148 ] Myrna van Lunteren commented on DERBY-276: -- The latest patch looks good to me. I had to svn update to the revision used in the patch to make it apply, though... This now needs a committer's attention... :-) Myrna > ResultSet.relative(int row) cannot be called when the cursor is not > positioned on a row. > > > Key: DERBY-276 > URL: http://issues.apache.org/jira/browse/DERBY-276 > Project: Derby > Type: Improvement > Components: JDBC > Reporter: Bernt M. Johnsen > Assignee: Bernt M. Johnsen > Priority: Minor > Attachments: DERBY-276-V2.diff > > If the cursor is not positioned on a row, calling ResultSet.relative() causes > the following exception: > Exception in thread "main" ERROR X0X87: ResultSet.relative(int row) cannot be > called when the cursor is not positioned on a row. > at > org.apache.derby.iapi.error.StandardException.newException(StandardException.java:301) > at > org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getRelativeRow(ScrollInsensitiveResultSet.java:336) > at > org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(EmbedResultSet.java:366) > at > org.apache.derby.impl.jdbc.EmbedResultSet.relative(EmbedResultSet.java:1840) > However, The 1.4.2 Javadoc says: > Note: Calling the method relative(1) is identical to calling the method > next() and calling the method relative(-1) is identical to calling the method > previous(). (This is confirmed by the JDBC 3.0 spec, ch. 14.2.2) > Since next() is valid, so should rs.relative(1) (and all other arguments, > since a too large value will position the > cursor after the last row, and a too low value will position it before the > first). -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [jira] Commented: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.
Bernt M. Johnsen wrote (2005-06-13 22:12:41): > Myrna van Lunteren wrote (2005-06-13 11:26:52): > > The patch applied when I svn updated to the revision in the patch... > > And the 2 tests pass... > > But I was wondering - should there be a test case for the NPE situation in > > one of the scrollCursors tests? > > Probably. I could add a test for all positioning methods en empty > scrollable resultsets. Should be no big deal. Patch extended with more testing and attached to issue. -- Bernt Marius Johnsen, Database Technology Group, Sun Microsystems, Trondheim, Norway
Re: [jira] Commented: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.
Myrna van Lunteren wrote (2005-06-13 11:26:52): > The patch applied when I svn updated to the revision in the patch... > And the 2 tests pass... > But I was wondering - should there be a test case for the NPE situation in > one of the scrollCursors tests? Probably. I could add a test for all positioning methods en empty scrollable resultsets. Should be no big deal. > Myrna > > On 6/13/05, Bernt M. Johnsen (JIRA) wrote: > > > > [ > > http://issues.apache.org/jira/browse/DERBY-276?page=comments#action_12313430] > > > > Bernt M. Johnsen commented on DERBY-276: > > > > > > The mailed patch has a minor issue. It gives NPE when relative(0) is > > acalled on an emtpy resultset. > > > > > ResultSet.relative(int row) cannot be called when the cursor is not > > positioned on a row. > > > > > > > > > > > Key: DERBY-276 > > > URL: http://issues.apache.org/jira/browse/DERBY-276 > > > Project: Derby > > > Type: Improvement > > > Components: JDBC > > > Reporter: Bernt M. Johnsen > > > Assignee: Bernt M. Johnsen > > > Priority: Minor > > > > > > > > If the cursor is not positioned on a row, calling ResultSet.relative() > > causes the following exception: > > > Exception in thread "main" ERROR X0X87: ResultSet.relative(int row) > > cannot be called when the cursor is not positioned on a row. > > > at org.apache.derby.iapi.error.StandardException.newException( > > StandardException.java:301) > > > at > > org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getRelativeRow > > (ScrollInsensitiveResultSet.java:336) > > > at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition( > > EmbedResultSet.java:366) > > > at org.apache.derby.impl.jdbc.EmbedResultSet.relative( > > EmbedResultSet.java:1840) > > > However, The 1.4.2 Javadoc says: > > > Note: Calling the method relative(1) is identical to calling the method > > next() and calling the method relative(-1) is identical to calling the > > method previous(). (This is confirmed by the JDBC 3.0 spec, ch. 14.2.2) > > > Since next() is valid, so should rs.relative(1) (and all other > > arguments, since a too large value will position the > > > cursor after the last row, and a too low value will position it before > > the first). > > > > -- > > 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 > > - > > For more information on JIRA, see: > > http://www.atlassian.com/software/jira > > > > -- Bernt Marius Johnsen, Database Technology Group, Sun Microsystems, Trondheim, Norway
Re: [jira] Commented: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.
The patch applied when I svn updated to the revision in the patch... And the 2 tests pass... But I was wondering - should there be a test case for the NPE situation in one of the scrollCursors tests? Myrna On 6/13/05, Bernt M. Johnsen (JIRA)wrote: [ http://issues.apache.org/jira/browse/DERBY-276?page=comments#action_12313430 ]Bernt M. Johnsen commented on DERBY-276:The mailed patch has a minor issue. It gives NPE when relative(0) is acalled on an emtpy resultset.> ResultSet.relative (int row) cannot be called when the cursor is not positioned on a row.> >> Key: DERBY-276> URL: http://issues.apache.org/jira/browse/DERBY-276> Project: Derby> Type: Improvement> Components: JDBC> Reporter: Bernt M. Johnsen > Assignee: Bernt M. Johnsen> Priority: Minor>> If the cursor is not positioned on a row, calling ResultSet.relative() causes the following exception:> Exception in thread "main" ERROR X0X87: ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.> at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:301)> at org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getRelativeRow (ScrollInsensitiveResultSet.java:336)> at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(EmbedResultSet.java:366)> at org.apache.derby.impl.jdbc.EmbedResultSet.relative(EmbedResultSet.java :1840)> However, The 1.4.2 Javadoc says:> Note: Calling the method relative(1) is identical to calling the method next() and calling the method relative(-1) is identical to calling the method previous(). (This is confirmed by the JDBC 3.0 spec, ch. 14.2.2)> Since next() is valid, so should rs.relative(1) (and all other arguments, since a too large value will position the> cursor after the last row, and a too low value will position it before the first). --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 -For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.
[ http://issues.apache.org/jira/browse/DERBY-276?page=comments#action_12313430 ] Bernt M. Johnsen commented on DERBY-276: The mailed patch has a minor issue. It gives NPE when relative(0) is acalled on an emtpy resultset. > ResultSet.relative(int row) cannot be called when the cursor is not > positioned on a row. > > > Key: DERBY-276 > URL: http://issues.apache.org/jira/browse/DERBY-276 > Project: Derby > Type: Improvement > Components: JDBC > Reporter: Bernt M. Johnsen > Assignee: Bernt M. Johnsen > Priority: Minor > > If the cursor is not positioned on a row, calling ResultSet.relative() causes > the following exception: > Exception in thread "main" ERROR X0X87: ResultSet.relative(int row) cannot be > called when the cursor is not positioned on a row. > at > org.apache.derby.iapi.error.StandardException.newException(StandardException.java:301) > at > org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getRelativeRow(ScrollInsensitiveResultSet.java:336) > at > org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(EmbedResultSet.java:366) > at > org.apache.derby.impl.jdbc.EmbedResultSet.relative(EmbedResultSet.java:1840) > However, The 1.4.2 Javadoc says: > Note: Calling the method relative(1) is identical to calling the method > next() and calling the method relative(-1) is identical to calling the method > previous(). (This is confirmed by the JDBC 3.0 spec, ch. 14.2.2) > Since next() is valid, so should rs.relative(1) (and all other arguments, > since a too large value will position the > cursor after the last row, and a too low value will position it before the > first). -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.
[ http://issues.apache.org/jira/browse/DERBY-276?page=comments#action_12313447 ] Bernt M. Johnsen commented on DERBY-276: Derbyall was run for the attached patch on version 190372M. Platform: Java Version:1.5.0_03 Java Vendor: Sun Microsystems Inc. OS name: Linux OS architecture: i386 OS version: 2.4.20-31.9 Fails: derbyall/derbyall.fail:tools/dblook_test.java Not related to this patch > ResultSet.relative(int row) cannot be called when the cursor is not > positioned on a row. > > > Key: DERBY-276 > URL: http://issues.apache.org/jira/browse/DERBY-276 > Project: Derby > Type: Improvement > Components: JDBC > Reporter: Bernt M. Johnsen > Assignee: Bernt M. Johnsen > Priority: Minor > Attachments: DERBY-276.diff > > If the cursor is not positioned on a row, calling ResultSet.relative() causes > the following exception: > Exception in thread "main" ERROR X0X87: ResultSet.relative(int row) cannot be > called when the cursor is not positioned on a row. > at > org.apache.derby.iapi.error.StandardException.newException(StandardException.java:301) > at > org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getRelativeRow(ScrollInsensitiveResultSet.java:336) > at > org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(EmbedResultSet.java:366) > at > org.apache.derby.impl.jdbc.EmbedResultSet.relative(EmbedResultSet.java:1840) > However, The 1.4.2 Javadoc says: > Note: Calling the method relative(1) is identical to calling the method > next() and calling the method relative(-1) is identical to calling the method > previous(). (This is confirmed by the JDBC 3.0 spec, ch. 14.2.2) > Since next() is valid, so should rs.relative(1) (and all other arguments, > since a too large value will position the > cursor after the last row, and a too low value will position it before the > first). -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.
[ http://issues.apache.org/jira/browse/DERBY-276?page=comments#action_12313208 ] Daniel John Debrunner commented on DERBY-276: - Javadoc still needs some clarity: relative(1) isn't identical to next() relative(1) on a scrollable result set is identical to next() JDBC 4.0 could clean this up. > ResultSet.relative(int row) cannot be called when the cursor is not > positioned on a row. > > > Key: DERBY-276 > URL: http://issues.apache.org/jira/browse/DERBY-276 > Project: Derby > Type: Improvement > Components: JDBC > Reporter: Bernt M. Johnsen > Assignee: Bernt M. Johnsen > Priority: Minor > > If the cursor is not positioned on a row, calling ResultSet.relative() causes > the following exception: > Exception in thread "main" ERROR X0X87: ResultSet.relative(int row) cannot be > called when the cursor is not positioned on a row. > at > org.apache.derby.iapi.error.StandardException.newException(StandardException.java:301) > at > org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getRelativeRow(ScrollInsensitiveResultSet.java:336) > at > org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(EmbedResultSet.java:366) > at > org.apache.derby.impl.jdbc.EmbedResultSet.relative(EmbedResultSet.java:1840) > However, The 1.4.2 Javadoc says: > Note: Calling the method relative(1) is identical to calling the method > next() and calling the method relative(-1) is identical to calling the method > previous(). (This is confirmed by the JDBC 3.0 spec, ch. 14.2.2) > Since next() is valid, so should rs.relative(1) (and all other arguments, > since a too large value will position the > cursor after the last row, and a too low value will position it before the > first). -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.
[ http://issues.apache.org/jira/browse/DERBY-276?page=comments#action_66254 ] Shreyas Kaushik commented on DERBY-276: --- Javadoc for J2SE 5.0 says... relative boolean relative(int rows) throws SQLException Moves the cursor a relative number of rows, either positive or negative. Attempting to move beyond the first/last row in the result set positions the cursor before/after the the first/last row. Calling relative(0) is valid, but does not change the cursor position. Note: Calling the method relative(1) is identical to calling the method next() and calling the method relative(-1) is identical to calling the method previous(). Parameters: rows - an int specifying the number of rows to move from the current row; a positive number moves the cursor forward; a negative number moves the cursor backward Returns: true if the cursor is on a row; false otherwise Throws: SQLException - if a database access error occurs, there is no current row, or the result set type is TYPE_FORWARD_ONLY Since: 1.2 > ResultSet.relative(int row) cannot be called when the cursor is not > positioned on a row. > > > Key: DERBY-276 > URL: http://issues.apache.org/jira/browse/DERBY-276 > Project: Derby > Type: Improvement > Components: JDBC > Reporter: Bernt M. Johnsen > Assignee: Bernt M. Johnsen > Priority: Minor > > If the cursor is not positioned on a row, calling ResultSet.relative() causes > the following exception: > Exception in thread "main" ERROR X0X87: ResultSet.relative(int row) cannot be > called when the cursor is not positioned on a row. > at > org.apache.derby.iapi.error.StandardException.newException(StandardException.java:301) > at > org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getRelativeRow(ScrollInsensitiveResultSet.java:336) > at > org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(EmbedResultSet.java:366) > at > org.apache.derby.impl.jdbc.EmbedResultSet.relative(EmbedResultSet.java:1840) > However, The 1.4.2 Javadoc says: > Note: Calling the method relative(1) is identical to calling the method > next() and calling the method relative(-1) is identical to calling the method > previous(). (This is confirmed by the JDBC 3.0 spec, ch. 14.2.2) > Since next() is valid, so should rs.relative(1) (and all other arguments, > since a too large value will position the > cursor after the last row, and a too low value will position it before the > first). -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [jira] Commented: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.
The problem is: relative(1)/relative(-1) can't both be identical to next()/previous() and throw and exception if there is no current row. I think there's an inconsistency here (In the Javadoc and in the tutorial, while the spec has no "current row"-requirement in ch. 14.2.2). Shreyas Kaushik (JIRA) wrote (2005-05-25 10:41:55): > [ > http://issues.apache.org/jira/browse/DERBY-276?page=comments#action_66254 ] > > Shreyas Kaushik commented on DERBY-276: > --- > > Javadoc for J2SE 5.0 says... > > > relative > > boolean relative(int rows) > throws SQLException > > Moves the cursor a relative number of rows, either positive or negative. > Attempting to move beyond the first/last row in the result set positions the > cursor before/after the the first/last row. Calling relative(0) is valid, but > does not change the cursor position. > > Note: Calling the method relative(1) is identical to calling the method > next() and calling the method relative(-1) is identical to calling the method > previous(). > > Parameters: > rows - an int specifying the number of rows to move from the current > row; a positive number moves the cursor forward; a negative number moves the > cursor backward > Returns: > true if the cursor is on a row; false otherwise > Throws: > SQLException - if a database access error occurs, there is no current > row, or the result set type is TYPE_FORWARD_ONLY > Since: > 1.2 > > > > > ResultSet.relative(int row) cannot be called when the cursor is not > > positioned on a row. > > > > > > Key: DERBY-276 > > URL: http://issues.apache.org/jira/browse/DERBY-276 > > Project: Derby > > Type: Improvement > > Components: JDBC > > Reporter: Bernt M. Johnsen > > Assignee: Bernt M. Johnsen > > Priority: Minor > > > > > If the cursor is not positioned on a row, calling ResultSet.relative() > > causes the following exception: > > Exception in thread "main" ERROR X0X87: ResultSet.relative(int row) cannot > > be called when the cursor is not positioned on a row. > > at > > org.apache.derby.iapi.error.StandardException.newException(StandardException.java:301) > > at > > org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getRelativeRow(ScrollInsensitiveResultSet.java:336) > > at > > org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(EmbedResultSet.java:366) > > at > > org.apache.derby.impl.jdbc.EmbedResultSet.relative(EmbedResultSet.java:1840) > > However, The 1.4.2 Javadoc says: > > Note: Calling the method relative(1) is identical to calling the method > > next() and calling the method relative(-1) is identical to calling the > > method previous(). (This is confirmed by the JDBC 3.0 spec, ch. 14.2.2) > > Since next() is valid, so should rs.relative(1) (and all other arguments, > > since a too large value will position the > > cursor after the last row, and a too low value will position it before the > > first). > > -- > 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 > - > For more information on JIRA, see: >http://www.atlassian.com/software/jira > -- Bernt Marius Johnsen, Database Technology Group, Sun Microsystems, Trondheim, Norway
[jira] Commented: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.
[ http://issues.apache.org/jira/browse/DERBY-276?page=comments#action_66251 ] Bernt M. Johnsen commented on DERBY-276: The same goes for absolute(0). It should throw an exception in JDBC 2.0, while it should be equivalent to beforeFirst() in JDBC 3.0. > ResultSet.relative(int row) cannot be called when the cursor is not > positioned on a row. > > > Key: DERBY-276 > URL: http://issues.apache.org/jira/browse/DERBY-276 > Project: Derby > Type: Improvement > Components: JDBC > Reporter: Bernt M. Johnsen > Assignee: Bernt M. Johnsen > Priority: Minor > > If the cursor is not positioned on a row, calling ResultSet.relative() causes > the following exception: > Exception in thread "main" ERROR X0X87: ResultSet.relative(int row) cannot be > called when the cursor is not positioned on a row. > at > org.apache.derby.iapi.error.StandardException.newException(StandardException.java:301) > at > org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getRelativeRow(ScrollInsensitiveResultSet.java:336) > at > org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(EmbedResultSet.java:366) > at > org.apache.derby.impl.jdbc.EmbedResultSet.relative(EmbedResultSet.java:1840) > However, The 1.4.2 Javadoc says: > Note: Calling the method relative(1) is identical to calling the method > next() and calling the method relative(-1) is identical to calling the method > previous(). (This is confirmed by the JDBC 3.0 spec, ch. 14.2.2) > Since next() is valid, so should rs.relative(1) (and all other arguments, > since a too large value will position the > cursor after the last row, and a too low value will position it before the > first). -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.
[ http://issues.apache.org/jira/browse/DERBY-276?page=comments#action_66249 ] Bernt M. Johnsen commented on DERBY-276: There has been a change from JDBC 2.0 to JDBC 3.0. In JDBC 2.0 relative(1)/relative(-1) is not necessarily equivalent to next()/previous(), and an exception should be thrown if relative() is called when the result set is not on a row. The JDBC 3.0 spec states that relative(1)/relative(-1) *IS* equivalent to next()/previous() (chapter 14.2.2). The 3rd ed. of the tutorial still says that relative() should throw an exception if the result set is not on a row, but from the wording in the spec, I deduce that this must be a bug in the tutorial. > ResultSet.relative(int row) cannot be called when the cursor is not > positioned on a row. > > > Key: DERBY-276 > URL: http://issues.apache.org/jira/browse/DERBY-276 > Project: Derby > Type: Bug > Components: JDBC > Reporter: Bernt M. Johnsen > Assignee: Bernt M. Johnsen > Priority: Minor > > If the cursor is not positioned on a row, calling ResultSet.relative() causes > the following exception: > Exception in thread "main" ERROR X0X87: ResultSet.relative(int row) cannot be > called when the cursor is not positioned on a row. > at > org.apache.derby.iapi.error.StandardException.newException(StandardException.java:301) > at > org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getRelativeRow(ScrollInsensitiveResultSet.java:336) > at > org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(EmbedResultSet.java:366) > at > org.apache.derby.impl.jdbc.EmbedResultSet.relative(EmbedResultSet.java:1840) > However, The 1.4.2 Javadoc says: > Note: Calling the method relative(1) is identical to calling the method > next() and calling the method relative(-1) is identical to calling the method > previous(). (This is confirmed by the JDBC 3.0 spec, ch. 14.2.2) > Since next() is valid, so should rs.relative(1) (and all other arguments, > since a too large value will position the > cursor after the last row, and a too low value will position it before the > first). -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.
[ http://issues.apache.org/jira/browse/DERBY-276?page=comments#action_65745 ] Bernt M. Johnsen commented on DERBY-276: The functionality of next,previous,first,last,beforeFirst,afterLast,relative and absolute should be aligned with ch. 14.2.2 in the JDBC 3.0 spec. Another issue found: absolute(0) should behave like beforeFirst() > ResultSet.relative(int row) cannot be called when the cursor is not > positioned on a row. > > > Key: DERBY-276 > URL: http://issues.apache.org/jira/browse/DERBY-276 > Project: Derby > Type: Bug > Components: JDBC > Reporter: Bernt M. Johnsen > Assignee: Bernt M. Johnsen > Priority: Minor > > If the cursor is not positioned on a row, calling ResultSet.relative() causes > the following exception: > Exception in thread "main" ERROR X0X87: ResultSet.relative(int row) cannot be > called when the cursor is not positioned on a row. > at > org.apache.derby.iapi.error.StandardException.newException(StandardException.java:301) > at > org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getRelativeRow(ScrollInsensitiveResultSet.java:336) > at > org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(EmbedResultSet.java:366) > at > org.apache.derby.impl.jdbc.EmbedResultSet.relative(EmbedResultSet.java:1840) > However, The 1.4.2 Javadoc says: > Note: Calling the method relative(1) is identical to calling the method > next() and calling the method relative(-1) is identical to calling the method > previous(). (This is confirmed by the JDBC 3.0 spec, ch. 14.2.2) > Since next() is valid, so should rs.relative(1) (and all other arguments, > since a too large value will position the > cursor after the last row, and a too low value will position it before the > first). -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.
[ http://issues.apache.org/jira/browse/DERBY-276?page=comments#action_65123 ] Bernt M. Johnsen commented on DERBY-276: The bug was produced with the Embedded Driver (as can be seen from the stack trace) > ResultSet.relative(int row) cannot be called when the cursor is not > positioned on a row. > > > Key: DERBY-276 > URL: http://issues.apache.org/jira/browse/DERBY-276 > Project: Derby > Type: Bug > Components: JDBC > Reporter: Bernt M. Johnsen > > If the cursor is not positioned on a row, calling ResultSet.relative() causes > the following exception: > Exception in thread "main" ERROR X0X87: ResultSet.relative(int row) cannot be > called when the cursor is not positioned on a row. > at > org.apache.derby.iapi.error.StandardException.newException(StandardException.java:301) > at > org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getRelativeRow(ScrollInsensitiveResultSet.java:336) > at > org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(EmbedResultSet.java:366) > at > org.apache.derby.impl.jdbc.EmbedResultSet.relative(EmbedResultSet.java:1840) > However, The 1.4.2 Javadoc says: > Note: Calling the method relative(1) is identical to calling the method > next() and calling the method relative(-1) is identical to calling the method > previous(). (This is confirmed by the JDBC 3.0 spec, ch. 14.2.2) > Since next() is valid, so should rs.relative(1) (and all other arguments, > since a too large value will position the > cursor after the last row, and a too low value will position it before the > first). -- 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira