public String deleteStudent(String studentid) { int noOfUpdates = 0; String message = ""; try { String strQuery = "DELETE FROM StudentCourse WHERE StudentID = " + studentid + " DELETE FROM StudentModuleResult WHERE StudentID = " + studentid; PreparedStatement stmt = conn.prepareStatement(strQuery); stmt.setString(1, studentid); noOfUpdates = stmt.executeUpdate(); } catch (SQLException e) { message = "SQL Exception: " + e.getMessage(); } if (message.length() ==0 && noOfUpdates == 0) message = "Record was not updated"; return message; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)