This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes Read Unicode chars and insert into Oracle DB Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Read Unicode chars and insert into Oracle DB" Watch "Read Unicode chars and insert into Oracle DB" New topic
Author

Read Unicode chars and insert into Oracle DB

Mahesh Pinnamaneni
Ranch Hand

Joined: Jul 02, 2004
Posts: 100
Guys,

I am having a file in which some of the text was in Unicode format.
I want to read this file in Java and insert into oracle database.
The following is the code for reading the unicode string from the file.


Java is reading the correct unicode (i can see this while debuggin the code). Is there any way to insert the Unicode chars to DB.

I am viewing the chars in the html page with Encoding set to 'Central European - Windows).

Please help..

Thanks & Regards,
Mahesh P
Yuriy Zilbergleyt
Ranch Hand

Joined: Dec 13, 2004
Posts: 429
Have you tried simply storing the string as VARCHAR2? If that doesn't work, you can always serialize them to BLOB.

Yuriy
Mahesh Pinnamaneni
Ranch Hand

Joined: Jul 02, 2004
Posts: 100
Thanks for ur reply...

The database column used is NVarchar to store Unicode format..

Regards,
Mahesh P
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Originally posted by Mahesh Pinnamaneni:
Thanks for ur reply...

The database column used is NVarchar to store Unicode format..

Regards,
Mahesh P


...unless that database itself is configured to support Unicode, in which case you can store unicode data in chars, varchars, clobs and longs.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Read Unicode chars and insert into Oracle DB
 
Similar Threads
"Exception in thread "main" java.lang.OutOfMemoryError"
reading byte array
How can I get Unicode String of a String?
How do I read and write a binary file?
Reading From a Binary Large Object(BLOB)