2.x 的配置
;
;jdbc/xxxxxx;
;javax.sql.DataSource;
;Container;
;
;
;
;driver-name;
;com.mysql.jdbc.Driver;
;
;
;url;
;jdbc:mysql://localhost:3306/xxxxxxx;
;
;
;user;
;xxxx;
;
;
;password;
;xxxx;
;
;
;max-connections;
;200;
;
;
;max-idle-time;
;30;
;
;
;useUnicode;
;true;
;
;
;characterEncoding;
;gb18030;
;
;
Resin 3.x 配置
;
;jdbc/picring;
;
;
;
;com.mysql.jdbc.Driver;
;jdbc:mysql://192.168.0.119:3306/xxxxx;
;xxxxxx;
;xxxxx;
;
;useUnicode;
;true;
;
;
;characterEncoding;
;gb18030;
;
;
;
值得注意的是 以上的配置,在 mysql 4.1.x 以及 5.x 版本下, text 字段都会出现乱码,修改 数据库字段编码以及数据库配置文件无效。
解决方法是 new String(resultSet.getBytes("field"), "gb18030");
这个方法也可以用在 mysql 4.0.x 上。
分享到:
2009-08-27 13:41
浏览 975
论坛回复 / 浏览 (0 / 1644)
评论