Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. public void connectToDatabaseAsClient() {
  2. try {
  3. String dbURL = "jdbc:mysql://localhost/cinematograf";
  4. Properties properties = new Properties();
  5. properties.setProperty("user", "client");
  6. properties.setProperty("password", "");
  7. properties.setProperty("useSSL", "false");
  8. properties.setProperty("noAccessToProcedureBodies","true");
  9.  
  10.  
  11.  
  12. connection = DriverManager.getConnection(dbURL,properties);
  13. }
  14. catch (Exception exception) {
  15. JOptionPane.showMessageDialog(null, "Establising database connection failed", "Error", JOptionPane.ERROR_MESSAGE);
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement