Advertisement
Guest User

Untitled

a guest
Mar 9th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. public static void initFXDB(){
  2. //
  3. // FXB DB Connection
  4. //
  5. if(cpdsORACLE == null){
  6. Properties p = new Properties(System.getProperties());
  7. p.put("com.mchange.v2.log.MLog", "com.mchange.v2.log.FallbackMLog");
  8. p.put("com.mchange.v2.log.FallbackMLog.DEFAULT_CUTOFF_LEVEL", "OFF"); // or any other
  9. System.setProperties(p);
  10.  
  11. cpdsORACLE = new ComboPooledDataSource();
  12. cpdsORACLE.setMaxPoolSize(maxPoolSizeFXBANK);
  13. cpdsORACLE.setCheckoutTimeout(checkoutTimeout);
  14. cpdsORACLE.setMaxIdleTime(maxIdleTime);
  15. cpdsORACLE.setUnreturnedConnectionTimeout(unreturnedConnectionTimeout);
  16. cpdsORACLE.setDebugUnreturnedConnectionStackTraces(debugUnreturnedConnectionStackTraces);
  17. try { cpdsORACLE.setDriverClass("oracle.jdbc.OracleDriver"); } catch (PropertyVetoException e) { e.printStackTrace(); }
  18.  
  19. String host = WTFProperties.fxbank_db.getProperty("fxbank.ora.host."+WTFProperties.dynamic.getProperty("server"));
  20. String port = WTFProperties.fxbank_db.getProperty("fxbank.ora.port");
  21. String ssid = WTFProperties.fxbank_db.getProperty("fxbank.ora.ssid."+WTFProperties.dynamic.getProperty("server"));
  22. String user = WTFProperties.fxbank_db.getProperty("fxbank.ora.username");
  23. String pass = WTFProperties.fxbank_db.getProperty("fxbank.ora.password");
  24. String connect_url = "jdbc:oracle:thin:@"+host+":"+port+":"+ssid;
  25.  
  26. cpdsORACLE.setJdbcUrl(connect_url);
  27. cpdsORACLE.setUser(user);
  28. cpdsORACLE.setPassword(pass);
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement