Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <jsp:scriptlet>
- try {
- Connection con = ConnectionFactory.getConnection();
- Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
- ResultSet.CONCUR_READ_ONLY);
- String strQry = "";
- String sId = request.getParameter("_sid");
- if (sId.isEmpty())
- {
- response.getWriter().println("<h3>Invalid input.</h3>");
- return;
- }
- //The next 5 lines are an experiment. By moving them around in the block,
- //I attempt to see where
- //netbeans is complaining. It doesn't seem to like the "if" statement above.
- }
- catch (Exception e)
- {
- }
- </jsp:scriptlet>
- <jsp:scriptlet>
- //end experiment
- // if (request.getParameter("retrieveButton").equals("Retrieve Record"))
- // {
- // strQry = "DELETE FROM Record WHERE s_id='" + request.getParameter("_sid") + "'";
- // }
- stmt.execute(strQry);
- response.getWriter().println("<h3>Record " + sId + " deleted.");
- }
- catch (SQLException sqle)
- {
- response.getWriter().println("<h3>Error: Record not in database</h3>");
- }
- </jsp:scriptlet>
Add Comment
Please, Sign In to add comment