This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
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