Guest User

Untitled

a guest
Jun 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. try{
  2.  
  3.  
  4. String driveName = "com.mysql.jdbc.Driver";
  5.  
  6.  
  7. Class.forName(driveName).newInstance();
  8.  
  9.  
  10.  
  11. } catch(java.lang.ClassNotFoundException e) {
  12. System.err.print("ClassNotFoundException: ");
  13. System.err.println(e.getMessage());
  14. }
  15. try{
  16. con = DriverManager.getConnection("jdbc:mysql://localhost:3306/onlinequiz","root","root");
  17. Statement statement =con.createStatement();
  18.  
  19.  
  20. // int id=Integer.parseInt(request.getParameter("T1"));
  21. int quizID = Integer.parseInt(request.getParameter("quizID"));
  22.  
  23. %>
  24. <%
  25.  
  26.  
  27.  
  28. statement.close();
  29.  
  30.  
  31.  
  32. } catch ( Exception e ) {
  33. out.println( "Exception: " + e.getMessage() );
  34. }
  35. // execute the statements even if the exception occurs
  36. finally{
  37.  
  38. }
  39. %>
Add Comment
Please, Sign In to add comment