日期:2014-05-17 浏览次数:20715 次
$("#submit_button").click(function(){ $.get("exchange_back.jsp",{title:$("#title").val(), exchange:$("#exchange").val(), period:$("input[type=radio]:checked").val(), description:$("#description").val()},function(responseText){ }); });
Class.forName("com.mysql.jdbc.Driver"); Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/YiShu?user=root&password=sad&Unicode=true&characterEncoding=UTF-8"); String sql = "insert into book values(?,?,?,?,now(),adddate(now(),?),?,?)"; PreparedStatement pstmt = conn.prepareStatement(sql); pstmt.setInt(1,(Integer)session.getAttribute("id")); pstmt.setString(2,(String)session.getAttribute("username")); pstmt.setString(3,request.getParameter("title")); pstmt.setString(4,request.getParameter("exchange")); pstmt.setString(5,new String(request.getParameter("period").getBytes("iso8859-1"),"utf-8")); pstmt.setString(6,new String(request.getParameter("period").getBytes("iso8859-1"),"utf-8")); pstmt.setString(7,request.getParameter("description"));