I've used the following code in php to get the auto-incremented primary key column value returned after an insert: $sql = "insert into mytable (columnB) values ('Test')"; $columnA = mysql_insert_id(); I haven't been able to repeat this in Java. I have tried: int columnA; Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet rst = stmt.executeQuery("select * from mytable"); rst.moveToInsertRow(); rst.updateString(2, 'Test'); rst.insertRow(); columnA = rst.getInt(1); //For a table: // create table mytable (columnA int auto_increment primary key, // columnB varchar(10)); Many Thanks