강의노트
관련 글 69
[service]UserServiceImpl.java
강의노트/Spring
2013. 9. 4. 11:55
@Service("userService")public class UserServiceImpl implements IUserService {@AutowiredIUserDao userDao; @Overridepublic UserInfo findUserInfo(UserInfo user) throws SQLException {// TODO Auto-generated method stubUserInfo uInfo = userDao.findUserInfo(user);if(uInfo==null){//ID없음uInfo = user;}else if(uInfo.getUser_pass() != user.getUser_pass()){//비밀번호 불일치uInfo.setResult(UserInfo.NOT_MATCH_PASS);}..
[service]IUserService.java
강의노트/Spring
2013. 9. 4. 11:55
public interface IUserService {public UserInfo findUserInfo(UserInfo user) throws SQLException;public UserInfo insertUserInfo(UserInfo user) throws SQLException;public int updateUserInfo(UserInfo user) throws SQLException;public int deleteUserInfo(UserInfo user) throws SQLException;}
[dao]UserDaoImpl.java
강의노트/Spring
2013. 9. 4. 11:52
@Repository("userDao")public class UserDaoImpl implements IUserDao {@AutowiredSqlMapClientTemplate sqlMapClientTemplate;@AutowiredUserInfo user_info;@Overridepublic UserInfo findUserInfo(UserInfo user) throws SQLException {// TODO Auto-generated method stubUserInfo uInfo = (UserInfo)sqlMapClientTemplate.queryForObject("find_userinfo", user);return uInfo;} @Overridepublic UserInfo insertUserInfo(..
[dao]IUserDao.java
강의노트/Spring
2013. 9. 4. 11:50
public interface IUserDao { public UserInfo findUserInfo(UserInfo user) throws SQLException; public UserInfo insertUserInfo(UserInfo user) throws SQLException; public int updateUserInfo(UserInfo user) throws SQLException; public int deleteUserInfo(UserInfo user) throws SQLException; }
[resources]user_query.xml
강의노트/Spring
2013. 9. 4. 11:48
select * from p_userinfowhere 1=1user_id = #user_id#user_name = #user_name#insert into p_userinfo(user_id, user_pass, user_name, user_address, user_phone, user_email, user_sex, user_age)values(#user_id#, #user_pass#, #user_name#, #user_address#, #user_phone#, #user_email#, #user_sex#, #user_age#)update p_userinfo set user_pass="#user_pass#", user_name="#user_name#", user_address="#user_address#"..
[model]UserInfo.java
강의노트/Spring
2013. 9. 4. 11:05
@Component("user_info") public class UserInfo { public static final int NOT_EXIST_USER = -1; public static final int NOT_MATCH_PASS = 0; public static final int EXIST_USER = 1; int result = NOT_EXIST_USER; String user_id; String user_pass; String user_name; String user_address; String user_phone; String user_email; String user_sex; int user_age; public String getUser_id() { return user_id; } pub..