<%@page import="javax.servlet.*"%>
<%@page import="java.sql.*"%>
<%@page import="java.util.*"%>
<%@page import="java.lang.Object.*"%>
<%@page import="java.text.*"%>
<%
String empid=request.getParameter("Emp.Id");
String sname=request.getParameter("sname");
String designation=request.getParameter("designation");
String category=request.getParameter("category");
String dept=request.getParameter("dept");
java.util.Date d=new SimpleDateFormat("yyyy-MM- dd").parse(request.getParameter("dob"));
java.sql.Date dob=new java.sql.Date(d.getTime());
String age=request.getParameter("age");
java.util.Date dj=new SimpleDateFormat("yyyy-MM-dd").parse(request.getParameter("doj"));
java.sql.Date doj=new java.sql.Date(dj.getTime());
String gender=request.getParameter("gender");
String community=request.getParameter("community");
String education=request.getParameter("education");
String yoe=request.getParameter("yoe");
String pdoor=request.getParameter("pdoor");
String padd1=request.getParameter("padd1");
String padd2=request.getParameter("padd2");
String pcity=request.getParameter("pcity");
String ptaluk=request.getParameter("ptaluk");
String pdistrict=request.getParameter("pdistrict");
String ppcode=request.getParameter("ppcode");
String pstate=request.getParameter("pstate");
String cdoor=request.getParameter("cdoor");
String cadd1=request.getParameter("cadd1");
String cadd2=request.getParameter("cadd2");
String ccity=request.getParameter("ccity");
String ctaluk=request.getParameter("ctaluk");
String cdistrict=request.getParameter("cdistrict");
String cpcode=request.getParameter("cpcode");
String cstate=request.getParameter("cstate");
String email=request.getParameter("email");
String ms=request.getParameter("ms");
String noc=request.getParameter("noc");
String fsname=request.getParameter("fsname");
String fsocc=request.getParameter("fsocc");
String fsadd=request.getParameter("fsadd");
String fsmob=request.getParameter("fsmob");
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql",
"root", "mysql23");
Statement st = con.createStatement();
int i=st.executeUpdate("insert into staffdetail(empid,sname,designation,category,dept,dob,age,doj,gender,community,education,yoe,pdoor,padd1,padd2,pcity,ptaluk,pdistrict,ppcode,pstate,cdoor,cadd1,cadd2,ccity,ctaluk,cdistrict,cpcode,cstate,emailid,mstatus,nchild,fsname,fsocc,fsaddress,fsmobile) values("+empid+",'"+sname+"','"+designation+"','"+category+"','"+dept+"','"+dob+"','"+age+"','"+doj+"','"+gender+"','"+community+"','"+education+"','"+yoe+"','"+pdoor+"','"+padd1+"','"+padd2+",'"+pcity+"','"+ptaluk+"','"+pdistrict+"','"+ppcode+"','"+pstate+"','"+cdoor+"','"+cadd1+"','"+cadd2+"','"+ccity+"','"+ctaluk+"','"+cdistrict+"','"+cpcode+"','"+cstate+"','"+email+"','"+ms+"','"+noc+"','"+fsname+"','"+fsocc+"','"+fsadd+"','"+fsmob+"')");
if(i>0)
{
response.sendRedirect("over.jsp");
}
else
{
response.sendRedirect("over1.jsp");
}
%>
的錯誤是商店形式的信息使用JSP
javax.servlet.ServletException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:你在你的SQL有 錯誤句法;檢查對應於您的手冊 MySQL服務器版本
mysql類似乎並沒有被導入。請提供您的代碼。 –