package com.java.dao; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import com.java.model.User; public class UserDao { /** * 腎翹桄痐 * @param con * @param user * @return * @throws Exception */ public User login(Connection con,User user) throws Exception{ User resultUser=null; String sql="select * from t_user where userName=? and password=?"; PreparedStatement pstmt=con.prepareStatement(sql); pstmt.setString(1, user.getUserName()); pstmt.setString(2, user.getPassword()); ResultSet rs=pstmt.executeQuery(); if(rs.next()){ resultUser=new User(); resultUser.setUserName(rs.getString("userName")); resultUser.setPassword(rs.getString("password")); } return resultUser; } }
最近下载更多
微信网友_6445756515635200 LV3
2023年12月18日
hahaha_123 LV2
2023年6月29日
你们的代码都是我的了 LV16
2023年6月13日
nn1349017 LV5
2023年5月30日
122378 LV3
2022年12月14日
wkq888 LV16
2022年6月18日
hebe灬 LV5
2022年5月16日
与尔同消万古愁 LV2
2021年11月28日
SuperShot LV13
2021年6月22日
767299026 LV8
2021年6月20日
最近浏览更多
周青松 LV3
3月18日
jiayongchao258 LV9
2023年12月28日
lshlsh
2023年12月25日
暂无贡献等级
微信网友_6445756515635200 LV3
2023年12月18日
Aban-beautiful
2023年12月16日
暂无贡献等级
3993zby
2023年12月15日
暂无贡献等级
李朝磊 LV18
2023年12月3日
zm111326 LV1
2023年10月25日
sunshine9920 LV12
2023年10月23日
wspcyhy LV1
2023年9月26日