Can't use InitializationString with oracle jdb driver

Issue #109 resolved
Former user created an issue

In

confluence/database/src/main/java/com/keysight/database/helpers/DatabaseQueryHelper.java

It seems to me you're not building the correct URL for the oracle driver when a Connection String Suffix value is used. In fact, everytime I try do add a value to that field in the connection profile configuration, I end up with the error

Error creating connection: java.sql.SQLException: Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

or

Error creating connection: java.sql.SQLRecoverableException: IO Error: NL Exception was generated TNS-04605: Invalid syntax error: Unexpected char or LITERAL "(" before or at ( alter session set current_schema =

Depending on wetter I use or not "(" in the string value, .e.g:

InitializationString=(alter session set NLS_SORT=french)

Comments (6)

  1. GOIS Luis (EXT)

    I can’t find the use of “?” in a JDBC connection string for the Oracle driver. Could this be the reason?

    if (!StringUtils.isEmpty(profile.getConnectionStringSuffix())) {
                if (profile.getDatabaseType().matches("Microsoft SQL Server")) {
                    connectionString += ";" + profile.getConnectionStringSuffix();
                } else if (profile.getDatabaseType().matches("jTDS SQL Server")) {
                    connectionString += ";" + profile.getConnectionStringSuffix();
                } else {
                    connectionString += "?" + profile.getConnectionStringSuffix();
                }
            }
    

  2. Scott Selberg

    it’s possible the connection string is no longer valid. The Oracle database I was connecting to when I wrote this has been converted to postgresql, so I’ll have to see if I can find another oracle database to connect to and try to reproduce the problem.

  3. Scott Selberg

    I’m able to connect with this, “jdbc:oracle:thin:@10.17.23.6:1521/FREE?defaultRowPrefetch=10000”, so I think the syntax is OK.

  4. Log in to comment