SHARE
TWEET

Untitled

a guest Dec 29th, 2016 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.sql.DriverManager;
  2. import java.sql.Connection;
  3. import java.sql.SQLException;
  4.  
  5. public class JDBC {
  6.     final private String UN = "gvaldez";
  7.     final private String PW = "123456";
  8.  
  9.     final private String PG_DRIVER = "jdbc:postgresql://localhost:5432/sample_db";
  10.     final private String MY_DRIVER = "jdbc:mysql://localhost:3306/sample_db;";
  11.  
  12.     public Connection getPgConnection() throws SQLException {
  13.         return DriverManager.getConnection(PG_DRIVER, UN, PW);
  14.     }
  15.  
  16.     public Connection getMyConnection() throws SQLException {
  17.         return DriverManager.getConnection(PG_DRIVER, UN, PW);
  18.     }
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top