Advertisement
Guest User

Untitled

a guest
Mar 12th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. package demo;
  2.  
  3. import java.sql.SQLException;
  4.  
  5.  
  6. public class Main {
  7. public static void main(String[] args) throws SQLException {
  8. java.sql.Timestamp date = new java.sql.Timestamp(new java.util.Date().getTime());
  9. ConnectionFactory cf = new ConnectionFactory("jdbc:mysql://localhost:3306/sakila", "root", "alternanza");
  10. Persona p2 = new Persona("mikym", "Marisaldi", "Michele", "Bologna", "prova1",date,33333);
  11.  
  12. try {
  13. Class.forName("com.mysql.jdbc.Driver");
  14. Dao d = new Dao(cf.getConnection());
  15. //d.getAllCognomi();
  16. //d.getAllNomi();
  17. //d.getAllUsername();
  18. //d.getAllId();
  19. //d.insertPersona(p2);
  20.  
  21. for(int i = 0; i <910000; i++) {
  22. d.riempiTabella();
  23. }
  24.  
  25.  
  26. } catch (Exception e) {
  27. e.printStackTrace();
  28. }
  29. finally {
  30. cf.close();
  31. }
  32. }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement