@Autowired public void setDataSource(DataSource dataSource) { jdbcInsert = new SimpleJdbcInsert(dataSource); jdbcInsert.setTableName("tb_user"); jdbcInsert.setGeneratedKeyName("user_id"); jdbcTemplate = new JdbcTemplate(dataSource); }
public RelayDaoImpl(JdbcTemplate jdbcTemplate) { this.jdbcTemplate = jdbcTemplate; this.jdbcInsert = new SimpleJdbcInsert(jdbcTemplate); jdbcInsert.setTableName("relaynames"); }