点击这里给我发消息 点击这里给我发消息

用户登录的验证完整程序

添加时间:2013-12-7
    相关阅读: 程序 SQL

public String validateUser(String inputUserid, String inputPwd)


throws SQLException{


String returnString = null;


String dbUserid = "userid"; // Your Database user id


String dbPassword = "password" ; // Your Database password


Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");


Connection con = DriverManager.getConnection("jdbc:odbc:myDriver",


dbUserid ,dbPassword );


Statement stmt = con.createStatement();


String sql= "select USERID from USERTABLE where USERID = "" +


inputUserid + "" and PASSWORD = "" + inputPwd +"" ;" ;


ResultSet rs = stmt.executeQuery(sql);


if (rs.next())


{


returnString = rs.getString("USERID");


}


stmt.close();


con.close();


return returnString ;


}


咨询热线:020-85648757 85648755 85648616 0755-27912581 客服:020-85648756 0755-27912581 业务传真:020-32579052
广州市网景网络科技有限公司 Copyright◎2003-2008 Veelink.com. All Rights Reserved.
广州商务地址:广东省广州市黄埔大道中203号(海景园区)海景花园C栋501室
= 深圳商务地址:深圳市宝源路华丰宝源大厦606
研发中心:广东广州市天河软件园海景园区 粤ICP备05103322号 工商注册