日期:2014-05-17 浏览次数:20641 次
<%@ page language="java" import="java.util.*,java.sql.*,bbs.*" pageEncoding="GB18030"%> <% request.setCharacterEncoding("UTF-8"); int pid = Integer.parseInt(request.getParameter("pid")); int rootId = Integer.parseInt(request.getParameter("rootId")); String title = request.getParameter("title"); System.out.println(title); String cont = request.getParameter("cont"); System.out.println(cont); Connection conn = DB.getConn(); String sql = "insert into article values(null,?,?,?,?,sysdate,?)"; PreparedStatement pstmt = DB.prepareStmt(conn, sql); pstmt.setInt(1, pid); pstmt.setInt(2, rootId); pstmt.setString(3, title); pstmt.setString(4, cont); pstmt.setInt(5, 0); pstmt.executeUpdate(); DB.close(pstmt); DB.close(conn); %>