private void sendUpdateForm(HttpServletRequest request, HttpServletResponse response)
throws IOException {
String id = request.getParameter("id");
PrintWriter out = response.getWriter();
out.println("
Update Form
");
out.println("
Please edit the first name, last name or password.");
out.println("
");
try {
String sql = "SELECT FirstName, LastName," +
" UserName, Password" +
" FROM Users" +
" WHERE Id=" + id;
Connection con = DriverManager.getConnection(dbUrl);
Statement s = con.createStatement();
ResultSet rs = s.executeQuery(sql);
if (rs.next()) {
String firstName = rs.getString(1);
String lastName = rs.getString(2);
String userName = rs.getString(3);
String password = rs.getString(4);
out.println("
");
}
s.close();
con.close();
}
catch (SQLException e) {
out.println(e.toString());
}
catch (Exception e) {
out.println(e.toString());
}
}