ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Miquel Angel Bada Zuazo" <mab...@gmail.com>
Subject Re: stored procedure question .
Date Tue, 04 Apr 2006 23:50:03 GMT
Hi,

I'm developing the same, but with SQL SERVER, and when I try to map, it
throws an SQL Exception


com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in
com/hermes/persistence/sqlmapdao/sql/Accounts.xml.
--- The error occurred while applying a parameter map.
--- Check the Accounts.paramSearchAccountList.
--- Check the statement (update procedure failed).
--- Cause: java.sql.SQLException: Formal parameter '@Deleted' was defined as
OUTPUT but the actual parameter not declared OUTPUT.
Caused by: java.sql.SQLException: Formal parameter '@Deleted' was defined as
OUTPUT but the actual parameter not declared OUTPUT.

the code is the following:

--------XML-------

<parameterMap id="paramSearchAccountList" class="java.util.HashMap" >
        <parameter property="clientName" jdbcType="VARCHAR" javaType="
java.lang.String" mode="IN"/>
        <parameter property="role" jdbcType="VARCHAR" javaType="
java.lang.String" mode="IN"/>
        <parameter property="VATNumber" jdbcType="VARCHAR" javaType="
java.lang.String" mode="IN"/>
        <parameter property="currency" jdbcType="VARCHAR" javaType="
java.lang.String" mode="IN"/>
        <parameter property="deleted" jdbcType="BIT" javaType="
java.lang.Integer" mode="INOUT"/>
        <parameter property="NumRecordsRetrieved" jdbcType="INTEGER"
javaType="java.lang.Integer" mode="INOUT"/>
        <parameter property="list" jdbcType="java.util.list" mode="OUT"
resultMap="usu"/>
      <!--    <parameter property="list" jdbcType="INTEGER" mode="OUT" />
-->
   </parameterMap>

   <procedure  id="getAllAccounts" resultMap="accountsList"
parameterMap="paramSearchAccountList">
      {
        call CPGHermesAccountsSearch (?, ?, ?, ?, ?, ?)
      }
   </procedure>
--------JAVA-------------

public PaginatedList getListAccounts(HashMap map) throws SQLException {
      PaginatedList list = null;
      try{
      //  list = sqlMap.queryForPaginatedList("Accounts." + GET_ALL +
"Accounts", map, 1);
        list = (PaginatedList) sqlMap.queryForObject("Accounts." + GET_ALL +
"Accounts", map);

      }
       catch (SQLException e) {
           throw (e);
         //   logger.error("Error getting departments", e);
       }
      return list;
  }
-----------------------
If I execute the SP in SQL Analyzer, it works fine, but with ibatis, there
may be some missconfiguration with the parameters, does anybody knows what
do I'm doing wrong?

Sincerely yours,

Miquel Angel





On 3/27/06, Esperanza.Echeverria@steria.es <Esperanza.Echeverria@steria.es>
wrote:
>
>
> yes, it works,... here is an example...
>
> <parameterMap id="misParametros" class="java.util.HashMap" >
>     <parameter property="parametro1" jdbcType="VARCHAR" javaType="
> java.lang.String" mode="IN"/>
>     <parameter property="parametro2" jdbcType="VARCHAR" javaType="
> java.lang.String" mode="IN"/>
>     <parameter property="parametro3" jdbcType="VARCHAR" javaType="
> java.lang.String" mode="OUT"/>
>     <parameter property="miusu" jdbcType="ORACLECURSOR" mode="OUT"
> resultMap="usu"/>
>     <parameter property="parametro5" jdbcType="VARCHAR" javaType="
> java.lang.String" mode="OUT"/>
>     <parameter property="parametro6" jdbcType="VARCHAR" javaType="
> java.lang.String" mode="OUT"/>
>     <parameter property="parametro7" jdbcType="VARCHAR" javaType="
> java.lang.String" mode="OUT"/>
>     <parameter property="parametro8" jdbcType="VARCHAR" javaType="
> java.lang.String" mode="OUT"/>
>     <parameter property="parametro9" jdbcType="VARCHAR" javaType="
> java.lang.String" mode="OUT"/>
>     <parameter property="parametro10" jdbcType="VARCHAR" javaType="
> java.lang.String" mode="OUT"/>
>     <parameter property="parametro11" jdbcType="VARCHAR" javaType="
> java.lang.String" mode="OUT"/>
>     <parameter property="parametro12" jdbcType="VARCHAR" javaType="
> java.lang.String" mode="OUT"/>
>     <parameter property="parametro13" jdbcType="VARCHAR" javaType="
> java.lang.String" mode="OUT"/>
>     <parameter property="parametro14" jdbcType="VARCHAR" javaType="
> java.lang.String" mode="OUT"/>
>   </parameterMap>
>
>   <procedure id="llamaAltaMin" parameterMap="misParametros" >
>     {
>     call sipj2ee.AltaMinima(?,?,?,?,?,?,?,?,?,?,?,?,?,?)
>     }
>   </procedure>
>
>
>
>   *Esperanza Echeverría de Miguel*
> Steria España *http://www.steria.es* <http://www.steria.es/>
> C/Menéndez y Pelayo,3 bis 46010 Valencia
> Tel: + 34 96 393 87 50 Fax: +34 96 393 87 51
> esperanza.echeverria@steria.es
>
>
>
>
>
>
>   *Sergey Livanov <Sergey.Livanov@ukrpost.net>*
>
> 26/03/2006 12:01
> Please respond to user-java
>
>         To:        user-java@ibatis.apache.org
>         cc:
>         Subject:        stored procedure question .
>
>
>
>
> Invocation of stored procedures
> <procedure id=...>
>   { call sp(?) }
> </procedure>
>
> works in Oracle 9i with classes12.jar ?
>
>
>
> --
> regards,
> Sergey                          mailto:Sergey.Livanov@ukrpost.net
>
>
>
>

Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message