• 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

Encoding Conversion using JDBC

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to access data from an Oracle database where the NLS CharacterSet is set as 'AR8MSWIN1256' where the data is in Arabic.
I am trying to access the data from the database using JDBC and displaying it. But instead of showing up the proper Arabic data it displays Junk characters.

Does JDBC provides any support to convert the character-set? How do i resolve this issue?

Thanks.
 
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
Java will not change the encoding. How are you displaying it?
 
M A Mujeeb
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am accessing data using Java connection, quering the database to retrieve the records and displaying them on eclipse editor console.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java works in Unicode and therefore string/character JDBC works with Unicode, however a lot of databases use some specific codepage. I know to my sorrow for example, that you select the codepage when you create a PostgreSQL database, and it's immutable thereafter.

So sometimes you may need a little help in character set translation.

However, Eclipse isn't a word processor, so there are going to be limits on what it will do. You can select a more appropriate code page for a view display - meaning one that maps the characters in question to appropriate display glyphs. But the underlying data will remain the same.
 
M A Mujeeb
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your input Tom. I will probably use xhtml or a jsp as a code base for viewing the data.
 
reply
    Bookmark Topic Watch Topic
  • New Topic