Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
dbk kumar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?
 
dbk kumar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to find character encoding used by my database and how to convert it to default character encoding?
thank you..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic