• 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 "???"
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!