ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Altieri <mca...@yahoo.com>
Subject paremeter map and smallint
Date Wed, 20 Feb 2008 20:57:23 GMT
Hi I am trying to call a stored procedure using Ibatis's sql mapping on WebSphere 6.1 connected
to a container managed datasource that is a  msft sqlserver2000 db (I have called other stored
procedures fine but the smallint is screwing me up)...

this SP declaration is something like this:

CREATE PROCEDURE SOME_SP (@SOMECHARS    CHAR(9),   @SOME_SMALLINT         SMALLINT OUTPUT
,.......

in my mapping xml I have the following (and a resultmap declaration as well):

<parameterMap id="defaultParameters" class="map" >
    <parameter property="someChars" javaType="java.lang.String" mode="IN"/>
    <parameter property="someSmallInt" jdbcType="java.sql.Types.SMALLINT" javaType="java.lang.Integer"
mode="OUT"/>
  </parameterMap>
  
 

  <procedure id="getList" parameterMap="defaulParameters" resultMap="someResultMap" >
    EXEC SOME_SP ?,?
  </procedure>

Then in my ListSqlMapDao I have the following method being called:

public List getSomeList() {
        
        Map paramMap = new HashMap(10);
        
        String someChars = new String;
        Integer someSmallInt = new Integer(java.sql.Types.SMALLINT);
                
        paramMap.put("someChars", someChars);
        paramMap.put("someSmallInt", someSmallInt);
        
        return queryForList("getList", paramMap);
    }

when this method is called I get the following exception...

Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in com/perficient/coe/dao/ibatis/maps/OrderList.xml.  
--- The error occurred while executing query procedure.  
--- Check the EXEC PO_HdrData_S_SP ?,?,?,?,?,?,?,?,?.  
--- Check the output parameters (register output parameters failed).  
--- Cause: java.sql.SQLException: [IBM][SQLServer JDBC Driver]Invalid parameter binding(s).
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:185)
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:615)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:589)
    at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
    at org.springframework.orm.ibatis.SqlMapClientTemplate$3.doInSqlMapClient(SqlMapClientTemplate.java:298)
    at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:209)
    ... 86 more
Caused by: java.sql.SQLException: [IBM][SQLServer JDBC Driver]Invalid parameter binding(s).

I can't change the smallInt call in the storedprocedure since other programs use this - but
am free to change the call as much as i need

Thanks!

Mime
View raw message