src/com/dao/AdminDao.java
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package com.dao;
import com.db.DBHelper;
import com.bean.AdminBean;
import java.util.*;
import java.sql.*;
public class AdminDao {
//验证登录
public String CheckLogin(String username, String password){
String id = null;
String sql="select * from Admin where Admin_Username='"+username+"' and Admin_Password='"+password+"'";
Statement stat = null;
ResultSet rs = null;
Connection conn = new DBHelper().getConn();
try{
stat = conn.createStatement();
rs = stat.executeQuery(sql);
while (rs.next()) {
id = rs.getString("Admin_ID");
}
}
catch(SQLException ex){}
return id;
}
//验证密码
public boolean CheckPassword(String id, String password){
boolean ps = false;
String sql="select * from Admin where Admin_ID='"+id+"' and Admin_Password='"+password+"'";
Statement stat = null;
ResultSet rs = null;
Connection conn = new DBHelper().getConn();
try{
stat = conn.createStatement();
rs = stat.executeQuery(sql);
while (rs.next()) {
ps=true;
}
}
catch(SQLException ex){}
return ps;
}
//获取列表
public List<AdminBean> GetList(String strwhere,String strorder){
String sql="select * from Admin";
if(!(isInvalid(strwhere)))
{
sql+=" where "+strwhere;
}
if(!(isInvalid(strorder)))
{
sql+=" order by "+strorder;
}
Statement stat = null;
ResultSet rs = null;
Connection conn = new DBHelper().getConn();
List<AdminBean> list=new ArrayList<AdminBean>();
try{
后面还有 163 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。