Guest User

Untitled

a guest
Nov 16th, 2017
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. <bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"
  2. id="dataSource">
  3. <property name="driverClassName" value="${database.driverClassName}" />
  4. <property name="url" value="${database.url}" />
  5. <property name="username" value="${database.username}" />
  6. <property name="password" value="${database.password}" />
  7. </bean>
  8.  
  9. System.setProperty("oracle.net.tns_admin", "path/to/your/tnsnames");
  10.  
  11. OracleDataSource ds = new OracleDataSource();
  12.  
  13. Properties props = new Properties();
  14. props.put("oracle.net.wallet_location", "(source=(method=file)(method_data=(directory=path/to/your/wallet)))");
  15.  
  16. /*
  17. Use the following only if you have a proxy user database account instead of a normal DB account
  18. A test user's username could go here though
  19. */
  20. props.put(OracleConnection.CONNECTION_PROPERTY_PROXY_CLIENT_NAME, "proxy-user-name");
  21.  
  22. ds.setConnectionProperties( props );
  23. ds.setURL("jdbc:oracle:thin:/@dbAlias"); //dbAlias should match what's in your tnsnames
  24.  
  25. return ds;
  26.  
  27. security.provider.11=oracle.security.pki.OraclePKIProvider
Add Comment
Please, Sign In to add comment