Guest User

Untitled

a guest
Apr 9th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/tournament_system?"
  2. + "user=root&password=root");
  3.  
  4. java.sql.PreparedStatement ps = conn
  5. .prepareStatement(" insert into PLAYER (ID, NAME, SURNAME, CLUB, WORLD_RANKING, USER_ID) VALUES(?, ?, ?, ?, ?, ?)");
  6. ps.setInt(1, 100001);
  7. ps.setString(2, "ěščřž");
  8. ps.setString(3, "xxx");
  9. ps.setString(4, null);
  10. ps.setInt(5, 5);
  11. ps.setInt(6, 1);
  12. ps.executeUpdate();
  13.  
  14. INSERT INTO `tournament_system`.`PLAYER` (`ID`, `NAME`, `SURNAME`, `CLUB`, `PLAYER_DISCRIMINATOR`, `WORLD_RANKING`, `USER_ID`) VALUES ('10002', 'ěščřž', 'qqq', NULL, 'qqq', NULL, '1');
  15.  
  16. Server: Localhost via UNIX socket
  17. Server version: 5.5.34-0ubuntu0.12.10.1
  18. Protocol version: 10
  19. User: root@localhost
  20. MySQL charset: UTF-8 Unicode (utf8)
  21.  
  22. Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/tournament_system?"
  23. + "user=root&password=root&characterEncoding=UTF-8");
Add Comment
Please, Sign In to add comment