Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Does mysql3.2x.xx support Chinese?

 
Sam Wang
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[code]
...
Class.forName("org.gjt.mm.mysql.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/test");
String sql = "INSERT INTO Item(id,name) VALUES (?,?)";
PreparedStatement ps = conn.prepareStatement(sql);
ps.setInt(1,item.id);
ps.setString(2,new String(item.name.getBytes("ISO-8859-1"),"GBK"));
ps.executeUpdate();
...
name field include "???"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic