JDBC Connection to Oracle database using TLS Certi

2019-05-14 11:41发布

问题:

I am trying to write a connection class in java to connect to oracle database using jdbc drivers 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 and late i have to add connection pooling concept also to it.

Thanks in advance

回答1:

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.



标签: java oracle jdbc