81,091
社区成员
发帖
与我相关
我的任务
分享
设置初始连接数、最小和最大连接数以及最大处理时间
pool.setInitConn( 100 );
pool.setMinConn( 100 );
pool.setMaxConn( 200 );
pool.setMaxIdle( 1000 * 60 * 60 * 6 );
for (int i = 0; i < 100; i++) {
Thread thread = new Thread(){
public void run(){
while (true) {
System.out.println(Receiver.getInstance().get("bj"));
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
};
thread.start();
}
设置初始连接数、最小和最大连接数以及最大处理时间
pool.setInitConn( 100 );
pool.setMinConn( 100 );
pool.setMaxConn( 200 );
pool.setMaxIdle( 1000 * 60 * 60 * 6 );
for (int i = 0; i < 100; i++) {
Thread thread = new Thread(){
public void run(){
while (true) {
System.out.println(Receiver.getInstance().get("bj"));
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
};
thread.start();
}