JAva接続mysql削除操作
public void deleteStudent(int sid){
DBConnection db=new DBConnection();
PreparedStatement preStmt=null;
try {
preStmt=db.getConn().prepareStatement("delete from student where sid=?");
preStmt.setInt(1, sid);
preStmt.executeUpdate();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
// jsp
students = (ArrayList) request
.getAttribute("students");
if (students != null) {
for (int i = 0; i < students.size(); i++) {
%>