aspose file tools*
The moose likes JDBC and the fly likes junk values written into a file when column values taken from the database table.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "junk values written into a file when column values taken from the database table.." Watch "junk values written into a file when column values taken from the database table.." New topic
Author

junk values written into a file when column values taken from the database table..

dbk kumar
Greenhorn

Joined: Feb 01, 2010
Posts: 14
hi,
I have this code (which takes the column values from database table and writes into a file) which runs perfectly alright when run alone.But when I put this inside my big code which does some loads of database interactions and transfer through client and server this just fills in some garbage values(like series of rectangles) into my file....
But the code inside this big project code is the same..But why is this weird result??
Can anyone please tell me what precautions should I take in order to make this fit into my big code which also implements multi threading to cater to many clients...
Thank you in advance...
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


some garbage values(like series of rectangles) into my file....


Sounds like you have a character encoding issue. How is the data encoded in the database? What encoding do you use when you write to the file?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
dbk kumar
Greenhorn

Joined: Feb 01, 2010
Posts: 14


This is the code which runs perfectly alright when run alone...But when put inside my project code junk values get written into the file...
the data type stored in database which retreives the values are of varchar and interger type.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

OK so all you do is take data out the database (the data will be stored using whatever character encoding you've configued Oracle to use) and write it out using the default character encoding. Oracle (by default) is not configured to store Unicode, so my guess is you have characters in the database that are not supported by the default encoding.

dbk kumar
Greenhorn

Joined: Feb 01, 2010
Posts: 14
how to find character encoding used by my database and how to convert it to default character encoding?
thank you..
 
wood burning stoves
 
subject: junk values written into a file when column values taken from the database table..