求解![Microsoft][ODBC Microsoft Access Driver] 查询值的数目与目标字段中的数目不同。
一运行就出现[Microsoft][ODBC Microsoft Access Driver] 查询值的数目与目标字段中的数目不同。的问题<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<%request.setCharacterEncoding("GB2312");%>
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>新增教师信息</title>
</head>
<% Connection conn=null;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String strConn="jdbc:odbc:house";
String strUser="sa";
String strPassword="111111";
conn=DriverManager.getConnection(strConn,strUser,strPassword);
String depart="";
String teacherid=request.getParameter("teacherid");
String name=request.getParameter("name");
String sex=request.getParameter("sex");
String job=request.getParameter("job");
String canjiagongzuoshijian=request.getParameter("canjiagongzuoshijian");
String lizhishijian=request.getParameter("lizhishijian");
String zaizhiqingkuang=request.getParameter("zaizhiqingkuang");
String xianyouzhufangmianji=request.getParameter("xianyouzhufangmianji");
String fenpeinianyuer=request.getParameter("fenpeinianyuer");
String remark=request.getParameter("remark");
depart=request.getParameter("depart");
String sql="insert into Info values(?,?,?,?,?,?,?,?,?,?,?)";
PreparedStatement pstm=conn.prepareStatement(sql);
pstm.setString(1,teacherid);
pstm.setString(2,name);
pstm.setString(3,sex);
pstm.setString(4,job);
pstm.setString(5,canjiagongzuoshijian);
pstm.setString(6,lizhishijian);
pstm.setString(7,zaizhiqingkuang);
pstm.setString(8,xianyouzhufangmianji);
pstm.setString(9,fenpeinianyuer);
pstm.setString(10,remark);
pstm.setString(11,depart);
int n =pstm.executeUpdate();
if(n>0){
out.print("<script Language='JavaScript'>window.alert('添加成功,即将返回添加页面')</script>");
out.print("<script Language='JavaScript'>window.location='addTeacher.htm'</script>");
}else{
out.print("<script Language='JavaScript'>window.alert('添加失败,即将返回添加页面')</script>");
out.print("<script Language='JavaScript'>window.location='addTeacher.htm'</script>");
}
pstm.close();
conn.close();
}catch(ClassNotFoundException e){
out.println(e.getMessage());
}catch(SQLException e){
out.println(e.getMessage());
}
finally
{
try{
if(conn!=null)
conn.close();
}catch(Exception e){}
}
%>
</html>