?? loginbean.java
字號:
package Bean;
import Action.LoginActionForm;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
/*
* Created by IntelliJ IDEA.
* User: ZhangRui
* Date: 2007-10-13
* Time: 8:03:53
*/
public class LoginBean {
public boolean LoginCheck(LoginActionForm actionForm) {
String userName = actionForm.getUserName();
String passWord = actionForm.getPassWord();
Boolean check = false;
Connection conn = DatabaseConn.getConnection();
ResultSet rs;
try {
String sql = "select * from userinfo where userName = ? and userPswd = ?";
PreparedStatement smt = conn.prepareStatement(sql);
smt.setString(1, userName);
smt.setString(2, passWord);
rs = smt.executeQuery();
while (rs.next()) {
check = true;
}
rs.close();
conn.close();
} catch (Exception e) {
System.out.println(e.toString());
}
return check;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -