Guest User

Untitled

a guest
Oct 3rd, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. <%@ page import="java.sql.*" %>
  2. String time=request.getParameter("time");
  3. String url="jdbc:mysql://localhost:3306/pcs";
  4. String uname="root";
  5. String passw="publiccomplaint";
  6. String query="insert into test values(?)";
  7. Class.forName("com.mysql.jdbc.Driver");
  8. Connection
  9. con=DriverManager.getConnection(url,uname,passw);
  10. PreparedStatement st=con.prepareStatement(query);
  11. st.setString(1,time);
  12. int count=st.executeUpdate();
  13. st.close();
  14. con.close();
Add Comment
Please, Sign In to add comment