调用存贮过程疑问

Luffy0614 2010-10-28 08:51:28
try {
String st = "{call pro_temp_customer()}";
callsta = con.prepareCall(st);
System.out.println(callsta.execute());
if(callsta.execute()==true) {
//存贮过程成功
}
这是调用的程序,不知道写的对不对,这个pro_temp_customer 是把临时表的数据更新或者删除到正式表,没有需要返回什么函数。只是调用执行,但是到了 callsta这步停住了,不走了,求解
...全文
44 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Luffy0614 2010-10-28
  • 打赏
  • 举报
回复
this.commonMapper.getJdbcTemplate().execute(
new CallableStatementCreator() {
public CallableStatement createCallableStatement(Connection con) throws SQLException {
String storedProc = "{call pro_temp_customer_1}";// 调用的sql
CallableStatement cs = con.prepareCall(storedProc);
return cs;
}
}, new CallableStatementCallback() {
public Object doInCallableStatement(CallableStatement cs) throws SQLException, DataAccessException {
cs.execute();
return null;// 获取输出参数的值
}

改了下,用spring这样连接数据库,但是还是没有反映啊,存贮过程没有问题。估计是程序这里写的不对没有调用啊。??
xuyang840117 2010-10-28
  • 打赏
  • 举报
回复
callsta.executeUpdate();

50,528

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧