Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. final static String DB_PASSWORD = "<my password>"; // Can also be recup'ed from environment
  2. final static String DB_USER ="<my user>"; // can also be recup'ed from env
  3.  
  4. String DB_URL = System.getenv("url");
  5. if (DB_URL == null ) {
  6. System.out.println("Environment variables url must be set");
  7. System.exit(1);
  8. }
  9. Properties info = new Properties();
  10. info.put(OracleConnection.CONNECTION_PROPERTY_USER_NAME, DB_USER);
  11. info.put(OracleConnection.CONNECTION_PROPERTY_PASSWORD, DB_PASSWORD);
  12.  
  13. OracleDataSource ods = new OracleDataSource();
  14. ods.setURL(DB_URL);
  15. ods.setConnectionProperties(info);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement