Generating unique IDs

http://docs.oracle.com/javase/6/docs/api/java/sql/Statement.html#getGeneratedKeys() http://stackoverflow.com/questions/1376218/is-ther-a-way-to-retrieve-the-autoincrement-id-from-a-prepared-statement String sql = "INSERT INTO table (column1, column2) values(?, ?)"; stmt = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); stmt.executeUpdate(); if(returnLastInsertId) { […]

Read More →

Tag Cloud