(String id)
| 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 { |
nothing calls this directly
no outgoing calls
no test coverage detected