<%@ page language="java" contentType="text/html; charset=GB18030" pageEncoding="GB18030" import="java.sql.*"%> Insert title here <% try { String username=encoding.toString(request.getParameter("username")); String yonghu_type=encoding.toString(request.getParameter("yonghu_type")); String zhifu_type=encoding.toString(request.getParameter("zhifu_type")); String jine=encoding.toString(request.getParameter("jine")); String beizhu=encoding.toString(request.getParameter("beizhu")); Connection conn=db.getCon(); // 添加图书信息的SQL语句 String sql = "insert into feiyong(username,yonghu_type,zhifu_type,jine,beizhu,shijian)values(?,?,?,?,?,'"+shijian.showTodayTime()+"')"; // 获取PreparedStatement PreparedStatement ps = conn.prepareStatement(sql); ps.setString(1,encoding.toString(zhifu.getUsername())); ps.setString(2,encoding.toString(zhifu.getYonghu_type())); ps.setString(3,encoding.toString(zhifu.getZhifu_type())); ps.setString(4,encoding.toString(zhifu.getJine())); ps.setString(5,encoding.toString(zhifu.getBeizhu())); int row = ps.executeUpdate(); // 判断是否更新成功 if(row > 0){ out.println(popDialog.messageBox("支付成功!","huiyuan_zhifu.jsp")); } // 关闭PreparedStatement,释放资源 ps.close(); // 关闭Connection,释放资源 conn.close(); } catch (Exception e) { out.print("支付失败!"); e.printStackTrace(); } %>