Guest User

Untitled

a guest
Feb 27th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. String d=request.getParameter("bday");
  2.  
  3. Extra_User.jsp
  4.  
  5. <html>
  6. <body>
  7. <form name="frm1" method="post" action="Extra_User_Data.jsp">
  8. <font size="4">Birthday<td><input type="date" id="bday">
  9. </form>
  10. </body>
  11. </html>
  12.  
  13. Extra_User_Data.jsp
  14.  
  15. <%@page import="java.sql.*"%>
  16. <%
  17. try
  18. {
  19. String d=request.getParameter("bday");
  20.  
  21. Connection cn;
  22. Statement st;
  23.  
  24. Class.forName("com.mysql.jdbc.Driver");
  25. cn=DriverManager.getConnection("jdbc:mysql://localhost:3306/main","root","");
  26. st=cn.createStatement();
  27. st.executeUpdate("INSERT INTO newuser(dob)VALUES('"+d+"')");
  28. out.println("Insert SuccessFull");
  29. }
  30.  
  31. catch(SQLException sq)
  32. {
  33. out.println(sq.toString());
  34. }
  35. %>
Add Comment
Please, Sign In to add comment