读书人

java.sql.SQLException: Illegal mix

发布时间: 2014-01-26 14:40:20 作者: rapoo

java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) an
d (gb2312_chinese_ci,COERCIBLE) for operation '='
tomcat的字符集设置为:gb2312,现在数据库已经建好,如何改表的字符集?
或那位有更好的解决方法!

------解决方法--------------------------------------------------------
String name;
if(name!=null) name=new String(name.getBytes("ISO8859_1"),"GBK");

        

读书人网 >Java Exception

热点推荐