• 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

mysql problem with german special characters

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
I wrote a software and it worked quite good, but after I installed it on a new machine with j2se 1.4 I've problems with the german special characters.
this code works good on the old machine (jdk 1.3.1) and prints the wanted characters like �,�,�.
--------------------
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
java.sql.Connection conn;
conn = DriverManager.getConnection("jdbc:mysql://localhost/testdb?user=testuser&password=xxxx");
Statement s = conn.createStatement();
ResultSet r = s.executeQuery("select something from testtb where id='1'");
r.first();
System.out.println( r.getString(1) );
--------------------
but on the new machine (j2se 1.4) I only receive the character ?.
I updated my org.gjt.mm.mysql to the current MySQL Connector/J 3.0.9 and added
conn = DriverManager.getConnection("jdbc:mysql://localhost/testdb?user=testuser&password=xxxx&useUnicode=true&characterEncoding=ISO-8859-1");
but I've got still the same problem.
Thanks in advance
Markus
 
Markus Kramer2
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I noticed that a simple
System.out.println("���");
prints
???
to the console (SuSE Linux 8.0).
is there a way to change the standard charset of java?
 
God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic