You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Bernt M. Johnsen (JIRA)" <de...@db.apache.org> on 2005/05/12 11:15:17 UTC

[jira] Created: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.

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


Re: [jira] Commented: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.

Posted by "Bernt M. Johnsen" <Be...@Sun.COM>.
>>>>>>>>>>>> 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.

Posted by "Bernt M. Johnsen" <Be...@Sun.COM>.
>>>>>>>>>>>> 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) <de...@db.apache.org> 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.

Posted by Myrna van Lunteren <m....@gmail.com>.
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) <de...@db.apache.org> 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] Resolved: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.

Posted by "Bernt M. Johnsen (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-276?page=all ]
     
Bernt M. Johnsen resolved DERBY-276:
------------------------------------

    Resolution: Fixed

> 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
>      Fix For: 10.2.0.0
>  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


[jira] Reopened: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-276?page=all ]
     
Kathey Marsden reopened DERBY-276:
----------------------------------


reopen to fix fix version

> 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
>      Fix For: 10.2.0.0
>  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


[jira] Assigned: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.

Posted by "Bernt M. Johnsen (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-276?page=all ]

Bernt M. Johnsen reassigned DERBY-276:
--------------------------------------

    Assign To: Bernt M. Johnsen

> 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.

Posted by "Daniel John Debrunner (JIRA)" <de...@db.apache.org>.
    [ 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.

Posted by "Bernt M. Johnsen (JIRA)" <de...@db.apache.org>.
    [ 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.

Posted by "Daniel John Debrunner (JIRA)" <de...@db.apache.org>.
    [ 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


[jira] Closed: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-276?page=all ]
     
Kathey Marsden closed DERBY-276:
--------------------------------


> 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
>      Fix For: 10.1.1.0
>  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


[jira] Commented: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.

Posted by "Shreyas Kaushik (JIRA)" <de...@db.apache.org>.
     [ 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


[jira] Updated: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.

Posted by "Bernt M. Johnsen (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-276?page=all ]

Bernt M. Johnsen updated DERBY-276:
-----------------------------------

    type: Improvement  (was: Bug)

Since the implemented functionality is JDBC 2.0 compliant, this is not a bug, but an "improvement" to become more JDBC 3.0 compliant.

> 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.

Posted by "Bernt M. Johnsen (JIRA)" <de...@db.apache.org>.
     [ 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.

Posted by "Bernt M. Johnsen (JIRA)" <de...@db.apache.org>.
     [ 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


[jira] Commented: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.

Posted by "Bernt M. Johnsen (JIRA)" <de...@db.apache.org>.
     [ 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] Updated: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.

Posted by "Bernt M. Johnsen (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-276?page=all ]

Bernt M. Johnsen updated DERBY-276:
-----------------------------------

    Priority: Minor  (was: Major)

> 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
>     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] Updated: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.

Posted by "Daniel John Debrunner (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-276?page=all ]

Daniel John Debrunner updated DERBY-276:
----------------------------------------

    Fix Version: 10.2.0.0
    Description: 
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).


  was:
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).


    Environment: 

Patch committed revision 208683.

> 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
>      Fix For: 10.2.0.0
>  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


[jira] Commented: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.

Posted by "Myrna van Lunteren (JIRA)" <de...@db.apache.org>.
    [ 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


[jira] Updated: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.

Posted by "Bernt M. Johnsen (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-276?page=all ]

Bernt M. Johnsen updated DERBY-276:
-----------------------------------

    Attachment: DERBY-276-V2.diff

Extended tests for empty resultset. derbyall run with one fail: derbyall/derbyall.fail:tools/dblook_test.java
Tested on 190582M
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



> 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


[jira] Resolved: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-276?page=all ]
     
Kathey Marsden resolved DERBY-276:
----------------------------------

    Fix Version: 10.1.1.0
                     (was: 10.2.0.0)
     Resolution: Fixed

Fixed in 10.1 with revision 208776 - "In preparation for the 10.1 release, roll up fixes from trunk."


> 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
>      Fix For: 10.1.1.0
>  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


[jira] Commented: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.

Posted by "Bernt M. Johnsen (JIRA)" <de...@db.apache.org>.
     [ 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] Updated: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.

Posted by "Bernt M. Johnsen (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-276?page=all ]

Bernt M. Johnsen updated DERBY-276:
-----------------------------------

    Attachment: DERBY-276.diff

New patch with minor issue fixed (relative(0) on empty resultsets)
Stat:
M      java/tools/org/apache/derby/impl/tools/ij/utilMain.java
M      java/engine/org/apache/derby/impl/sql/execute/ScrollInsensitiveResultSet.java
M      java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors2.java
M      java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors1.sql
M      java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/scrollCursors1.out
M      java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/scrollCursors1.out
M      java/testing/org/apache/derbyTesting/functionTests/master/scrollCursors1.out
M      java/client/org/apache/derby/client/am/ResultSet.java


> 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.

Posted by "Bernt M. Johnsen (JIRA)" <de...@db.apache.org>.
    [ 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] Closed: (DERBY-276) ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.

Posted by "Bernt M. Johnsen (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-276?page=all ]
     
Bernt M. Johnsen closed DERBY-276:
----------------------------------


> 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
>      Fix For: 10.2.0.0
>  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