如果你是jsp+javabean那么把你的bean声明为application就可以了.

解决方案 »

  1.   

    单例(singleton)模式
    http://www.jdon.com/designpatterns/singleton.htm
      

  2.   

    public Singleton{
      private static Singleton instance;
      public syschronized getInstance(){
        if (instance == null){
           instance = new Singleton();
        }
        return instance;
      }
    }
    用Singleton.getInstance()调用生成类事例
      

  3.   

    用synchronized
    把你的连接放到这个同步的模块下就可以了
    就不需要每次都写CLASS。FORNAME了