Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

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

User_K11SUJun 23 2021

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.

Comments

94799
The collection is declared in the OWA package header in the SYS schema.
CREATE OR REPLACE PACKAGE owa
IS

(...)

   TYPE vc_arr IS TABLE OF VARCHAR2 (32000)
      INDEX BY BINARY_INTEGER;
      
(...)
      
END;
/
Population of collections is relatively straightforward but it does vary by type (nested table / varray / index-by). Suggest a read of:

http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28843/tdddg_procedures.htm#TDDDG49000
652458
Thanks but that doesn't really tell me what type of array I should be looking at. I don't intend to populate the arrays from table values but from fixed values and session data.
94799
Hint...
TYPE vc_arr IS TABLE OF VARCHAR2 (32000)
     *INDEX BY BINARY_INTEGER*;
Edited by: padders on Nov 10, 2008 7:22 AM
Satyaki_De
Hint...
TYPE vc_arr IS TABLE OF VARCHAR2 (32000)
*INDEX BY BINARY_INTEGER*;
Why BINARY_INTEGER ?

Why Not PLS_INTEGER?

Regards.

Satyaki De.
94799
Don't have a go at me, I didn't write the OWA package ;-)

Prior to associative arrays you had to use BINARY_INTEGER anyway, although I recall that Steven Feuerstein telling me that it internally used PLS_INTEGER anyway.
Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
With the Partitioning option
JServer Release 8.1.7.4.0 - Production

SQL> DECLARE
  2     TYPE type_name IS TABLE OF NUMBER
  3         INDEX BY PLS_INTEGER;
  4  BEGIN
  5     NULL;
  6  END;
  7  /
   TYPE type_name IS TABLE OF NUMBER
                     *
ERROR at line 2:
ORA-06550: line 2, column 22:
PLS-00315: PL/SQL TABLE declarations must currently use binary_integer indexes
ORA-06550: line 2, column 4:
PL/SQL: Item ignored

SQL>
652458
Well I've worked out a way for the apex compiler not to complain any more so we'll see if the data actually gets passed as it should with the following code:
declare
name_array owa.vc_arr;
value_array owa.vc_arr;

begin

name_array(1) := ('AuthenticationProtocol');
name_array(2) := ('CardBrand');

value_array(1) := ('0');
value_array(2) := ('visa');

xml_api.postData(name_array, value_array);
end;
It's a bit clumsy but at least it seems to work for now
William Robertson
name_array(1) := ('AuthenticationProtocol');
You don't need brackets to assign individual values to variables, it's just
var := value;
1 - 7

Post Details

Added on Jun 23 2021
5 comments
1,531 views