ivaneeo's blog

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

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            669 Posts :: 0 Stories :: 64 Comments :: 0 Trackbacks

          常用鏈接

          留言簿(34)

          我參與的團隊

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          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魔力
          主站蜘蛛池模板: 莒南县| 承德市| 翁源县| 曲沃县| 弥勒县| 肇源县| 澄江县| 桓仁| 顺昌县| 廉江市| 洱源县| 平利县| 津南区| 元氏县| 阿巴嘎旗| 饶河县| 北宁市| 亳州市| 太和县| 五大连池市| 关岭| 策勒县| 建阳市| 台湾省| 德江县| 丹东市| 比如县| 桐乡市| 鹤庆县| 灵璧县| 合山市| 家居| 临沂市| 余庆县| 禄劝| 交城县| 金堂县| 防城港市| 华宁县| 凤山县| 西华县|