1 <%@ page language="java" contentType="text/html; charset=UTF-8" 2 pageEncoding="UTF-8"%> 3 <%@ page import="java.io.*,java.util.*,java.sql.*"%> 4 <%@ page import="javax.servlet.http.*,javax.servlet.*" %> 5 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 6 <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> 7 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 8 <html> 9 <head> 10 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 11 <title>Insert title here</title> 12 </head> 13 <body> 14 15 <sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver" 16 url="jdbc:mysql://localhost:3306/toilet?useUnicode=true&characterEncoding=utf-8" 17 user="root" password="123"/> 18 <sql:update dataSource="${snapshot}" var="result"> 19 INSERT INTO usertable (name,man,age,pwd) VALUES ('fdsgdg', '女',213, 'sfdfd'); 20 </sql:update> 21 22 </body> 23 </html>