0

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?

1 Answer 1

0

Statement.getGeneratedKeys()

Disclaimer: May not be supported by your driver.

Example

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.