锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧产日产国产精品视频,国产超碰精品在线观看,99久久婷婷国产综合精品电影http://www.aygfsteel.com/nakupenda77/鎶鏈崥瀹?/description>zh-cnWed, 18 Jun 2025 02:44:38 GMTWed, 18 Jun 2025 02:44:38 GMT60涓涓畝鍗曠殑鍏充簬鏉冮檺鍒ゆ柇鐧婚檰鐨刯avaBean鏂囦歡http://www.aygfsteel.com/nakupenda77/archive/2012/05/26/379292.htmlL榪佸L榪佸Sat, 26 May 2012 12:06:00 GMThttp://www.aygfsteel.com/nakupenda77/archive/2012/05/26/379292.htmlhttp://www.aygfsteel.com/nakupenda77/comments/379292.htmlhttp://www.aygfsteel.com/nakupenda77/archive/2012/05/26/379292.html#Feedback1http://www.aygfsteel.com/nakupenda77/comments/commentRss/379292.htmlhttp://www.aygfsteel.com/nakupenda77/services/trackbacks/379292.htmlpackage userce;

import java.sql.*;
import java.io.*;
import java.util.*;
public class UserCheck {
  Connection con;
  ResultSet rs;
  public UserCheck() { }
  public Connection getConnect(){銆//榪炴帴鏁版嵁搴撶殑錛屼笉鐢ㄥ湪澶氳浜嗗惂
   try{
        Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
        }
   catch(ClassNotFoundException e){}
        String url = "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=flDataSource";
        String name = "sa";//寤鴻璁捐鏁版嵁搴撴椂錛屼笉瑕佺敤榛樿鐨剆a,鍙互寤虹珛涓涓湁鎿嶄綔鏉冮檺鐨勭敤鎴鳳紱
        String pass = "sa";
    try{
        con = DriverManager.getConnection(url,name,pass);
        }
    catch(SQLException e){}
        return con;
  }
 public  boolean userExist(String username){
    Connection con=null;
    PreparedStatement ps=null;
    ResultSet rs=null;
    boolean occupied=true;
    try{
       String sqlquery="select *from Userlist where username=?";
       con=this.getConnect();
       //this.getConnect()=getConnect();//鍏充簬this 鐨勭敤娉曪紝鎴戝埌鐜板湪鐞嗚В鐨勪篃涓嶆槸澶忓交錛屾垜榪欐牱鐢紝鍦ㄥ疄闄呮搷浣滀腑鏄氳繃鐨勶紝濡傛灉鏈変笉濡ヤ箣澶勶紝璇烽珮鎵嬫寚鏁欙紟
       ps=con.prepareStatement(sqlquery);
       ps.setString(2,username);
       rs=ps.executeQuery();
       if(!rs.next())
         occupied=false;
    }
    catch(SQLException e){
       e.printStackTrace();
    }
    finally{
      if(rs!=null) try{rs.close();}
                   catch(SQLException ignore){}
      if(ps!=null) try{ps.close();}
                   catch(SQLException ignore){}
      if(con!=null) try{con.close();}
                   catch(SQLException ignore){}
    }
    return occupied;
 }
public boolean isValidUser(String username,String userpwd){//姝ゅ嚱鏁扮敤鏉ュ垽鏂槸鍚︽湁姝ょ敤鎴?鍏跺疄寰堝ソ鐞嗚В鎴戝畾涔夋垚boolean鍨嬶紝灝卞彲浠ユ牴鎹繑鍥炲兼潵榪涜涓涓?lt;jsp:forword錛濓紓mmm.jsp錛?gt;.
   Connection con=null;
   PreparedStatement ps=null;
   ResultSet rs=null;
   boolean isValid=false;
   try{
      String sqlquery="select *from Userlist where username=? and userpwd=?";
      con=this.getConnect();
      ps=con.prepareStatement(sqlquery);
      ps.setString(1,username);
      ps.setString(2,userpwd);
      rs=ps.executeQuery();
      if(rs.next())
        isValid=true;
   }
   catch(SQLException e){
      e.printStackTrace();
   }
   finally{
         if(rs!=null) try{rs.close();}
                      catch(SQLException ignore){}
         if(ps!=null) try{ps.close();}
                      catch(SQLException ignore){}
         if(con!=null) try{con.close();}
                      catch(SQLException ignore){}
   }
   return isValid;
 }
  public int getUserPri(String username){  //嬈℃柟娉曟垜鐢ㄦ潵鏍規嵁浼犲叆鐨勫弬鏁幫細username錛堟垜璁劇疆session鏃訛紝鐢ㄧ殑涔熸槸username,鏍規嵁媯绱㈡暟鎹簱涓殑0錛?鏍囧織浣嶏紝鏉ュ垽鏂敤鎴風殑鏉冮檺錛岃繖鏍峰氨鍙互榪涜鐩稿簲鐨勬搷浣滐紟錛?br />    Connection con=null;
    PreparedStatement ps=null;
    ResultSet rs=null;
    int pri=0;
    try{
      String sqlquery="select variety from Userlist where username=? ";
      con=this.getConnect();
      ps=con.prepareStatement(sqlquery);
      ps.setString(1,username);
      rs=ps.executeQuery();
      if(rs.next())
        pri=rs.getInt("variety");
    }
    catch(SQLException e){
        e.printStackTrace();
    }
    finally{
       if(rs!=null) try{rs.close();}
                    catch(SQLException ignore){}
       if(ps!=null) try{ps.close();}
                    catch(SQLException ignore){}
       if(con!=null) try{con.close();}
                    catch(SQLException ignore){}

    }
    return pri;
  }
}



]]>
主站蜘蛛池模板: 太谷县| 海晏县| 鄂托克前旗| 句容市| 临海市| 赤水市| 香河县| 连平县| 福建省| 乳山市| 玉树县| 溧阳市| 三门峡市| 梧州市| 汝南县| 博兴县| 长汀县| 宁波市| 临西县| 荃湾区| 瓮安县| 偃师市| 柳林县| 昌都县| 郸城县| 手游| 门源| 英山县| 桦川县| 噶尔县| 通河县| 遂溪县| 乌兰县| 象山县| 贺州市| 尖扎县| 彰化县| 宿迁市| 鄄城县| 新密市| 临邑县|