You'll need a datasource
for working with JdbcTemplate
.
JdbcTemplate template = new JdbcTemplate(yourDataSource);
template.update(
new PreparedStatementCreator() {
public PreparedStatement createPreparedStatement(Connection connection)
throws SQLException {
PreparedStatement statement = connection.prepareStatement(ourInsertQuery);
//statement.setLong(1, beginning); set parameters you need in your insert
return statement;
}
});