求用spring调用oracle存储过程的代码
如题,最好是底层共通的封装代码,谢谢各位大侠了。
[解决办法]
jdbcTemplate.execute(callName,new CallableStatementCallback(){ public Object doInCallableStatement(CallableStatement call) throws SQLException, DataAccessException { call.execute(); } });
[解决办法]
1.获取CallableStatement语句:
CallableStatement cs = conn.prepareCall("{call spName(?,?,?)}");
2.传入输入参数和注册输出参数
cs.setXXX(index,value);//输入参数
cs.registerOutParameter(index,type);//输出参数
3.执行存储过程:
cs.execute();
我的异常网推荐解决方案:oracle存储过程,http://www.myexception.cn/oracle-develop/177537.html