I am trying to write a piece of code that will insert a new row into a
table with and auto incrementing identity column and retrieve the
underlying Microsoft ADO using the following code as an example:
// rs is an updatable ADODB.recordset object
// created with a 'select * from test_table'
// or 'select top 1 * from test_table'
rs("sample_column") = "hello world";
var newId = rs("id_column");
( assuming the table has 2 columns of which id_column is auto
The following Java code correctly creates the record
// rs is a scrollable, updatable ResultSet object
I have been unable to simple obtain the value of the newly created id
immediately after inserting the row (eventhough it is in the database)
and have tried many methods ( moving to different rows, chaing the
select statement etc etc) to do so.
The platform I am using is as follows:
Database: Microsoft SQL Server 7
Java Database Connectivity: JDataServer (by NetDirect)
If anyone can offer any assistance it would be much appreciated.