JSP Code:
<%
String aref = request.getParameter("ArR");
try {
Class.forName("com.mysql.jdbc.Driver");
java.sql.Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/airproject", "root",
"root");
ResultSet rs;
Statement st = con.createStatement();
System.out.println("insert into demo values('" + aref + "')");
st.executeUpdate("insert into demo values('" + aref + "')");
System.out.println("Record Saved");
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
session.setAttribute("Result", "Registered successfully");
response.sendRedirect("menu0.jsp");
%>
HTML Code:
Registration
These code don't have problem in storing in the back-end. But when it return to back to form the value what i have enter, it should retain.
Thanks in advance
What I have tried:
JSP Code:
<%
String aref = request.getParameter("ArR");
try {
Class.forName("com.mysql.jdbc.Driver");
java.sql.Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/airproject", "root",
"root");
ResultSet rs;
Statement st = con.createStatement();
System.out.println("insert into demo values('" + aref + "')");
st.executeUpdate("insert into demo values('" + aref + "')");
System.out.println("Record Saved");
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
session.setAttribute("Result", "Registered successfully");
response.sendRedirect("menu0.jsp");
%>
HTML Code:
Registration
These code don't have problem in storing in the back-end. But when it return to back to form the value what i have enter, it should retain.
Thanks in advance