Skip to Main Content

Database Software

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!

Exchanging Java Strings with VARRAY column

436767Jul 1 2005 — edited Jul 1 2005
Hello,
I posted this problem already in the SQLJ/JDBC forum (see 313924

I have the following situation:
Oracle Database 9i, Release 9.2.0.1.0 on Windows 2000 Server SP4, the character set is WE8MSWIN1252. I'm developing a Java client on Windows XP Professional SP2. I'm using the Oracle JDBC driver 9.2.0.5.0 and included nls_charset12.jar.

I created a column with a string array datatype defined like this:
CREATE TYPE "HYPOLINE"."TESTARRAY" AS VARRAY (3) OF VARCHAR2(2)

When I tried to update this column with a standard Java String i got the error message "Non supported character set: oracle-character-set-178". I got a hint that I should use the oracle JDBC class oracle.sql.CHAR instead of String. When I initialize this string with the characterset WE8ISO8859P1 or ASCII_CHARSET I'm able to update the database column. However when I select this database column and get the string array from the result set I get only question marks ("?") in the strings.

I don't have problems to exchange standard java strings with VARCHAR2 or CHAR colums! I don't understand what makes the difference between a VARCHAR2 type as part of a VARRAY and a simple VARCHAR2 column. However the conversion rule seems to be different?

I wonder if it would be helpful to convert the character set of the database to a unicode character set. Unfortunately I cannnot define a VARRAY with a NCHAR or NVARCHAR2 type so that I could test of ot would work with unicode fields?

Thanks for answers Thomas
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 29 2005
Added on Jul 1 2005
2 comments
1,221 views