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;
}
}
最近下载更多
15592940706 LV3
6月16日
微信网友_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 LV17
2022年6月18日
hebe灬 LV5
2022年5月16日
与尔同消万古愁 LV2
2021年11月28日
SuperShot LV13
2021年6月22日
最近浏览更多
chengjingjingjing
6月17日
暂无贡献等级
15592940706 LV3
6月16日
曾纪荣
3月2日
暂无贡献等级
yuanshun LV7
2024年12月10日
无异偶 LV3
2024年7月21日
郑郭辉
2024年6月3日
暂无贡献等级
周青松 LV3
2024年3月18日
jiayongchao258 LV9
2023年12月28日
lshlsh
2023年12月25日
暂无贡献等级
微信网友_6445756515635200 LV3
2023年12月18日

