title: Retrieve id of record just inserted into a Java DB (Derby) database
body: <p>I am connecting to a Java DB database with JDBC and want to retrieve the id (which is on auto increment) of the last record inserted. </p>
  
  <p>I see this is a common question, but I see <a href="https://stackoverflow.com/questions/3422168/safest-way-to-get-last-record-id-from-a-table">solutions</a> using for example MS SQL Server, what is the equivalent for Java DB?  </p>