Hi,
is it possible to open a JdbcTemplate connection in read only mode, so that I can't perform any changes to the underlying data source?
Hi,
is it possible to open a JdbcTemplate connection in read only mode, so that I can't perform any changes to the underlying data source?
I don't believe the JDBC connection API allows this.
You have two choices:
The second choice is obviously more flexible and in the spirit of Spring's natural idiom.
Use Spring Transactions and declare the transaction as readOnly. See http://static.springsource.org/spring/docs/2.5.6/reference/transaction.html#transaction-declarative-annotations