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

Method insertUser

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

Source from the content-addressed store, hash-verified

63
64 // 사용자 정보를 user_info테이블에 저장하는 메서드
65 @Override
66 public int insertUser(User user) throws Exception {
67 int rowCnt = 0;
68 String sql = "INSERT INTO user_info VALUES (?,?,?,?,?,?, now()) ";
69
70 try(
71 Connection conn = ds.getConnection();
72 PreparedStatement pstmt = conn.prepareStatement(sql); // SQL Injection공격, 성능향상
73 ){
74 pstmt.setString(1, user.getId());
75 pstmt.setString(2, user.getPwd());
76 pstmt.setString(3, user.getName());
77 pstmt.setString(4, user.getEmail());
78 pstmt.setDate(5, new java.sql.Date(user.getBirth().getTime()));
79 pstmt.setString(6, user.getSns());
80
81 return pstmt.executeUpdate();
82 }
83 }
84
85 @Override
86 public int updateUser(User user) throws Exception {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected