Hallo,

I've found a strange bug in the jdbc driver:
1. Selecting data from a table that contains 10 rows
2. Stepping forward throw the ResultSet (ResultSet.relative(1))
3. Stepping backward throw the ResultSet (ResultSet.relative(-1))
4. Jumping to last row (ResultSet.last())

The cursor is now on the last row, but ResultSet.getRow() retrieves 9.
But intern the driver is on the correct row, because
ResultSet.getObject(int) retrieves the correct value for row 10.

I attached a little test suite:
Driver version: package com.sap.dbtech.jdbc, "SAP DB JDBC Driver", "SAP AG",
"7.3.0    Build 023-000-085-131"
Creating table 'CURSORPOSITION'
Inserting data to table 'CURSORPOSITION' (10 rows)
Selection data from table 'CURSORPOSITION'
Stepping forward throw ResultSet
CURSOR POS: 1, CONTENT: 1
CURSOR POS: 2, CONTENT: 2
CURSOR POS: 3, CONTENT: 3
CURSOR POS: 4, CONTENT: 4
CURSOR POS: 5, CONTENT: 5
CURSOR POS: 6, CONTENT: 6
CURSOR POS: 7, CONTENT: 7
CURSOR POS: 8, CONTENT: 8
CURSOR POS: 9, CONTENT: 9
CURSOR POS: 10, CONTENT: 10
Stepping backward throw ResultSet
CURSOR POS: 10, CONTENT: 10
CURSOR POS: 9, CONTENT: 9
CURSOR POS: 8, CONTENT: 8
CURSOR POS: 7, CONTENT: 7
CURSOR POS: 6, CONTENT: 6
CURSOR POS: 5, CONTENT: 5
CURSOR POS: 4, CONTENT: 4
CURSOR POS: 3, CONTENT: 3
CURSOR POS: 2, CONTENT: 2
CURSOR POS: 1, CONTENT: 1
Jumping to last row
CURSOR POS: 9, CONTENT: 10
Dropping table 'CURSORPOSITION'

Hope this will help,
regards,
Kolja

Mit besten Gruessen
Kolja Kleist (Senior Developer)
____________________________________
MediaTransfer AG
Netresearch & Consulting
Rothenbaumchaussee 38, 20148 Hamburg
Tel: (040) 669 625 16
Fax: (040) 669 625 29
URL: http://b2b.mediatransfer.de
____________________________________

Attachment: CursorPosition.java
Description: Binary data

Reply via email to