首页>代码>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; } }

lxm2440226414 LV2
2024年6月10日
dabacar LV1
2024年5月27日
asddwh LV13
2023年12月29日
颜菜菜 LV2
2023年12月14日
jiemomo LV12
2023年11月2日
dsadasdSDASD LV1
2023年10月31日
蹇金金 LV7
2023年10月31日
hongdongdong LV14
2023年6月25日
qq2901732871 LV9
2023年5月20日
wenyunasd LV1
2023年3月21日

dongandmin LV8
2024年12月27日
ma406805131 LV19
2024年12月27日
krispeng LV14
2024年9月10日
时光海 LV2
2024年6月30日
3334004690 LV10
2024年6月28日
赵鑫cdsaljkdfsa LV11
2024年6月26日
TY0165 LV20
2024年6月26日
liyan54188 LV2
2024年6月25日
lxm2440226414 LV2
2024年6月10日
勿念时光 LV1
2024年5月31日