cancel
Showing results for 
Search instead for 
Did you mean: 

Anyone having luck with using JDBC driver and connect to TCPS/SSL on Oracle

RajuK
New Contributor

Anyone having luck with using JDBC driver and connect to TCPS/SSL on Oracle

I am able to connect when using TCP port , but having issues connecting to TCPS port.

I have copied valid cacerts file to Java location. It fails with below expection:

 

SQLRecoverableException: IO Error: Got minus one from a read call

7 REPLIES 7
richie
Community Hero

Re: Anyone having luck with using JDBC driver and connect to TCPS/SSL on Oracle

Hey @RajuK 

 

I can't help per se, cos I haven't setup an Oracle connection using a cacerts file before, but I'd double check everything as follows:

 

confirm what version of Oracle RDBMS youre connecting to

download the relevant jdbc driver .jar file relative to the version of Oracle youre connecting to

download the relevant jdk (rather than jre) to support the jdbc connection .jar

read the following link  to determine the correct approach (relative to the oracle version, java version, SSL vs TLS type) and go from there (e.g. oracle wallet?, JKS?, TLSv1.2?) 

download the relevant additional .jars needed to connect using SSL

make sure you're copying the .jar files to the correct directory

identify whether youre connecting to SID or Service Name as this alters the jdbc connection string

confirm the jdbc connection string parameters are correct - depending on the attributes of the remote db you're connecting to alters the parameters required in the connection string (so you might have to alter the default oracle connection string defined in ReadyAPI!s JDBC settings (in the Preferences). 

 

this link might help also

 

I've had issues trying to connect to remote database before with ReadyAPI!, so to strip out the additional complication of setting up a connection in ReadyAPI! I try setting up a connection in a DB interrogation tool like DBVisualiser or TOAD or whatever.  If the connection settings are correct and work in DBVisualiser I then just copy the same details across in ReadyAPI! as these will work.

 

That's all I got I'm afraid - hope this helps!

 

ta,

 

rich

 

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
RajuK
New Contributor

Re: Anyone having luck with using JDBC driver and connect to TCPS/SSL on Oracle

Thanks Richie.

 

Actually I found a work around. 

 

We could use the below format for JDBC url to connect to Oracle DB on TCPS and use generated Java cacerts.

JDBCURL:

USER/PASS_VALUE@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCPS)(HOST=hostname)(PORT=2484))(CONNECT_DATA=(SERVICE_NAME=servicename)))

 

ReadyApi did not provide a way to configure JDBC url with this format. So I have updated the project.xml file to reflect the above format and it works now.

 

richie
Community Hero

Re: Anyone having luck with using JDBC driver and connect to TCPS/SSL on Oracle

Hey @RajuK,

Great that you sorted it!

Just to be clear, ReadyAPI! does support what you need. That string youve included below that starts JDBCURL is actually the string that gets added to your tnsnames.ora file when the db is created.

You just needed to edit and update the default oracle JDBC connection string (within the ReadyAPI! JDBC Preferences) to add in the required parameters defined within that tnsnames value youve included below.

Nice one,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
RajuK
New Contributor

Re: Anyone having luck with using JDBC driver and connect to TCPS/SSL on Oracle

Yes,

Except I could not do "edit within the ReadyAPI! JDBC Preferences", hence I updated the xml file using xml editor.

richie
Community Hero

Re: Anyone having luck with using JDBC driver and connect to TCPS/SSL on Oracle

@RajuK,

Really? That's weird...always been able to edit them before, otherwise you wouldnt be able to add in any further db connections that arent included within the default listing.

What version of ReadyAPI! are you running?

Could you provide a screenshot of the jdbc preferences after attempting to select a row in the form window? Might be able to work out whats wrong, cos you should definitely be able to edit those settings!

Ta

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
RajuK
New Contributor

Re: Anyone having luck with using JDBC driver and connect to TCPS/SSL on Oracle

 

SmartBear provided a solution which I am going to try.

And like you said there is a way to update the JDBC .

I am going to try today. Thanks.

 

Solution from Smart Bear:

-Doracle.net.tns_admin={file location} in the {ReadyAPI install}\bin\ReadyAPI.vmoptions

 

After this, you can add a new connection string template or modify an existing one in Preferences > JDBC Drivers:
jdbc:oracle:thin:<USER>/<PASSWORD>@<TNSName>

In this case, you will need to use the manual JDBC Request test step configuration. Choose None for the Connection and click Configure. Fill in your credentials in the Database configuration dialog and specify the TNSName in the Connection string field. 

sonya_m
Community Manager

Re: Anyone having luck with using JDBC driver and connect to TCPS/SSL on Oracle

Thank you for sharing this! Was this a success?


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors