Spring - How to get access to java.sql.Connection object in Spring jdbc?

In Spring, you will mostly be dealing with JDBC template to perform normal database operations.

In some scenarios you may be required to get hold of Connection object to perform normal JDBC operations.

This can be done using the following code in springs.

Connection conn = DataSourceUtils.getConnection(getJdbcTemplate().getDataSource());

Search