This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Support localization in CLOB filed in DB through java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Support localization in CLOB filed in DB through java" Watch "Support localization in CLOB filed in DB through java" New topic
Author

Support localization in CLOB filed in DB through java

shardul chand
Greenhorn

Joined: Jun 23, 2010
Posts: 3
I am facing problems with setting Latin-1 Supplement characters and Double byte characters in CLOB field in DB through Java code.

The part of the code I am using to set data in the DB with encoding is:



Here the callablestatement executes the following:
begin update test_clob tc set tc.id = " + "empty_clob() where tc.key1 = 1 returning tc.id into ? ; end;

Later the callablestatement and the placeholder position is passed to the upper method and they update the DB.


Code for retrieving the value :





Here the select statement is fired and the returned CLOB filed is passed to the above function and it returns a String.

This is not working when I am writing "ä" into the CLOB filed with encoding "Cp1252".

Another problem is that the data in the CLOB is an xml and the name of the node are in English and the value of the node is to be localized (<AltText>Test ä</AltText> or <AltText>せんせい</AltText>).

Please can anyone help me with why this is not working or if there is any other way to do it.

Thanks.


Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

shardul,

Welcome to JavaRanch.
Please take some time learn how to properly format your code.

OCUP UML fundamental and ITIL foundation
youtube channel
shardul chand
Greenhorn

Joined: Jun 23, 2010
Posts: 3
Thanks for the link Jan.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Support localization in CLOB filed in DB through java
 
Similar Threads
Single and Double byte Unicode character in DB through Java if DB has NLS_CHARACTERSET=WE8ISO8859P1
Support localization in CLOB file in DB through Java
Blob Clob
why won't clob open
Weblogic temporary clob not getting written to or not reflecting text written to it.