AdminUser.java
上传用户:jishiqi_cj
上传日期:2022-08-08
资源大小:24765k
文件大小:1k
- package StudyNews;
- import java.util.*;
- import java.sql.Connection;
- import java.sql.ResultSet;
- public class AdminUser {
- private String username = null;
- private String password = null;
- private String subject = null;
-
-
- public AdminUser(){}
- public void setUsername(String username) {
- this.username = username;
- }
-
- public String getUsername() {
- return username;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public String getPassword() {
- return password;
- }
- public void setSubject(String subject) {
- this.subject = subject;
- }
-
- public String getSubject() {
- return subject;
- }
-
-
- public static boolean CheckUser(DB db,String name,String psw,String subject) throws Exception{
- String strSql;
- ResultSet rs;
- strSql = "select * from adminuser where username='" + name + "'"
- + " and password='" + psw + "'"
- + " and subject='" + subject + "'";
- rs = db.OpenSql(strSql);
- if ( rs.next()) {
- return true;
- }
- else{
- return false;
- }
-
- }
-
- }