0

I am using

JdbcTemplate update

method for insertion and I want to get the auto-generated key of the last insertion here is my code

JdbcTemplate insert = new JdbcTemplate(dataSource);
        int cid = insert.update(
                "INSERT INTO Clinician (name, password) VALUES(?,?)",
                new Object[] { "name",
                        "password" });
2

1 Answer 1

0

The update() method in JdbcTemplate is taking 2 parameters. 1.String 2.Object[] But when we call this method by passing a sting and an object, it is executed.

Please explain how it works ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.