Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"
- id="dataSource">
- <property name="driverClassName" value="${database.driverClassName}" />
- <property name="url" value="${database.url}" />
- <property name="username" value="${database.username}" />
- <property name="password" value="${database.password}" />
- </bean>
- System.setProperty("oracle.net.tns_admin", "path/to/your/tnsnames");
- OracleDataSource ds = new OracleDataSource();
- Properties props = new Properties();
- props.put("oracle.net.wallet_location", "(source=(method=file)(method_data=(directory=path/to/your/wallet)))");
- /*
- Use the following only if you have a proxy user database account instead of a normal DB account
- A test user's username could go here though
- */
- props.put(OracleConnection.CONNECTION_PROPERTY_PROXY_CLIENT_NAME, "proxy-user-name");
- ds.setConnectionProperties( props );
- ds.setURL("jdbc:oracle:thin:/@dbAlias"); //dbAlias should match what's in your tnsnames
- return ds;
- security.provider.11=oracle.security.pki.OraclePKIProvider
Add Comment
Please, Sign In to add comment