How to Connect Using JDBC/Thin with SSL From an OC4J Data Source in 10.1.3.x (Doc ID 780034.1)

Last updated on MAY 19, 2017

Applies to:

Oracle Containers for J2EE - Version 10.1.3.0.0 to 10.1.3.4.0 [Release AS10gR3]
JDBC - Version 10.2.0.4 to 11.2.0.4.0 [Release 10.2 to 11.2]
Information in this document applies to any platform.
***Checked for relevance on 21-May-2015***

Goal

This note shows how to implement a JDBC/Thin SSL connection from an OC4J data source as well as automatically handle the security registration in order to allow a JSP to connect via JDBC/Thin with SSL using either a JDBC/Thin 10.2.x  or 11.1.x driver.  This was tested using JDBC/Thin 10.2.0.4 and JDBC/Thin 11.1.0.7 with JDK 1.5 on OC4J version 10.1.3.3

 Before the JSP attempt is made, you will need to ensure that your database is properly configured for SSL and that a standalone JDBC/Thin connection works.

In this case <Note 762286.1> was used for the following standalone test:

test.properties

javax.net.ssl.keyStore=/oracle/product/wallets/dbclient/cwallet.sso
javax.net.ssl.keyStoreType=SSO
javax.net.ssl.trustStore=/oracle/product/wallets/dbclient/cwallet.sso
javax.net.ssl.trustStoreType=SSO
oracle.net.ssl_cipher_suites=SSL_RSA_WITH_3DES_EDE_CBC_SHA

 When run the following output shows it works correctly from a standalone Java program.

$ java -classpath .:./ojdbc5.jar:./oraclepki.jar:./ojpse.jar JDBCSSLTester
test1.properties
Start: Mon Feb 02 09:26:30 EST 2009
Connected as DATABASE USER TEST
Ended: Mon Feb 02 09:26:33 EST 2009

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms