• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic