MySQL: How te get last autoincrenment id.

There are three ways using java: http://dev.mysql.com/doc/refman/6.0/en/connector-j-usagenotes-basic.html#connector-j-examples-autoincrement-getgeneratedkeys This is the one I prefere, because the value is scoped by the Statment instance, hence only overwritten when I reuse the specific Statement: Statement stmt = null; ResultSet rs = null;   try {   // // Create a Statement instance that we can use for // Continue reading →