如何验证BasicDataSource 得到的是相同的2个连接?
BasicDataSource dataSource = new BasicDataSource();
dataSource.setUrl("");
dataSource.setDriverClassName("");
dataSource.setUsername("");
dataSource.setPassword("");
dataSource.setMaxActive(1);
Set<Connection> sets=new HashSet<Connection>();
for (int i = 0; i < 100; i++) {
Connection conn1 = dataSource.getConnection();
sets.add(conn1);
conn1.close();
}
System.err.println(sets.size());