Advertisement
Guest User

Untitled

a guest
May 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. paaaaaaa
  2.  
  3. import java.sql.Connection;
  4. import java.sql.DriverManager;
  5. import java.sql.SQLException;
  6. import java.util.Properties;
  7.  
  8. public class DbConnection {
  9.  
  10. private String url;
  11. private Properties properties;
  12.  
  13. public DbConnection() {
  14. this.url = "jdbc:mysql://db4free.net:3306/organizer";
  15. this.properties = new Properties();
  16. this.properties.setProperty("user", "andrew");
  17. this.properties.setProperty("password", "pk_organizer");
  18. this.properties.setProperty("useSSL", "false");
  19. this.properties.setProperty("autoReconnect", "true");
  20. }
  21.  
  22. public Connection getConnection() throws SQLException {
  23. return DriverManager.getConnection(this.url, this.properties);
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement