ms sql 2000的驱动支持gb2312编码,但连ms sqlserver 7.0好象不行
解决方案 »
- hibernate批量更新的问题,根据复选框选中要更新的行
- 麻烦有点空的大哥们忙一下忙,小弟谢谢了,小弟弄得快疯了
- checkbox去掉勾选提交无效问题
- 请问win2000中有个服务server起不来,倒至不能共享文件,不能共享打印机,这能是什么原因呢?要如何解决呀?必解贴,急呀,谢了
- 如何防止用户不停刷新jsp页面
- 一个简单的问题
- 如何用java技术,访问客户端文件系统,在客户压缩后,把压缩文件上传到服务器上?
- 想做象这样的一个效果!!!大侠帮看看!!
- 什么错误
- 为什么在Unix服务器下的servlet配置不起作用呢?求神回复!
- 大家帮下忙好吗?学校教务系统建模
- 出现这个错误是什么原因?(在线等)
public String getStr(String str)
{
try
{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("ISO8859-1");
String temp=new String(temp_t);
return temp;
}
catch(Exception e)
{
e.printStackTrace();
}
return "null";
}
%>
<%!//处理中文问题的自定义函数
public String getStr2(String str)
{
try
{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("GBK");
String temp=new String(temp_t,"ISO8859_1");
return temp;
}
catch(Exception e)
{
e.printStackTrace();
}
return "null";
}
%>
这是别人写的函数,试试吧.
public String getStr(String str)
{
try
{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("ISO8859-1");
String temp=new String(temp_t);
return temp;
}
catch(Exception e)
{
e.printStackTrace();
}
return "null";
}
%>
<%!//处理中文问题的自定义函数
public String getStr2(String str)
{
try
{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("GBK");
String temp=new String(temp_t,"ISO8859_1");
return temp;
}
catch(Exception e)
{
e.printStackTrace();
}
return "null";
}
%>
这是别人写的函数,试试吧.
而从数据库中读出数据时不应该调用该函数
而是在jsp叶面中引入中文的字符集。