存储过程将多个表返回到spring jdbc模板 [英] Stored Procedure returning multiple tables to spring jdbc template

查看:100
本文介绍了存储过程将多个表返回到spring jdbc模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Iam使用JdbcTemplate从我的Spring DAO类调用存储过程。我的问题是,存储过程返回多个表。有没有办法使用Spring JdbcTemplate访问多个表。

Iam calling a stored procedure from my Spring DAO class using JdbcTemplate. My problem is that, stored procedure returns multiple tables. Is there a way to access multiple tables using Spring JdbcTemplate.

如果我使用
jdbcTemplate.queryForList(myStoredProc,new Object [] {parameters}
我只从结果中获取第一个表。

If I use jdbcTemplate.queryForList(myStoredProc, new Object[]{parameters} iam getting only first table from the result.

我的数据库是SQL Server 2005。

My database is SQL Server 2005.

我的要求是否有除jdbcTemplate以外的任何方法。如果是,请告诉我。

Is there any method other than jdbcTemplate for my requirement. If yes, please let me know.

提前致谢....

Thanks in advance....

推荐答案

参见 http://static.springsource.org/spring/docs/2.0.7/reference /jdbc.html#jdbc-StoredProcedure

本节中给出的示例完全适用于存储过程返回多个结果集的情况。给出了适用于Oracle的示例,但它也应该以相同的方式为MS SQL Server工作。

The example given in this section is exactly for your case where the stored procedure returns multiple result-sets. Although the example given there is for Oracle, but it should work in the same way for MS SQL Server also.

这篇关于存储过程将多个表返回到spring jdbc模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆