Yes that is a way to interpret the text, but looking at the spec there is also the following (JDBC 3.0, p. 119):
relative(int rows)- moves the cursor relative to its current position. If rows is 0 (zero), the cursor is unchanged. If rows is positive, the cursor is moved forward rows rows. If the cursor is less than the specified number of rows from the last row, the cursor is positioned after the last row. If rows is negative, the cursor is moved backward rows rows. If the cursor is less than rows rows from the first row, the cursor is positioned before the first row. The method relative returns true if the cursor is positioned on a valid row and false otherwise. If rows is 1, relative is identical to the method next. If rows is -1, relative is identical to the method previous. => this means also that due to the 'identical behaviour' the sequence rs.beforeFirst(); rs.relative(1); must be legal. This includes the case where 'relative(1)' is the 1st operation executed on the result. Both variants may be ok. Also, as most databases (not SAP DB) have FORWARD_ONLY result sets as default, most user will not detect anything of this as long as next() does correctly work :-) Regards Alexander Schr�der SAP Labs Berlin > -----Original Message----- > From: Blas Rodriguez Somoza [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 20, 2003 9:51 AM > To: Schroeder, Alexander; 'Sven Köhler'; > [EMAIL PROTECTED] > Subject: RE: [BUG?] JDBC: ResultSet.relative(n) > > > Hello > > At 20/01/2003 09:24 +0100, Schroeder, Alexander wrote: > >Hi Sven, > > > >you are right. I will fix this in the next release. > > > >Regards > >Alexander Schröder > >SAP Labs Berlin > > > >> -----Original Message----- > >> From: Sven Köhler [mailto:[EMAIL PROTECTED]] > >> Sent: Sunday, January 19, 2003 7:46 PM > >> To: [EMAIL PROTECTED] > >> Subject: [BUG?] JDBC: ResultSet.relative(n) > >> > >> > >> Hi, > >> > >> If a ResultSet has just been returned from the > >> executeQuery()-methode, > >> calling relative(n) with n>1 and even with n=1 causes a > >> "com.sap.dbtech.jdbc.exceptions.JDBCDriverException: SAP > DBTech JDBC: > >> Result set is positioned before first row." > >> > >> As the javadoc of ResultSet state, the case n=1 should be > >> identical to > >> calling the next() method. But it isn't. It throws the above > >> Exception, > >> which isn't thrown, when i call next(); > >> > >> I don't think, that calling relative(n) with n>1 should > fail either. > >> > >> Thx > >> Sven > > > Read again the specification, the text says that relative > must throw SQLException if there are not current row, and > this is the situation before you call next. > > Regards > Blas Rodriguez Somoza > > _______________________________________________ sapdb.general mailing list [EMAIL PROTECTED] http://listserv.sap.com/mailman/listinfo/sapdb.general
