to godson_2003(载物) :what is your idea if u have such a case?to pdw2009(捡垃圾去上网) :I do not undertand you too well. Can you talk about it in detail?what do u mean by "application" ? to: lydvqq(碧水情缘♀黑哥) Confused! did you write your own connection pool by yourself?I just use the web server's .to zawx(submarine):\Good pattern. That is exactly How I did it . But is there more solution?
单例模式啊,看看设计模式书 public class Example{ private Example example;
......//其他属性
private Example(){} public synchronized Example getInstance(){ if(null == example) example = new Example(); return example; } }
to: lydvqq(碧水情缘♀黑哥) Confused! did you write your own connection pool by yourself?I just use the web server's .to zawx(submarine):\Good pattern. That is exactly How I did it . But is there more solution?
public class Example{
private Example example;
......//其他属性
private Example(){} public synchronized Example getInstance(){
if(null == example) example = new Example();
return example;
}
}