📄 reader.java
字号:
package library;
import java.sql.*;
public class Reader {
private String ReaderID = "";
private String passwd = "";
public Reader(String ID,String pd) throws Exception{
ReaderID = ID;
passwd = pd;
//check(ReaderID);
}
public void check(String id)throws Exception{
}
public boolean isLogin()throws Exception {
DBConnection myConnection = DBConnection.Instance();
String sqlQuery = "select * from reader where ReaderID='" + this.ReaderID +"' and password = '"+this.passwd+ "'";
ResultSet r = null;
r = myConnection.runQuery( sqlQuery );
if (r.next()){
r.close();
return true;
}else{
return false;
}
}
public String getRaderID() throws Exception{
if(this.isLogin())
return ReaderID;
else
return null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -