/**
* 初始化连接池中数据库连接个数
*
*/
private void initConnections(){
for(int i=0;i0&&maxCount>dataCount){
maxCount=dataCount;
}
}
ConnectionPool pool=new ConnectionPool(conn);
connections.addElement(pool);
} catch (SQLException e) {
e.printStackTrace();
//writerLog(e.getMessage());
//throw new RuntimeException("初始化连接池错误");
}
}
}
2021-09-28 17:07:13
5KB
连接池
1