最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
数据库乱码解决方案
时间:2022-07-02 18:14:54 编辑:袖梨 来源:一聚教程网
你插入数据的时候,用
/**
* 转变字符串的乱码函数
* @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没问题。
/**
* 转变字符串的乱码函数
* @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没问题。
相关文章
- 星际战甲自爆怪怎么打 05-01
- 梦幻西游修业点怎么交易 05-01
- 放置江湖经验怎么刷 05-01
- 光遇如何找到改变体型的药水 05-01
- 攻城掠地宝物属性怎么获得 05-01
- 崩坏星穹铁道折冲妙算唱片在哪折冲妙算唱片位置指引 05-01