首页>代码>java web学生信息管理系统 >/StudentManagerWeb/src/com/ischoolbar/programmer/dao/AdminDao.java
package com.ischoolbar.programmer.dao;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.ischoolbar.programmer.model.Admin;
import com.ischoolbar.programmer.model.Clazz;

/**
 * 
 * @author llq
 *管理员数据库操作封装
 */
public class AdminDao extends BaseDao {
	
	public Admin login(String name ,String password){
		String sql = "select * from s_admin where name = '" + name + "' and password = '" + password + "'";
		ResultSet resultSet = query(sql);
		try {
			if(resultSet.next()){
				Admin admin = new Admin();
				admin.setId(resultSet.getInt("id"));
				admin.setName(resultSet.getString("name"));
				admin.setPassword(resultSet.getString("password"));
				admin.setStatus(resultSet.getInt("status"));
				return admin;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
	public boolean editPassword(Admin admin,String newPassword) {
		// TODO Auto-generated method stub
		String sql = "update s_admin set password = '"+newPassword+"' where id = " + admin.getId();
		return update(sql);
	}
}
最近下载更多
lzx602  LV3 4月15日
zhangjilu  LV18 1月1日
磊哥哥哥哥  LV13 2023年12月26日
heweimin  LV12 2023年12月12日
hapilong  LV5 2023年12月11日
蹇金金  LV7 2023年10月31日
卢本伟不开挂  LV4 2023年10月22日
skook7  LV2 2023年10月6日
刘洋66666  LV1 2023年9月19日
最近浏览更多
lzx602  LV3 4月15日
ruo12138  LV1 4月14日
jiuyin0919  LV1 4月1日
dameir 3月26日
暂无贡献等级
alphaeix 3月18日
暂无贡献等级
WBelong  LV7 3月8日
潘潘123456  LV2 3月2日
杨豫川  LV12 1月12日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友