• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Support localization in CLOB file in DB through Java

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Kindly help me out of this. Thanks in advance.
 
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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>).

What does "not working" mean? Please explain the "another problem".
 
Samir Banerjee
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using the below Java code to set Latin-1 supplement character in the DB (NLS_CHARACTERSET = WE8ISO8859P1) but due to the DB not supporting these characters it is converting it into '?' or inverted '?'.
Is there a way to keep the the DB's NLS_CHARACTERSET as WE8ISO8859P1 and still support various languages (Single or Double Byte Unicode characters)?



Please let me know if there is an solution to this. Thanks in advance.
 
Could you hold this puppy for a sec? I need to adjust this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic