锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产三级一区,91精品啪在线观看国产60岁,国产成人亚洲一区二区三区http://www.aygfsteel.com/nakupenda77/鎶鏈崥瀹?/description>zh-cnWed, 18 Jun 2025 03:08:56 GMTWed, 18 Jun 2025 03:08:56 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;
  }
}



]]>
主站蜘蛛池模板: 新野县| 青浦区| 繁昌县| 镶黄旗| 连平县| 惠来县| 永和县| 敦煌市| 江门市| 克东县| 屏山县| 淮南市| 安陆市| 和政县| 华容县| 普兰店市| 丽水市| 汶上县| 清流县| 宣威市| 靖远县| 明溪县| 锡林浩特市| 崇文区| 察哈| 扶风县| 驻马店市| 桐庐县| 永济市| 阿瓦提县| 唐河县| 连云港市| 堆龙德庆县| 平远县| 洪泽县| 巢湖市| 资中县| 繁峙县| 青神县| 芜湖市| 平阴县|