MCPcopy Index your code
hub / github.com/castello/spring_basic / updateUser

Method updateUser

ch4/UserDaoImpl.java:85–109  ·  view source on GitHub ↗
(User user)

Source from the content-addressed store, hash-verified

83 }
84
85 @Override
86 public int updateUser(User user) throws Exception {
87 int rowCnt = 0;
88
89 String sql = "UPDATE user_info " +
90 "SET pwd = ?, name=?, email=?, birth =?, sns=?, reg_date=? " +
91 "WHERE id = ? ";
92
93 try (
94 Connection conn = ds.getConnection();
95 PreparedStatement pstmt = conn.prepareStatement(sql);
96 ){
97 pstmt.setString(1, user.getPwd());
98 pstmt.setString(2, user.getName());
99 pstmt.setString(3, user.getEmail());
100 pstmt.setDate(4, new java.sql.Date(user.getBirth().getTime()));
101 pstmt.setString(5, user.getSns());
102 pstmt.setTimestamp(6, new java.sql.Timestamp(user.getReg_date().getTime()));
103 pstmt.setString(7, user.getId());
104
105 rowCnt = pstmt.executeUpdate();
106 }
107
108 return rowCnt;
109 }
110
111 @Override
112 public int count() throws Exception {

Callers

nothing calls this directly

Calls 7

getPwdMethod · 0.45
getNameMethod · 0.45
getEmailMethod · 0.45
getBirthMethod · 0.45
getSnsMethod · 0.45
getReg_dateMethod · 0.45
getIdMethod · 0.45

Tested by

no test coverage detected