ivaneeo's blog

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

            BlogJava :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
            669 Posts :: 0 Stories :: 64 Comments :: 0 Trackbacks

          常用鏈接

          留言簿(34)

          我參與的團(tuán)隊(duì)

          搜索

          •  

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          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 閱讀(180) 評(píng)論(0)  編輯  收藏 所屬分類: java魔力
          主站蜘蛛池模板: 营口市| 金门县| 北流市| 台南县| 奎屯市| 忻城县| 绍兴市| 白朗县| 西丰县| 石狮市| 巢湖市| 库尔勒市| 宁波市| 青阳县| 连平县| 平果县| 中方县| 蚌埠市| 确山县| 福鼎市| 崇明县| 怀柔区| 平武县| 漳平市| 甘德县| 登封市| 龙川县| 交口县| 大英县| 正镶白旗| 德保县| 汤原县| 南溪县| 延边| 光山县| 成都市| 鲁甸县| 密云县| 额济纳旗| 惠东县| 泸州市|