调用db2存储过程只有一个输出参数 怎么写 call
1个回答
展开全部
private CallableStatement call ;
public CallableStatement getCall() {
return call;
}
public void setCall(CallableStatement call) {
this.call = call;
}
public int saveFinanceVoucherRecorded(String userName){
int val = 0 ;
String proc = "" ;
try {
proc = "call p_saveFinanceVoucherRecorded(?)";
call = this.getConnection().prepareCall(proc);
logger.info(proc);
call.registerOutParameter(1, Types.INTEGER);
call.executeUpdate();
val = call.getInt(1);
} catch (Exception e) {
val = 4 ;
e.printStackTrace();
}
return val ;
}
我是这么写的希望能帮到你
public CallableStatement getCall() {
return call;
}
public void setCall(CallableStatement call) {
this.call = call;
}
public int saveFinanceVoucherRecorded(String userName){
int val = 0 ;
String proc = "" ;
try {
proc = "call p_saveFinanceVoucherRecorded(?)";
call = this.getConnection().prepareCall(proc);
logger.info(proc);
call.registerOutParameter(1, Types.INTEGER);
call.executeUpdate();
val = call.getInt(1);
} catch (Exception e) {
val = 4 ;
e.printStackTrace();
}
return val ;
}
我是这么写的希望能帮到你
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询