code=HTML]<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body>
<jsp:useBean id="dbconn" class="news.conn" scope="session"/>
<%
dbconn.executeUpdate("insert into news(title,content,author,pubdate) values('还有','多大','多大',date()+time())");%>
</body>
</html>[[/code]
插入数据库,结果显示乱码,网上说的不清楚啊,找了半天,不知道怎么回事。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body>
<jsp:useBean id="dbconn" class="news.conn" scope="session"/>
<%
dbconn.executeUpdate("insert into news(title,content,author,pubdate) values('还有','多大','多大',date()+time())");%>
</body>
</html>[[/code]
插入数据库,结果显示乱码,网上说的不清楚啊,找了半天,不知道怎么回事。
解决方案 »
- List items = upload.parseRequest(request),items为空
- struts2中<result name这个name可以自定义吗
- 请大家给我找一些JAVA程序员比C++程序员聪明的一些理由,我要收集
- 有点问题想不明白.大家给点意见吧
- hibernate 关联插入问题
- struts2 /struts.xml文件,result的type设置为"plaintext"时不显示源代码
- 关于tomcat的启动问题
- 怎样实现文件的上传下载
- 【串行化的问题】如何将一个类串行化之后,反串行化的时候用另一个类来强制转化?见内。
- 初学J2EE的问题,看了不要笑,分不够再加
- json-default包下自定义拦截器的问题
- 密码策略问题 - 求个编程思路
data=new String(data.getBytes"ISO8859_1"), "gb2312")
要不简单点这样 你的字段 = new String(keywordst.getBytes("ISO-8859-1"), "GBK");