Advertisement
Guest User

Untitled

a guest
Aug 18th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. try {
  2. DriverManager.registerDriver((Driver) Class.forName("org.postgresql.Driver").newInstance());
  3. StringBuilder url = new StringBuilder();
  4. url.
  5. append("jdbc:postgresql:").
  6. append("table");
  7. Connection connection = DriverManager.getConnection(url.toString(), "postgres", "asdasdasd12");
  8. return connection;
  9. } catch (SQLException | InstantiationException | IllegalAccessException | ClassNotFoundException e) {
  10. e.printStackTrace();
  11. }
  12.  
  13. group 'ua.kiev.makson'
  14. version '1.0-SNAPSHOT'
  15.  
  16. apply plugin: 'java'
  17.  
  18. sourceCompatibility = 1.8
  19.  
  20. repositories {
  21. mavenCentral()
  22. }
  23.  
  24. dependencies {
  25. compile 'log4j:log4j:1.2.17'
  26. compile 'org.slf4j:slf4j-api:1.7.5'
  27. compile 'org.slf4j:slf4j-log4j12:1.7.5'
  28.  
  29. compile 'postgresql:postgresql:9.1-901-1.jdbc4'
  30. compile group: 'junit', name: 'junit', version: '4.4'
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement