<%
String no1=request.getParameter("no1");
String no2=request.getParameter("no2");
int no3=Integer.parseInt(request.getParameter("no3"));
CallableStatement smt=null;
String strSQL="";Connection con=dblink.connection();
strSQL ="{call vote02.PROC_FAKE_359(?,?,?)}";
smt=con.prepareCall(strSQL);//设置输入参数
smt.setString(1,no1);
smt.setString(2,no2);
smt.setInt(3,no3);
smt.registerOutParameter(4,oracle.jdbc.OracleTypes.INTEGER);//登记输出参数
try{
boolean flag = smt.execute(strSQL);
}catch(Exception e){out.print("err:"+e.toString());}
存储过程是可以运行的。但用jsp调用后报错:ORA-01008: not all variables bound
String no1=request.getParameter("no1");
String no2=request.getParameter("no2");
int no3=Integer.parseInt(request.getParameter("no3"));
CallableStatement smt=null;
String strSQL="";Connection con=dblink.connection();
strSQL ="{call vote02.PROC_FAKE_359(?,?,?)}";
smt=con.prepareCall(strSQL);//设置输入参数
smt.setString(1,no1);
smt.setString(2,no2);
smt.setInt(3,no3);
smt.registerOutParameter(4,oracle.jdbc.OracleTypes.INTEGER);//登记输出参数
try{
boolean flag = smt.execute(strSQL);
}catch(Exception e){out.print("err:"+e.toString());}
存储过程是可以运行的。但用jsp调用后报错:ORA-01008: not all variables bound
参数列表如下:
p_strPhone String类型,入参,
p_strContent String类型,入参,
p_nAddValue Number类型,入参,
p_nError Number类型,出参.
另外,你已经prepareCall了就不要boolean flag = smt.execute(strSQL);了
只要boolean flag = smt.execute();就可以了
------------------------------
你的意思时flag == false? 不要检查execute()的返回值,它并不代表存储过程执行成功与否。至于没有异常就时正确执行你了。
2. execute不加参数:boolean flag = smt.execute();