我的网络应用中有两个数据来源。 i 正在连接<代码>数据Source1.getConnection()。
my question is consider below code:
Connection connection = null;
connection = dataSource1.getConnection();
connection = dataSource2.getConnection();
connection.close();
我正在读到<条码>数据Source1链接,并立即分配<条码>数据Source2链接到链接变量。
As I am closing dataSource2
connection, does dataSource1
connection remains open? Or do I need to do as below?
Connection connection = null;
connection = dataSource1.getConnection();
connection.close();
connection = dataSource2.getConnection();
connection.close();