%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030" import="java.sql.*"%>
Insert title here
<%
try {
String id=new String(request.getParameter("id").getBytes("ISO-8859-1"),"GB18030");
String Gg_titile=new String(request.getParameter("Gg_titile").getBytes("ISO-8859-1"),"GB18030");
String Gg_neirong=new String(request.getParameter("Gg_neirong").getBytes("ISO-8859-1"),"GB18030");
Connection con=info.getCon();
// 添加信息的SQL语句
String sql = "update gg set Gg_titile='"+Gg_titile +"',Gg_neirong='"+Gg_neirong +"' where id='"+id+"'";
// 获取PreparedStatement
PreparedStatement ps = con.prepareStatement(sql);
// 对SQL语句中的第1个参数赋值
int row = ps.executeUpdate();
if(row > 0){
out.println("");
}
// 关闭PreparedStatement,释放资源
ps.close();
// 关闭Connection,释放资源
con.close();
} catch (Exception e) {
out.print("更新失败!");
e.printStackTrace();
}
%>