aspose file tools*
The moose likes JDBC and the fly likes Does JDBC Use Certs or CA's ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Does JDBC Use Certs or CA Watch "Does JDBC Use Certs or CA New topic
Author

Does JDBC Use Certs or CA's ?

James Ellis
Ranch Hand

Joined: Oct 14, 2004
Posts: 205
I am coding a java class to connect to a remote database via jdbc. The code is pretty straightforward:







If I change the jdbc URL to a different database, I am able to connect to it and query it. If I try to connect to the real database I am getting the following error:






This is really killing me. Does anyone know how / if / why jdbc uses CA's or certs?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30352
    
150

James Ellis wrote:This is really killing me. Does anyone know how / if / why jdbc uses CA's or certs?

It's a remote database. You don't want just anybody to connect and get all the data. Certs seem like a valid way to protect against someone knowing the password.

I don't know the answer to your actual question. Maybe check with whomever gave you the cert?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
James Ellis
Ranch Hand

Joined: Oct 14, 2004
Posts: 205
Actually nobody gave me a cert...in fact I didn't think that certs were even in the equation in JDBC until I saw that stack trace. All I did was type in a standard jdbc URL for a thin driver (nothing funky in it) and connecting to this one particular DB always gives me this stack trace that includes a message about certificates. That's why I was asking, how/when/why are certificates used in JDBC or is this just stack trace about certs just a red herring?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Its not JDBC that is doing this it is Oracle. Speak to your DBA.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
James Ellis
Ranch Hand

Joined: Oct 14, 2004
Posts: 205
Paul,

Do you have any specific advice I can pass on to the DBA such as "please turn off XYZ service which is preventing remote JDBC connections"? Otherwise, I think the DBA group is going to tell my code is the problem.

Thanks,
Jim
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

Read the documentation for your Oracle JDBC driver - it should tell you how to configure the connection to use a certificate. You will also need to get the key from your DBA.


JBoss In Action
 
Consider Paul's rocket mass heater.
 
subject: Does JDBC Use Certs or CA's ?