I’m writing a computer program using Java (JDBC) and I’m having trouble getting auto-incremented keys from my Microsoft Access database. Currently I have three instances of Connection, Statement and ResultSet from the java.sql.* package.
What do I do to get a generated key from my database for a row, and then set that value to a String so I can display it in a text field?
Statement.getGeneratedKeys()
Disclaimer: May not be supported by your driver.
Example