教程集 www.jiaochengji.com
教程集 >  脚本编程  >  java  >  正文 数据库乱码解决方案

数据库乱码解决方案

发布时间:2019-10-09   编辑:jiaochengji.com
教程集为您提供数据库乱码解决方案等资源,欢迎您收藏本站,我们将为您提供最新的数据库乱码解决方案资源
你插入数据的时候,用
/**
* 转变字符串的乱码函数
* @param str
* @return
*/
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){
return "null";
}
}
//向bean里面赋值
public void setAction(String action) {
this.action = getStr(action);
}
public void setAddmanagerid(String addmanagerid) {
this.addmanagerid = getStr(addmanagerid);
}
转换一下,看看可以吗,我的数据库是ORACLE没问题。 

您可能感兴趣的文章:

[关闭]
~ ~