MCPcopy Create free account
hub / github.com/castello/spring_basic / deleteUser

Method deleteUser

ch4/UserDaoImpl.java:20–35  ·  view source on GitHub ↗
(String id)

Source from the content-addressed store, hash-verified

18 DataSource ds;
19
20 @Override
21 public int deleteUser(String id) throws Exception {
22 int rowCnt = 0;
23 String sql = "DELETE FROM user_info WHERE id= ? ";
24
25 try ( // try-with-resources - since jdk7
26 Connection conn = ds.getConnection();
27 PreparedStatement pstmt = conn.prepareStatement(sql);
28 ){
29 pstmt.setString(1, id);
30 return pstmt.executeUpdate(); // insert, delete, update
31// } catch (Exception e) {
32// e.printStackTrace();
33// throw e;
34 }
35 }
36
37 @Override
38 public User selectUser(String id) throws Exception {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected