首页>代码>java servlet+jsp+jdbc+jstl开发java web简单学生信息管理系统(含模糊查找,分页)>/jsp01/src/main/java/xyz/haiyao/dao/imp/UserDaoImp.java
package xyz.haiyao.dao.imp; import xyz.haiyao.dao.UserDao; import xyz.haiyao.pojo.Student; import xyz.haiyao.util.JDBCUtil; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class UserDaoImp implements UserDao { @Override public boolean login(String userName,String password){ Connection connection = null; PreparedStatement preparedStatement = null; ResultSet resultSet = null; try { connection = JDBCUtil.getConn(); System.out.println("状态是"+connection.isClosed()); String sql = "select * from t_user where username=? and password=?"; preparedStatement = connection.prepareStatement(sql); preparedStatement.setString(1,userName); preparedStatement.setString(2,password); resultSet = preparedStatement.executeQuery(); return resultSet.next(); } catch (SQLException e) { e.printStackTrace(); }finally { JDBCUtil.release(connection,preparedStatement,resultSet); } return false; } }
最近下载更多
asddwh LV12
2023年12月29日
颜菜菜 LV2
2023年12月14日
jiemomo LV12
2023年11月2日
dsadasdSDASD LV1
2023年10月31日
蹇金金 LV7
2023年10月31日
hongdongdong LV12
2023年6月25日
qq2901732871 LV9
2023年5月20日
wenyunasd LV1
2023年3月21日
xiaowangjj LV4
2022年12月29日
flyaing LV1
2022年12月16日
最近浏览更多
微信网友_6906962132258816 LV6
4月22日
WBelong LV7
4月2日
微信网友_6827593093173248
1月18日
暂无贡献等级
暂无贡献等级
asddwh LV12
2023年12月26日
eqeqleqeqn LV1
2023年12月22日
微信网友_6786215447367680 LV4
2023年12月20日
yuanshun LV6
2023年12月19日
liuqi666 LV1
2023年12月14日
颜菜菜 LV2
2023年12月14日