ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: Stored procedures with no parameters (and no return data)
Date Wed, 27 Sep 2006 14:29:30 GMT
Hi Cesare,

I think that the thread on the C# version of iBATIS will be of little use -
the code bases are pretty different.

For your issue, remove the <parameterMap> element, then code the procedure
elements like this (no results, no parameters):

<procedure id="setUp">
  {call ut_Tipo_Dato.ut_setup}
</procedure>

Then call it with the "update" method.  I think that should do it.

Jeff Butler




On 9/27/06, C.Zecca@ads.it <C.Zecca@ads.it> wrote:
>
>  Hi all.
> Thanks to Jeff Butler both for the support and for the invitation to the
> community and this list (and to Clinton Begin, as well).
> (I state in advance that I'm new to iBatis and that the main document I
> tend to refer to is iBATIS-SqlMaps-2.pdf. Sorry in advance for any trivial
> question, if any).
>
> There are two related threads
>
>    Problem calling stored procedure having no parameter
>    http://www.mail-archive.com/user-*cs*@
>    ibatis.apache.org/msg01069.html
>
> in the forum about C sharp and
>
>    Procedures in iBatis
>    http://www.mail-archive.com/user-*java*@
>    ibatis.apache.org/msg03964.html
>
>
> in this forum about iBatis for Java.
>
> I have to call, from a Java unit test, two procedures
>
> *procedure* ut_setup;
> *procedure* ut_teardown;
>
> which prepare some test data and part of an Oracle PL/SQL unit testing
> package called ut_Tipo_Dato and .
> Please note that those procedures do not have neither an argument nor a
> return value.
>
> I googled the internet and searched these forums, as well, I discovered
> the two thread quoted above
> In the
>
>    Problem calling stored procedure having no parameter
>    http://www.mail-archive.com/user-cs@ibatis.apache.org/msg01069.html
>
> discussion you can find a technique (for iBatis for C#) for a parameterMap
> for a no-argument procedure that is used to call ut_setup() and
> ut_teardown()
>
>    <sqlMap namespace="GPJ">
>
>    <parameterMap id="EmptyParam">
>    </parameterMap>
>
>    <procedure id="setUp" parameterMap="EmptyParam">
>    {call ut_Tipo_Dato.ut_setup}
>    </procedure>
>
>    <procedure id="tearDown" parameterMap="EmptyParam">
>    {call ut_Tipo_Dato.ut_teardown}
>    </procedure>
>
>    </sqlMap>
>
> The technique does not work: when I call to construct my SqlMapClientsingleton by calling
> SqlMapClientBuilder.buildSqlMapClient() the following error is reported
>
>    *com.ibatis.common.exception.NestedRuntimeException*: Error
>    occurred. Cause: *com.ibatis.common.xml.NodeletException*: Error
>    parsing XML. Cause: *
>    com.ibatis.common.exception.NestedRuntimeException*: Error parsing
>    XPath '/sqlMapConfig/sqlMap'. Cause: *
>    com.ibatis.common.xml.NodeletException*: Error parsing XML. Cause: *
>    org.xml.sax.SAXParseException*: Attribute "class" is required and
>    must be specified for element type "parameterMap".
>    [...]
>
>
> 1)
> What is wrong?
> How does it work in iBatis for Java in the XML files when you have to
> configure procedures with no arguments / with no return value?
>
> Somewhere (I got lost but somewhere I googled and found the syntax for the
> parameterMap statement and the class attribute was reported as optional)
> Please note that the question posted by Suman . Mishra (
> http://www.mail-archive.com/user-java@ibatis.apache.org/msg03967.html) has
> been, substantially, unanswered.
> So, let me try again.
>
> 2)
> Generally, are considerations about XML configuration files in one
> language generally (e.g C#) valid also for the other language (e.g Java)?
>
> Thanks in advance for any help
>
> ciao
> Cesare
>
> P.S.
> To answer to the comment from Beemsterboer Software
>
> http://www.mail-archive.com/user-java@ibatis.apache.org/msg03967.html
>
> this is a case where a procedure has both no argument and no return value.
> A procedure with no return value should normally be the canonical form for
> a procedure! But this is another story... ;)
>
>

Mime
View raw message