org.apache.jasper.JasperException: An exception occurred processing JSP page /test_utf8.jsp at line 11
8: String url="jdbc:mysql://localhost/cass";
9: Connection conn=DriverManager.getConnection(url,"root","");
10: Statement stmt = conn.createStatement();
11: stmt.executeQuery("insert into sys_radi values(111, 23, 'abc'");
12: String sqlstr="select * from sys_radi";
13: ResultSet rs= stmt.executeQuery(sqlstr);
14:
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
顺便说下,我的MySQL数据库用utf8编码,JSP网页本身也用UTF8编码存储。insert错误是否与此有关?应该怎么才能顺利插入数据呢?
--转自