JavaOracle
JavaOracle

Reputation: 41

JDBC Connection to Oracle database using TLS Certificate

I am trying to write a connection class in Java to connect to an Oracle database using the JDBC driver, but I want to secure the parameters like jdbcurl/username/password which is used to connect to the Oracle database.

I have to use TLS certificate concept to connect to the Oracle database in Java. I tried looking for a working example but couldn't find one.

Can anyone give me an idea how to implement that. I have to add connection pooling concept also to it.

Upvotes: 4

Views: 10911

Answers (1)

Mark Rotteveel
Mark Rotteveel

Reputation: 109000

Refer to the whitepaper linked below for details.

the JDBC URL must use the tcps protocol in order to activate SSL in the JDBC Thin driver.

For example the following URL activates SSL:

jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=servername
     )(PORT=2484))(CONNECT_DATA=(SERVICE_NAME=servicename))) 

This answer assumes that you have already configured TLS correctly on the oracle server. If not, refer to the SSL With Oracle JDBC Thin Driver whitepaper.

This whitepaper also includes more advanced options like authentication, selection of cipher, etc.

Upvotes: 7

Related Questions