Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.oracle -> Char array not long enough: javaCharsToUtf8Bytes

Char array not long enough: javaCharsToUtf8Bytes

From: Blue Jean <bill_hen_at_hotmail.com>
Date: 2 Mar 2004 14:46:01 -0800
Message-ID: <4e9b1930.0403021446.7c6b2d71@posting.google.com>


Hi,

I have a column of datatype LONG and
using the following jdbc code to insert the data:

    PreparedStatement ps = con.prepareStatement(command);     byte[] in = str.getBytes();
    ps.setAsciiStream(1, new ByteArrayInputStream(in), in.length);     ps.executeUpdate();

It happens that, for str of ISO characters, it can be larger than 4000 bytes, or much larger, However, for some non-ISO characters,
around 4000 (not exact), it always gives me the following error:

java.sql.SQLException: Io exception: Char array not long enough: javaCharsToUtf8Bytes

This happens to Oracle 8.17 with driver classes12.zip and Oracle 9i with the ojdbc14.jar.

Anyone has similar experience, is there a solution? Thanks. Received on Tue Mar 02 2004 - 16:46:01 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US