stmt.executeUpdate(s);yhxm 插入的是乱码????

linuxguoyy 2002-04-19 03:25:23
String s=new String();
s="update tCJ_YHXX set yhid='"+yhid+"',yhxm='"+yhxm+"' where yhid='"+old_yhid+"'";
Statement stmt=con.createStatement();//java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE,java.sql.ResultSet.CONCUR_READ_ONLY);
out.print(s);
stmt.executeUpdate(s);
}
catch(Exception e){
System.err.println("aq.executeQuery: " + e.getMessage());
}
// response.sendRedirect("local_admin.jsp");
------------------------------------------
out.print(s);==写出是正确的
update tCJ_YHXX set yhid='operator',yhxm='理用户 理用户 ' where yhid='operator'

stmt.executeUpdate(s);yhxm 插入的是乱码????

...全文
124 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
老土豆T 2002-04-19
  • 打赏
  • 举报
回复
public class getStr(String str)
{ String str;
byte[] str1=new String(str.getBytes,"8859_1");
return str1;
}

把含有中文的 用getStr(string) 来插入
可乐加水 2002-04-19
  • 打赏
  • 举报
回复
是你中文的问题!

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧