Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 328
JavaOracle Avatar asked Oct 12 '25 08:10

JavaOracle


1 Answers

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.

like image 62
Mark Rotteveel Avatar answered Oct 15 '25 08:10

Mark Rotteveel