###@###.### 2002-01-25
J2SE Version (please include all output from java -version flag):
java version "1.4.0-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-rc-b91)
Java HotSpot(TM) Client VM (build 1.4.0-rc-b91, mixed mode)
Does this problem occur on J2SE 1.3? Yes / No (pick one)
NullPointerExceptions and ArrayIndexOutOfBoundsExceptions exceptions
throw in the JDBC-ODBC bridge on JDK1.3.1.
Operating System Configuration Information (be specific):
Windows 2000, Windows NT4
Hardware Configuration Information (be specific):
P3, 866 Mhz with 512 MB Ram or P2 400Mhz with 256 MB Ram
Bug Description:
Cannot get the new value of the current inserted autoincrement column, you
will get the following 2 exceptions:
I) Execute "Test_InsertRow_Last" for the first time in an empty database
table "insertTable", and Invalid cursor state SQLException exception
throw on method "getObject(1):
Exception:
C:\j2sdk1.4.0-rc>c:\j2sdk1.4.0-rc\bin\java Test_InsertRow_Last
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6106)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6263)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataInteger(JdbcOdbc.java:3211)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataInteger(JdbcOdbcResultSet.java:5434)
at sun.jdbc.odbc.JdbcOdbcResultSet.getInt(JdbcOdbcResultSet.java:571)
at sun.jdbc.odbc.JdbcOdbcResultSet.getObject(JdbcOdbcResultSet.java:1675)
at Test_InsertRow_Last.main(Test_InsertRow_Last.java:21)
MSG: [Microsoft][ODBC Driver Manager] Invalid cursor state
II) Execute "Test_InsertRow_Last" for the second time after one record had
been inserted in the table, and invalid cursor position SQLException
exception throws on ResultSet.last() method:
Exception:
C:\j2sdk1.4.0-rc>c:\j2sdk1.4.0-rc\bin\java Test_InsertRow_Last
java.sql.SQLException: Cursor position (0) is invalid
at sun.jdbc.odbc.JdbcOdbcResultSet.absolute(JdbcOdbcResultSet.java:2405)
at sun.jdbc.odbc.JdbcOdbcResultSet.moveToCurrentRow(JdbcOdbcResultSet.java:4176)
at sun.jdbc.odbc.JdbcOdbcResultSet.last(JdbcOdbcResultSet.java:2222)
at Test_InsertRow_Last.main(Test_InsertRow_Last.java:20)
MSG: Cursor position (0) is invalid
Steps to Reproduce (be specific):
1. Create a ODBC DSN called "access" to the attached Access.mdb.
2. Execute Test_InsertRow_Last test program with b91 of JDK 1.4
Attachments:
db1.mdb
Test_InsertRow_Last.java