Topic: 一个数据库输出问题?

  Print this page

1.一个数据库输出问题? Copy to clipboard
Posted by: wwjxxy
Posted on: 2004-09-08 00:48

调用数据库后,用out.println()输出中文时!
它显示???
这是为什么?

2.Re:一个数据库输出问题? [Re: wwjxxy] Copy to clipboard
Posted by: eric_dasini
Posted on: 2004-09-08 11:21

jsp输出中文时,会出现乱码问题!如果你用的时Tomcat,需要把默认的字符集改成iso-8859-1

3.Re:一个数据库输出问题? [Re: wwjxxy] Copy to clipboard
Posted by: ggjj_zhzz
Posted on: 2004-09-08 14:09

String str = resultSet.getString("aaa");
str = new String(str.getBytes("iso-8859-1"));

4.Re:一个数据库输出问题? [Re: wwjxxy] Copy to clipboard
Posted by: lnsylt
Posted on: 2004-09-10 11:53

需要字符转换:
out.println(new String(rs.getString("UserName").getBytes("iso-8859-1"),"GBK"));


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923