ivaneeo's blog

          自由的力量,自由的生活。

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            669 Posts :: 0 Stories :: 64 Comments :: 0 Trackbacks
          private void disconnect() throws Exception {
            if (con != null) {
            con.close();
            con = null;
            }
          }

          protected void connect() throws Exception {
          disconnect();
          con = getConnection();
          }

          上面是一般寫法.
              public Connection getConnection() throws Exception {
                  Class.forName(props.getProperty("driver"));
                  String url = props.getProperty("url");
                  Connection con = DriverManager.getConnection(url, props);
          //        showWarnings(con.getWarnings());
                  initLanguage(con);

                  return con;
              }
          posted on 2005-08-04 21:12 ivaneeo 閱讀(179) 評論(0)  編輯  收藏 所屬分類: java魔力
          主站蜘蛛池模板: 庆云县| 安阳县| 民丰县| 富锦市| 突泉县| 察雅县| 南木林县| 佳木斯市| 道孚县| 敦煌市| 宝应县| 察雅县| 林芝县| 定远县| 宝丰县| 沾化县| 屯昌县| 新源县| 勃利县| 时尚| 柏乡县| 宿松县| 苏尼特左旗| 新营市| 玛曲县| 昆明市| 博兴县| 襄汾县| 同仁县| 名山县| 鄂州市| 太原市| 汉寿县| 芮城县| 耒阳市| 西盟| 阜新市| 汨罗市| 罗甸县| 银川市| 康平县|