posted 22 years ago
I'm writing a record to a table in a MySQL database. The field is set up to autoincrement.
How do I handle this?
When I write my PreparedStatement, do I include a placeholder?
tableName.setInt(1,??? what do I put here? I don't know what this value will be?)
Do I have to lock the table, get the highest value, increment by one, unlock the table, add my record (and hope nobody wrote a record between my unlock and my write)?
Thanks,
Pres