gogogo119

          tt

           

           1         try {
           2             con = CHDUtils.getRefConnection("jdbc/umds");
           3             PreparedStatement ps = con.prepareStatement("select userID, password from " +
           4                     "t_users where name = ? and deleted = 0");
           5             ps.setString(1, name);
           6             ResultSet rs = ps.executeQuery();
           7             if (rs.next()) {
           8                 userID = rs.getString("userID");
           9                 String pass = rs.getString("password");
          10                 boolean cert = UMUtils.encodePass(new String(password)).equals(pass);
          11                 if (cert) {
          12                     result = findByPrimaryKey(userID);
          13                     if (result.getStatus() == User.STATUS_DISABLE) result = null;
          14                     LogAction la = new LogAction("登陸成功", name);
          15                     TLUtils.getTraceLogMgrLocal().createLog(la);
          16                 }
          17                 else {
          18                     LogAction la = new LogAction("登陸失敗,密碼錯誤", name);
          19                     TLUtils.getTraceLogMgrLocal().createLog(la);
          20                 }
          21             }
          22             else {
          23                 LogAction la = new LogAction("登陸失敗,用戶名錯誤", name);
          24                 TLUtils.getTraceLogMgrLocal().createLog(la);
          25             }
          26             if (rs != null)
          27                 rs.close();
          28             if (ps != null)
          29                 ps.close();
          30         }

          posted on 2009-08-14 13:48 消防員 閱讀(75) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           

          My Links

          Blog Stats

          常用鏈接

          留言簿

          隨筆檔案

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 永宁县| 永泰县| 宣城市| 康定县| 龙川县| 沁源县| 舞钢市| 甘孜| 安图县| 荔波县| 杭州市| 邵武市| 襄城县| 玉山县| 惠安县| 常山县| 安新县| 漾濞| 合作市| 伊吾县| 台中县| 龙里县| 石门县| 海伦市| 和田县| 来宾市| 宣化县| 中江县| 武川县| 鹤庆县| 平泉县| 合山市| 清涧县| 浦城县| 竹山县| 榆中县| 湟源县| 玉树县| 文安县| 武强县| 台南市|