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)  編輯  收藏


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


          網站導航:
           

          My Links

          Blog Stats

          常用鏈接

          留言簿

          隨筆檔案

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 大同市| 甘洛县| 卓尼县| 通许县| 鹤岗市| 娄烦县| 建水县| 奈曼旗| 龙口市| 平乐县| 深圳市| 益阳市| 综艺| 乐亭县| 太湖县| 博罗县| 北碚区| 临桂县| 济源市| 龙川县| 海宁市| 博乐市| 镇雄县| 林口县| 南京市| 镇原县| 聂拉木县| 英德市| 浮山县| 彭州市| 泰来县| 扎囊县| 昭平县| 陵水| 揭阳市| 固原市| 甘德县| 珲春市| 台前县| 双流县| 资中县|