Guest User

Untitled

a guest
Nov 14th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. static void cleanUpPipeline() {
  2. String jdbcUrl = String.format(
  3. "jdbc:postgresql://google/%s?cloudSqlInstance=%s"
  4. + "&socketFactory=com.google.cloud.sql.postgres.SocketFactory",
  5. "xxxxxx",
  6. "xxxxxx");
  7.  
  8. try {
  9. Class.forName("org.postgresql.Driver");
  10. Connection connection = DriverManager.getConnection(jdbcUrl, "xxxxxx", "xxxxxx");
  11. } catch (SQLException | ClassNotFoundException e) {
  12. e.printStackTrace();
  13. }
  14. }
  15.  
  16. <dependency>
  17. <groupId>com.google.cloud.sql</groupId>
  18. <artifactId>postgres-socket-factory</artifactId>
  19. <version>1.0.11</version>
  20. </dependency>
  21.  
  22. <dependency>
  23. <groupId>org.postgresql</groupId>
  24. <artifactId>postgresql</artifactId>
  25. <version>42.2.5</version>
  26. </dependency>
Add Comment
Please, Sign In to add comment