servlet无法正确调用sql server2000的存储过程?
servlet无法正确调用sql server2000的存储过程?用常量传进取可以用变量不可以了,不知道是怎么回事。
package marriage.register;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import marriage.ServletUtilities;
/**
* 类 名: MarriageRegisterValidate
* 功能描述: 验证表单填写是否完整
* @author Administrator
* 编写日期: 2006.1.16
*/
public class MarriageRegisterValidate extends HttpServlet
{
MarriageRegisterBean mrBean = new MarriageRegisterBean();
private String marriageRegisterUrl = "/Application/MarPutIn.jsp" ;
public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
{
//MarriageRegisterBean mrBean = new MarriageRegisterBean();
//以下是男女双方的个人资料
mrBean.setUserName(ServletUtilities.filter(request.getParameter("userName")));
mrBean.setMuserName(ServletUtilities.filter(request.getParameter("muserName")));
mrBean.setUserSex(ServletUtilities.filter(request.getParameter("userSex")));
mrBean.setMuserSex(ServletUtilities.filter(request.getParameter("muserSex")));
mrBean.setCardType(ServletUtilities.filter(request.getParameter("cardType")));
mrBean.setMcardType(ServletUtilities.filter(request.getParameter("mcardType")));
mrBean.setCardNum(ServletUtilities.filter(request.getParameter("cardNum")));
mrBean.setMcardNum(ServletUtilities.filter(request.getParameter("mcardNum")));
mrBean.setBirthday(ServletUtilities.filter(request.getParameter("birthday")));
mrBean.setMbirthday(ServletUtilities.filter(request.getParameter("mbirthday")));
mrBean.setNationality(ServletUtilities.filter(request.getParameter("nationality")));
mrBean.setMnationality(ServletUtilities.filter(request.getParameter("mnationality")));
mrBean.setFolk(ServletUtilities.filter(request.getParameter("folk")));
mrBean.setMfolk(ServletUtilities.filter(request.getParameter("mfolk")));
/*
mrBean.setMarriageState(ServletUtilities.filter(request.getParameter("marriageState")));
mrBean.setMmarriageState(ServletUtilities.filter(request.getParameter("mmarriageState")));
*/
mrBean.setKulturLevel(ServletUtilities.filter(request.getParameter("kulturLevel")));
mrBean.setMkulturLevel(ServletUtilities.filter(request.getParameter("mkulturLevel")));
mrBean.setUserWork(ServletUtilities.filter(request.getParameter("userWork")));
mrBean.setMuserWork(ServletUtilities.filter(request.getParameter("muserWork")));
mrBean.setAddressPhone(ServletUtilities.filter(request.getParameter("addressPhone")));
mrBean.setMaddressPhone(ServletUtilities.filter(request.getParameter("maddressPhone")));
mrBean.setMobelPhone(ServletUtilities.filter(request.getParameter("mobelPhone")));
mrBean.setMmobelPhone(ServletUtilities.filter(request.getParameter("mmobelPhone")));
mrBean.setAddress(ServletUtilities.filter(request.getParameter("address")));
mrBean.setMaddress(ServletUtilities.filter(request.getParameter("maddress")));
mrBean.setSertificateNo(ServletUtilities.filter(request.getParameter("sertificateNo")));
mrBean.setMsertificateNo(ServletUtilities.filter(request.getParameter("msertificateNo")));
//以上是男女双方的个人资料
//以下是男女双方的共同资料
mrBean.setSetupPersonName(ServletUtilities.filter(request.getParameter("setupPersonName")));
mrBean.setAreaName(ServletUtilities.filter(request.getParameter("areaName")));
mrBean.setOrgan(ServletUtilities.filter(request.getParameter("organ")));
//以上内容填写bean完毕
//将要判断接下来的工作是怎么样
//boolean bool = mrBean.isComplete();
if(mrBean.isComplete())
{
//如果填写了完整的信息,则进入这个环节
//未完成请继续编写
int isValidateSucceed =MarriageRegisterStateValidate.validateMarriageState(mrBean.getCardType(),mrBean.getCardNum(),mrBean.getMcardType(),mrBean.getMcardNum());
switch(isValidateSucceed)
{
case 0: