Page 226 - 3-1
P. 226
public void deleteOne(int bno){
sb.setLength(0);
sb.append("delete from Tool ");
sb.append("where bno = ? ");
try{
pstmt = conn.prepareStatement(sb.toString());
pstmt.setInt(1, bno);
pstmt.executeUpdate();
} catch (SQLException e){
e.printStackTrace();
}
}
public void close(){
if(rs != null){
try{
rs.close();
if(pstmt != null)
pstmt.close();
if(conn != null)
conn.close();
}catch (SQLException e){
e.printStackTrace();
}
}
}
}
- 226 -