| 66 | } |
| 67 | |
| 68 | public int deleteUser(String id) throws Exception { |
| 69 | Connection conn = ds.getConnection(); |
| 70 | |
| 71 | String sql = "delete from user_info where id= ? "; |
| 72 | |
| 73 | PreparedStatement pstmt = conn.prepareStatement(sql); // SQL Injection공격, 성능향상 |
| 74 | pstmt.setString(1, id); |
| 75 | // int rowCnt = pstmt.executeUpdate(); // insert, delete, update |
| 76 | // return rowCnt; |
| 77 | return pstmt.executeUpdate(); // insert, delete, update |
| 78 | } |
| 79 | |
| 80 | public User selectUser(String id) throws Exception { |
| 81 | Connection conn = ds.getConnection(); |