I am trying to get the mysql command like mysql_insert_id(); which retrieve the last inserted row\'s auto_increment id. What can I do to get it in Java?
rs =
Why not
SELECT MAX(id) FROM schedule
If id your column has a different name than id, you need to replace it accordingly in the above query.
id
You can use it like:
rs = st.executeQuery("SELECT MAX(id) AS id FROM schedule"); int lastid = rs.getInt("id");