I have a small problem I have come accross, which I can't see an obious way round.
I have a RegistrationServlet (for creating a new user) which inserts the details of the new user into two seperate tables in a MS SQL database.
The first insert puts the users personal data into a table called tblUsers (name, dob, tel no, address, etc). The second insert puts the users security details into a table called tblUserSecurity (username, password, etc).
The problem I have is, the only way to uniquely identify the user is from the ID column (from tblUsers) which is set as the primary key and automatically created for each record added, I need to somehow take this value for the new user and insert it into the tblSecurity table along with the username, password etc as a way of linking the user to their security details.