<%@ page contentType="text/html; charset=gb2312" language="java" %>
<%@ page import="java.sql.*, java.util.*, java.io.*" %>
<%
String driverName="com.mysql.jdbc.Driver";
String userName="root";
String userPasswd="123456";
String dbName="test";
String tableName="t1";
String url="jdbc:mysql://localhost:3306/"+dbName+"?user="+userName+"&password="+userPasswd+"&useUnicode=true&characterEcoding=GB2312";
Class.forName(driverName).newInstance();
Connection conn=DriverManager.getConnection(url);
Statement stmt=conn.createStatement();
String str=request.getParameter("haoma");
String sql="select * from t1 where id="+str;
ResultSet rs=stmt.executeQuery(sql);
%>
姓名:">
性别:">
年龄:">
报错为:
org.apache.jasper.JasperException: An exception occurred processing JSP page /modify.jsp at line 20
17: %>
18:
19:
20: ">
21: ID:">
22: 姓名:">
23: 性别:">