Advertisement
Guest User

Untitled

a guest
Oct 10th, 2017
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. private static final String DRIVER = "org.postgresql.Driver";
  2. private static final String URL = "jdbc:postgres://nklbcxow:MINHA_SENHA_NO_ELEPHANTSQL@elmer.db.elephantsql.com:5432/nklbcxow";
  3. private static final String USER = "nklbcxow";
  4. private static final String PASS = "MINHA_SENHA_NO_ELEPHANTSQL";
  5.  
  6. public static Connection getConnection() throws SQLException {
  7. try {
  8. Class.forName(DRIVER);
  9.  
  10. return DriverManager.getConnection(URL, USER, PASS);
  11. } catch (ClassNotFoundException ex) {
  12. throw new RuntimeException("Erro na conexão", ex);
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement