You can't manage transactions in Spring easily without a transaction manager. To perform a transaction programatically is you would configure:
- JdbcTemplate with a datasource
- DataSourceTransactionManager using the same datasource
- TransactionTemplate using the DataSourceTransactionManager.
You would then do something like:
Code:
transactionTemplate.execute(new TransactionCallback() {
public Object doInTransaction(TransactionStatus status) {
return new Integer(jdbcTemplate.update("Insert Update SQL here"));
}
});