首页>代码>Spring+Spring MVC+Maven+bootstrap+mysql+JdbcTemplate图书馆后台管理系统>/book/src/main/java/com/book/dao/AdminDao.java
package com.book.dao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Repository; @Repository public class AdminDao { private JdbcTemplate jdbcTemplate; @Autowired public void setJdbcTemplate(JdbcTemplate jdbcTemplate) { this.jdbcTemplate = jdbcTemplate; } private static final String MATCH_ADMIN_SQL="SELECT COUNT(*) FROM admin where admin_id = ? and password = ? "; private static final String RE_PASSWORD_SQL="UPDATE admin set password = ? where admin_id = ? "; private static final String GET_PASSWD_SQL="SELECT password from admin where admin_id = ?"; public int getMatchCount(int adminId,String password){ return jdbcTemplate.queryForObject(MATCH_ADMIN_SQL,new Object[]{adminId,password},Integer.class); } public int rePassword(int adminId,String newPasswd){ return jdbcTemplate.update(RE_PASSWORD_SQL,new Object[]{newPasswd,adminId}); } public String getPasswd(int id){ return jdbcTemplate.queryForObject(GET_PASSWD_SQL,new Object[]{id},String.class); } }

1587039373 LV3
2024年1月4日
小白jmhuang LV12
2023年12月6日
低调人 LV38
2022年12月16日
嗯啊哈尔滨西湖 LV1
2022年12月15日
微信网友_6248713511227392 LV11
2022年12月5日
1803466516 LV4
2022年7月9日
Simon_ydl LV5
2022年5月23日
2678465764 LV1
2022年5月6日
97987179 LV1
2022年4月9日
742773198 LV2
2022年3月18日

微信网友_7289626841501696 LV4
6月15日
bluerstar LV1
2024年10月23日
zhengguangshun LV4
2024年8月25日
shuiyan LV1
2024年6月1日
寄此123456 LV1
2024年4月30日
akittyboy LV9
2024年4月16日
LisboyR
2024年4月11日
暂无贡献等级
微信网友_6932324648046592
2024年4月1日
暂无贡献等级
黑 LV7
2024年3月29日
1437047954
2024年3月7日
暂无贡献等级