Forum Discussion

RajuK's avatar
RajuK
New Contributor
4 years ago

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

  • richie's avatar
    richie
    Community Hero

    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

     

  • RajuK's avatar
    RajuK
    New Contributor

    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's avatar
      richie
      Community Hero
      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
      • RajuK's avatar
        RajuK
        New Contributor

        Yes,

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