ibatis-user-java mailing list archives

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




"Jeff Butler" <jeffgbutler@gmail.com> scritti il 27/09/2006 16:29:30

> Hi Cesare,

[...]

> 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.

Thanks Jeff.
It works!

The new content for XML configuration file now is

   <sqlMap namespace="GPJ">

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

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

   </sqlMap>

As you recommended, the right way to call the no-arg no-ret-value procedure
is based on the "update" method of SqlMapClient. Here is the Java code
snippet


      public void setUp()     throws SQLException
      {
        SqlMapClient lSqlMapClient = Configuration.getSqlMapInstance();
        lSqlMapClient.update( "setUp", null );
      }

      public void tearDown() throws SQLException
      {
        SqlMapClient lSqlMapClient = Configuration.getSqlMapInstance();
        lSqlMapClient.update( "tearDown", null );
      }


Great!
:)
Mime
View raw message