db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: Inserting Special Characters in Oracle using TORQUE.
Date Fri, 26 Oct 2007 08:26:55 GMT
There are fixed length character sets (each character uses the same amount
of space, like ISO-8859-1 (1 byte) or unicode(2 bytes)) and variable length
character sets where some characters neen more space than others (e.g.
utf-8 where characters can occupy 1-3 bytes). It seems that java and the db
use different character sets. The database or its driver takes care of the
conversion, which can lead to a longer byte sequence in the db.

The solution would be a) to make the length check in the charset of the db
or b) use the same charset in the db as in the web application.


SheraX <sheraz.jamshed@redmath.com> schrieb am 26.10.2007 08:21:17:

> Hellow everyone,
> I am getting a strange problem. I am developing a webapplication in IBM
> Rational Software Development Platform Version: 6.0.1 Using Torque
> 3.0.2.
> I need to insert special characters like (ABCDEFG1234ÑãäåæçèéêêהЦБЌ) into
> Oracle(10g) Table Column of type VARCHAR2(4000 BYTE).
> The Charset of web application is default IS0-8859. The value is saved in
> database and retrieved and displayed fine. But the problem arises on
> value checks.
> Now the string containing special characters of higher decimal ASCII
> occupy more bytes then lower ASCII value. So the length of the string is
> different then the number of characters input by user.
> Before inserting into database I validate the input value in the form to
> less then 4000 bytes (using myValue.length() ). It indeed shows value
> then 4000 like in one case the length of the string is 3680. But when
> tries to insert the value in database the ORA Exception is encountered
> "org.apache.torque.TorqueException: Data size bigger than max size for
> type: 4245"
> I am not able to understand why string length changes when torque tries
> insert it into the database.
> Awaiting Response
> Regards
> SheraX
> --
> View this message in context: http://www.nabble.com/Inserting-Special-
> Characters-in-Oracle-using-TORQUE.-tf4695403.html#a13421479
> Sent from the Apache DB - Torque Dev mailing list archive at Nabble.com.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
View raw message