When using spring JdbcTemplate with prepared statements we can either set values of the parameters individually or just pass an array of objects.
jdbctemplate.update(sql, arg1, arg2);
or
jdbctemplate.update(sql, new Object[]{arg1, arg2});
Both of the methods are working. But I want to know how jdbctemplate knows to cast the data to match with the type of the database column when passed as an Object array.
And is there a performance difference in two methods?
How can I log the final query executed on the database. Enabling DEBUG logs for org.springframework.jdbc package didn't work for me.