16
private void insertIntoMyTable (Myclass m) {
String query = "INSERT INTO MYTABLE (NAME) VALUES (?)";
jdbcTemplate.update(query, m.getName());
}
When the above query inserts a record, the ID column in the table autoincrements.
Is there a way to get this auto incremented ID back at the time of the insertion. So in this example the return value of my method would be int