我的目的是向数据库中插入中文。
我在一jsp页面,如下
<body><%
String filterwords="哈哈"; String addSql="insert into tb_srv_filterTag values('"+filterwords+"')"; try{
conn.executeUpdate(addSql);
}catch(Exception e){
out.println(e.getMessage());
}response.sendRedirect("filterList.jsp");%></body>
为什么这样不行呢
但把这条sql语句直接在控制台执行却可以,请高人指点。
我在一jsp页面,如下
<body><%
String filterwords="哈哈"; String addSql="insert into tb_srv_filterTag values('"+filterwords+"')"; try{
conn.executeUpdate(addSql);
}catch(Exception e){
out.println(e.getMessage());
}response.sendRedirect("filterList.jsp");%></body>
为什么这样不行呢
但把这条sql语句直接在控制台执行却可以,请高人指点。
insert into tb_srv_filterTag (字段名) values('"+filterwords+"')"
但把这条sql语句直接在控制台执行却可以,请高人指点。
什么控制台可以?
String s=str;
byte b=new byte[];
b=s.getBytes("ISO-8859-1");
s=new String(b)
return s;
}
%>