Guest User

Untitled

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