有人可以告诉我我的错误或编码有什么问题吗?我已经按照 Internet 上的教程进行操作,但 MySQL 进程仍然存在一些错误。
插入数据的JSP代码:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"
import = "fyp1.controller2.Facade, fyp1.app.Local"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%
String loc = request.getParameter("location");
Facade facade = new Facade();
Local lcal = new Local(loc);
int saje = facade.gettest(lcal);
if(saje != 1){
%>
<jsp:forward page="test1.jsp" />
<%}
else{
%>
<jsp:forward page="eror.jsp" />
<%} %>
</body>
</html>
插入数据的代码:
int gettest(Local local) throws SQLException
{
PreparedStatement ps = facade.getConnection().prepareStatement("insert into local(local_id,local_name) values(SEQ.nextval,?)");
ps.setString(1, local.getLocalName());
int status = ps.executeUpdate();
if(status == 1)
facade.getConnection().commit();
else
facade.getConnection().rollback();
return status;
}
获取错误: