/**
* 添加数据连接
*/
public void addConnection() {
Connection conn = null;
if (pool != null) {
} else {
readConfig();
pool = new Vector(poolSize);
poolout = new Vector(poolSize);
}
if (pool.isEmpty() && (poolSize - poolout.size() == 0)) {
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
}
}
for (int i = pool.size(); i < (poolSize - poolout.size()); i++) {
try {
Class.forName(driverClassName);
conn =
java.sql.DriverManager.getConnection(url, username, password);
pool.add(conn);
} catch (Exception e) {
e.printStackTrace();
}
}// end for
}