By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,501 Members | 1,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,501 IT Pros & Developers. It's quick & easy.

Char array not long enough: javaCharsToUtf8Bytes

P: n/a
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.
Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.