Define your ref cursor output parameter like this:
#{department,mode=OUT,
jdbcType=CURSOR,
javaType=java.sql.ResultSet,
resultMap=departmentResultMap}
The "resultMap" attribute specifies the name of the result map that
MyBatis will use to process the ref cursor. In your parameter class,
the "department" attribute would be List<Department>.
Jeff Butler
Multiple result sets are supported, just pass a comma delimited set of
result maps or object:
<select ... resultMap="map1, map2, map3">
I can't write your entire application for you :) If you want to pass
a custom object, it will require a custom type handler and some
special code on both sides - this sounds like a good research project
for you to do.
Jeff Butler
On Wed, Nov 10, 2010 at 8:47 AM, Rajkumar Parthasarathi
Handling of cursors returned from stored proc is very much dependent on
the RDBMS and on the JDBC driver for that RDBMS. For example, I tried
running a program on PostgreSQL that I had written against Oracle that
returned a cursor from a stored proc. Didn't work because the
PostgreSQL JDBC driver didn't return type jdbcType CURSOR but type UNKNOWN.
Debug your code and observe what type DB2 is returning.
--
Guy Rouillier
regards
Mario
Rajkumar
Parthasarathi
<pra...@gmail.co To
m> mybati...@googlegroups.com
Sent by: cc
mybatis-user@goog
legroups.com Subject
Re: Calling stored procedure to
return back a CURSOR.
11/10/2010 08:17
PM
Please respond to
mybatis-user@goog
legroups.com