Charles 'King wrote: Please post the first few lines of the exception from the error log. Which DBMS are you using? State the java object type your storing in your db field. Is it a String, etc...?
Jagdeep Sharma wrote:[ The value of a host variable in the EXECUTE or OPEN statement is too large for its corresponding use.
........
Charles 'King wrote:
Jagdeep Sharma wrote:[ The value of a host variable in the EXECUTE or OPEN statement is too large for its corresponding use.
........
It appears your trying to store bit data into a string object. The string representation of your spade symbol is too large for your DB field data type. One option is to store your data as bytes in your DB, which means you'll have to change the DB data type for that specific field.
Gaurav Sainii wrote:Hi,
As Charles said, please change the data type in your database to bytes and in the provided java code change the following:-
following changes are suggested:-
What's the problem with my code. Why it is throwing exceptions. Can you please explain a little bit.
When i convert datatype to bytes. How would i set its length. I mean let say for varchar(50) what could be equivalent for bytes.
Gaurav Sainii wrote:
What's the problem with my code. Why it is throwing exceptions. Can you please explain a little bit.
This kind of error that you are getting, occurs when you have a char or varchar field in your table in database of a given length,
and user tries to to put a longer string into it.
In particular, when using the UTF-8 Unicode character set, you must keep in mind that not all characters use the same number of bytes and can require up to four bytes per character.
When i convert datatype to bytes. How would i set its length. I mean let say for varchar(50) what could be equivalent for bytes.
I do not have much knowledge over DB/2 database types but possibly you can increase the size of your varchar type. For varchar(50) its equivalent in bytes could be 50x4=200. So you can declare a varchar(200) in this case.
But is there any way to accommodate special character in database without increasing field size. I mean there should be some centralized control to change character encoding in database.
Gaurav Sainii wrote:
But is there any way to accommodate special character in database without increasing field size. I mean there should be some centralized control to change character encoding in database.
Yesthere are ways to set the encoding in Oracle database but for DB/2 you need to google a little bit. Or anyone working on DB/2 could help.
sunglasses are a type of coolness prosthetic. Check out the sunglasses on this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
|