一个支持双数据库的DB连接池

可以配2个不同的数据库,  10000000次8秒种

public class text
{
public static void main(String[] args) throws SQLException
{
long start2 = System.currentTimeMillis();
Connection conn = null;
for(int i = 1; i < 10000000; i++)
{
conn = DB.getConn(1);
conn.close();
}
System.out.println("经过10000000次的循环调用,使用连接池花费的时间" + (System.currentTimeMillis() - start2) + "ms\n");
}
}

猜你喜欢

转载自freedomawp-sina-com.iteye.com/blog/1005143