主题:请教 向数据库添加数据时,总说我insert into 语法错误,先谢过各位高手了
<%@page contentType="text/html;charset=gb2312" %>
<html>
<head>
<title>处理上传文件</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<%@ page language="java" import="java.sql.*" %>
<jsp:useBean id="AddBean" scope="page" class="mydb.mydb" />
<%
String number1=request.getParameter("number");
String time1=AddBean.toChinese(request.getParameter("time"));
String name1=AddBean.toChinese(request.getParameter("name"));
String object1=AddBean.toChinese(request.getParameter("object"));
String result1=AddBean.toChinese(request.getParameter("result"));
String sql="insert into upfile (number,time,name,object,result) values
('"+number1+"','"+time1+"','"+name1+"','"+object1+"','"+result1+"')";
AddBean.executeUpdate(sql);
%>
</body>
</html>
//然后 TOMCAT 就说我 insert into 语句的语法错误,我都不知道错在哪里,希望各位高手帮个忙,谢谢了~~~~
<html>
<head>
<title>处理上传文件</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<%@ page language="java" import="java.sql.*" %>
<jsp:useBean id="AddBean" scope="page" class="mydb.mydb" />
<%
String number1=request.getParameter("number");
String time1=AddBean.toChinese(request.getParameter("time"));
String name1=AddBean.toChinese(request.getParameter("name"));
String object1=AddBean.toChinese(request.getParameter("object"));
String result1=AddBean.toChinese(request.getParameter("result"));
String sql="insert into upfile (number,time,name,object,result) values
('"+number1+"','"+time1+"','"+name1+"','"+object1+"','"+result1+"')";
AddBean.executeUpdate(sql);
%>
</body>
</html>
//然后 TOMCAT 就说我 insert into 语句的语法错误,我都不知道错在哪里,希望各位高手帮个忙,谢谢了~~~~