• 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

Displaying Greek values read from Database

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

I have a problem in dispalying Greek values. I am using SQL Server database. And in one of the tables i am having greek values. In the table i can see the value appearing in greek language, but when i dispaly it on my console i am getting the values as ???.

This is my code, can anybody please tell me what are the changes to be made to this code.


Connection con = null;

try {
Class.forName("net.sourceforge.jtds.jdbc.Driver");
con = DriverManager.getConnection("jdbc:jtds:sqlserver://10.7.100.3:1433/SAP_Data_v39;user=sapdata;password=sapdata;");
Statement s = con.createStatement();
ResultSet rs = s.executeQuery("select * from VIEW_Identifier where id='100005'");
while(rs.next()){
String temp = rs.getString("Field_Value");
System.out.println("The value is :"+temp);
}
}

catch (Exception e) {
System.out.println(e);
}


This is the greek value
1-χλωρο-4-νιτροβενζόλιο
The output i get is
1-???-4-???


Thanks for any help
sridhar.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

What character encoding does the DB use? Is your console capable of displaying Unicode (or even just ASCII above 127) characters? Many consoles can only display ASCII properly.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic