oracle Array filled with null data in java

前端 未结 3 1558
轻奢々
轻奢々 2021-02-10 16:10

When I try to throw an Array of strings to oracle stored procedure as:

String arrStr[] ={\"val1\",\"val2\",\"val3\"};
ArrayDescriptor descriptor = ArrayDescripto         


        
相关标签:
3条回答
  • 2021-02-10 16:59

    Probably your STR_ARRAY is defined in this way:

    create or replace type STR_ARRAY is table of VARCHAR2(20);

    As Tomas said the problem is encoding. My solution - use NVARCHAR2 instead.

    create or replace type STR_ARRAY is table of NVARCHAR2(20);

    0 讨论(0)
  • 2021-02-10 17:02

    In my case (see my comment above), it was caused by encoding problem, however - without any exception or debug information. Including orai18n.jar to the project libraries solved this... it is really sad, there is no exception or something that would indicate how to solve the problem

    0 讨论(0)
  • 2021-02-10 17:09

    After hours I have founded the cause, the real problem is the NLS_CHARACTERSET of your database work with a encoding that is not supported by your client, to jdbc support others NLS_LANG is necessary add orai18n.jar in classpath. See your database settings with this sql:

    SELECT * FROM NLS_DATABASE_PARAMETERS

    0 讨论(0)
提交回复
热议问题