I have the following code:
@Test
public void springTest() throws SQLException{
//Connect to the DB.
DriverManagerDataSource dataSou
Looking at the Spring's code this is my understanding at a high level.
You are creating a DriverManagerDataSource. This internally uses DataSourceUtils to get a connection. And it only reuses the connection if there is an active transaction in progress. So if you run both the executes in a single transaction then it will use the same connection. Or you can also use pooling with 1 connection so that a single connection is created and reused.