As per Spring 3.2 Data access docs, SimpleJdbcInsert can be use to retrieve auto generated keys. But, I cannot override the final method setDataSource from JdbcDaoSupport in the code below:
public class LoginDAOImpl extends JdbcDaoSupport implements LoginDAO {
// Cannot override the final method from JdbcDaoSupport
public void setDataSource(DataSource dataSource) {
}
JdbcDaoSupport class is not extended in the Spring 3.2 doc. So, I have 2 questions:
How to use SimpleJdbcInsert to retrieve auto-generated keys while extending JdbcDaoSupport class?
If I do not extend JdbcDaoSupport then what shall be the code changes in the configuration file and dao class. Please find below current configuration and dao code:
configuration file:
<bean id="loginDao" class="com.vikas.dao.LoginDAO"
p:dataSource-ref="dataSource" />
relevant doa code:
getJdbcTemplate().update(...);