ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Vissers <Jan.Viss...@cumquat.nl>
Subject Re: IBatis and Oracle stored functions
Date Tue, 04 Jan 2005 20:32:28 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
<font face="Bitstream Vera Sans Mono">Regarding </font>{? = call
where the function returns an (Oracle) REF Cursor and input parameter
is another cursor type. What would a possible sqlMap definition look
like, for such a function?<br>
How would one call this from within Java?<br>
Clinton Begin wrote:
<blockquote cite="mid16178eb105010410304a4c9bd5@mail.gmail.com"
  <pre wrap="">You can look at the Blob and ClobTypeHandlerCallback implementations
included with 2.0.9 as an example of a CTH.  As fot the getCursor
stuff, you won't have access to the PreparedStatement, but you should
be able to use getObject(1) to get the cursor back.

In the worst case scenario, 2.0.9 includes support for implementing
full TypeHandler implementations, which are harder to write, but will
give you access to the PS.


On Tue, 04 Jan 2005 19:05:56 +0100, Jan Vissers <a class="moz-txt-link-rfc2396E" href="mailto:Jan.Vissers@cumquat.nl">&lt;Jan.Vissers@cumquat.nl&gt;</a>
  <blockquote type="cite">
    <pre wrap="">For instance:

CallableStatement cstmt = conn.prepareCall("{? = call pkg_refcur.f_refcur(?)}");
cstmt.registerOutParameter(1, OracleTypes.CURSOR);
cstmt.setString(2, i_etype);
ResultSet rset = ((OracleCallableStatement)cstmt).getCursor(1);

I've seen *part* of an example for a custom type handler, but no real
complete example including call sequence. This would help a great deal!


Clinton Begin wrote:

    <blockquote type="cite">
      <pre wrap="">How would you call them from JDBC?

iBATIS supports pretty much anything supported by the standard JDBC APIs.

Vendor specific extensions typically require a custom type handler, or
may not be supportable at all.


On Tue, 04 Jan 2005 18:43:52 +0100, Jan Vissers <a class="moz-txt-link-rfc2396E" href="mailto:Jan.Vissers@cumquat.nl">&lt;Jan.Vissers@cumquat.nl&gt;</a>

      <blockquote type="cite">
        <pre wrap="">Hi,

I'm evaluating IBatis sqlMap/DAO wrt Oracle functionality, like:

"RETURNING ... INTO ..." Clause
CLOB (oracle.sql.CLOB) &gt;32K
BLOB (oracle.sql.BLOB)
XMLType (oracle.xdb.XMLType)
CallableStatement... It looks to me that none of these are really supported.
I, for instance have a packaged function:

function insert_record( p_i_values in pck2.refcursortype)
return   pck2.refcursortype;

Is there any way to call these types of objects from IBatis?




      <pre wrap="">

    <pre wrap="">--
Get Firefox! <a class="moz-txt-link-rfc2396E" href="http://www.spreadfirefox.com/?q=affiliates&id=0&t=70">&lt;http://www.spreadfirefox.com/?q=affiliates&amp;id=0&amp;t=70&gt;</a>
 And    Get Thunderbird <a class="moz-txt-link-rfc2396E" href="http://www.mozilla.org/products/thunderbird/">&lt;http://www.mozilla.org/products/thunderbird/&gt;</a>

  <pre wrap=""><!---->
<div class="moz-signature">-- <br>
      <td><a href="http://www.spreadfirefox.com/?q=affiliates&amp;id=0&amp;t=55"><img
 alt="Get Firefox!" title="Get Firefox!"
 src="cid:part1.09010708.09060100@cumquat.nl" border="0"></a></td>
      <td><a href="http://www.mozilla.org/products/thunderbird/"
 title="Get Thunderbird - Reclaim Your Inbox"><img
 src="cid:part2.00050402.07050506@cumquat.nl" alt="Get Thunderbird"
 border="0" height="32" width="110"></a></td>

View raw message