ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From C.Ze...@ads.it
Subject Stored procedures with no parameters (and no return data)
Date Wed, 27 Sep 2006 13:24:35 GMT

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

in the forum about C sharp and

   Procedures in iBatis

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

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

   <sqlMap namespace="GPJ">

      <parameterMap id="EmptyParam">

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

      <procedure id="tearDown" parameterMap="EmptyParam">
            {call ut_Tipo_Dato.ut_teardown}


The technique does not work: when I call to construct my SqlMapClient
singleton 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".

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.

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


To answer to the comment from Beemsterboer Software


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... ;)
View raw message