Forum Stats

  • 3,751,469 Users
  • 2,250,366 Discussions
  • 7,867,434 Comments

Discussions

Oracle 19c jdbc driver doesn't support schema names bigger than 30 bytes

According to Oracle's 19c documentation:

The schema name can be 128 bytes, the table name can be 128 bytes, and the column name can be 128 bytes.

However, I'm facing this issue whenever I try to use a schema name bigger than 30 bytes:

Caused by: java.sql.SQLException: Invalid argument(s) in call
at oracle.jdbc.driver.PhysicalConnection.setSchema(PhysicalConnection.java:9462)
at com.zaxxer.hikari.pool.ProxyConnection.setSchema(ProxyConnection.java:460)
at com.zaxxer.hikari.pool.HikariProxyConnection.setSchema(HikariProxyConnection.java)

The driver used is:

        <dependency>
            <groupId>com.oracle.database.jdbc</groupId>
            <artifactId>ojdbc8</artifactId>
            <version>19.7.0.0</version>
        </dependency>

It looks like the driver is not supporting longer object names introduced as per 12c version, any clues if this is somehow configurable? Could it also perhaps be some AWS RDS specific issue?

On SQL Developer using same jdbc url:

SELECT name, value FROM v$parameter WHERE name = 'compatible';

NAME       | VALUE
-------------------
compatible | 19.0.0

ALTER SESSION SET CURRENT_SCHEMA = VERY_VERY_VERY_LONG_SCHEMA_NAME;

Session altered.

Answers

  • Solomon Yakobson
    Solomon Yakobson Member Posts: 18,670 Black Diamond

    As a sanity check - does CLASSPATH point to right jar (I don't have 19C to test, so I'll use 12.2):

    I:\SQL>rem wrong jar
    I:\SQL>set CLASSPATH=C:\app\sy47755\product\11.2.0\dbhome_2\jdbc\lib\ojdbc5.jar;i:\sql
    
    I:\SQL>java DBconnectUsingService user0123456789012345678901234567890123456789/[email protected]:1525/pdb1sol122 test
    Exception in thread "main" java.sql.SQLException: ORA-01017: invalid username/password; logon denied
    
    
            at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
            at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:389)
            at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:382)
            at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:675)
            at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:448)
            at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:513)
            at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227)
            at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:383)
            at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:776)
            at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:432)
            at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
            at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254)
            at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
            at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at DBconnectUsingService.main(DBconnectUsingService.java:16)
    Caused by: java.sql.SQLException: ORA-01017: invalid username/password; logon denied
    
    
            at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
            at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:389)
            at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:382)
            at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:444)
            at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:513)
            at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227)
            at oracle.jdbc.driver.T4CTTIoauthenticate.doOSESSKEY(T4CTTIoauthenticate.java:407)
            at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:416)
            ... 7 more
    
    
    I:\SQL>rem right jar
    I:\SQL>set CLASSPATH=C:\app\oracle_home_user\product\12.2.0\dbhome_1\jdbc\lib\ojdbc8.jar;i:\sql
    
    I:\SQL>java DBconnectUsingService user0123456789012345678901234567890123456789/[email protected]:1525/pdb1sol122 test
    Success.
    test
    test
    
    I:\SQL>
    


  • User_K11SU
    User_K11SU Member Posts: 4 Green Ribbon

    @Solomon Yakobson I don't have any problems connecting to the database, the issue is when trying to change the schema (calling the method setSchema on the driver) using a name bigger than 30 chars.

  • Solomon Yakobson
    Solomon Yakobson Member Posts: 18,670 Black Diamond

    Try connecting as that greater than 30 character chema directly to rule out wrong jar.

    SY.

  • User_K11SU
    User_K11SU Member Posts: 4 Green Ribbon

    Yes, connecting to the schema directly works fine, to change the schema after being connected is the issue.