-
Oracle Stored Procedures
Hi all,
I am attempting to call an Oracle stored procedure from Spring integration. I have a pooled connection to my database and am using an inbound channel adapter to retreive the data from a select query as follows:
Code:
<int-jdbc:stored-proc-inbound-channel-adapter
data-source="dataSource" expect-single-result="true"
ignore-column-meta-data="true" is-function="false"
skip-undeclared-results="true" channel="channel1" id="SP_JDBC"
stored-procedure-name="myProc" auto-startup="true">
<int:poller fixed-rate="4000"/>
<int-jdbc:sql-parameter-definition name="sys_refcursor"
direction="OUT" type="INTEGER" />
<int-jdbc:returning-resultset name="rows" row-mapper="myRowMapper" />
</int-jdbc:stored-proc-inbound-channel-adapter>
My query takes a cursor as an outbound parameter and will return a result set. The query works in Spring MVC elsewhere in the project.
I keep getting errors saying my parameters are invalid. I've tried googling, but there doesn't seem much in the way of examples, if any. Am I defining the curosr the correct way? Or is it best to use a different sort of gateway/channel-adapter and call the stored-proc from Java?
Thanks
Ed
-
Hello
There is no need to declare <int-jdbc:sql-parameter-definition> for cursors.
You should just map <int-jdbc:returning-resultset> for OUT corsors.
Cheers,
Artem
-
Artem,
Thanks. That worked perfectly. No mention of this in the reference manual.
Ed