I changed UserMapping.xml

<update id="validate" parameterType="hashmap" statementType="CALLABLE">
                {call dbo.usp_LoginUser(#{username, mode=IN, jdbcType=VARCHAR, 
javaType=java.lang.String}, 
                                                          #{password, mode=IN, 
jdbcType=VARCHAR, javaType=java.lang.String}, 
                                                          #{valid, mode=OUT, 
jdbcType=BIT, javaType=java.lang.Boolean})}
        </update>

But still:
### Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 
'IN'.  Cause: java.lang.ClassNotFoundException: Cannot find class: IN



-------- Original Message --------
Subject: Calling a SP throws TypeException (07-Jan-2010 16:31)
From:    [e2n] software | Björn Raupach <raup...@e2n.de>
To:      raup...@e2n.de

> Hello,
> 
> while trying to call a Stored Procedure I received the following execption. 
> The documentation doesn't cover much about how to handle Stored Procedures 
> so I thought I am better of asking this here.
> 
> My setp up is iBatis 3.0 Beta 7 and a SQL Server 2008.
> 
> In tsql I call my sp like this:
> DECLARE @valid AS BIT
> EXECUTE usp_LoginUser 'some_user', 'pass', @valid OUT
> SELECT @valid
> 
> In my UserMapping.xml I declared:
> <update id="validate" parameterType="hashmap" statementType="CALLABLE">
> 
> EXECUTE usp_LoginUser #{username,jdbcType=VARCHAR, javaType=String, mode=IN}
> , #{password, jdbcType=VARCHAR, javaType=String, mode=IN}, #{valid, 
> jdbcType=BIT, javaType=Boolean, mode=OUT}
> </update>
> 
> and finally the calling code looks like this:
> 
> UserMapper mapper = session.getMapper(UserMapper.class);
> Boolean valid = Boolean.FALSE;
> Map m = new HashMap();
> m.put("username", username);
> m.put("password", password);
> m.put("valid", valid);
> mapper.validate(m);
> 
> My unit test fails with the following error:
> 
> org.apache.ibatis.exceptions.IbatisException: 
> ### Error updating database.  Cause: org.apache.ibatis.type.TypeException: 
> Could not resolve type alias 'IN'.  Cause: java.lang.ClassNotFoundException:
>  Cannot find class: IN
> ### The error may exist in de/e2n/stadtlichter/db/data/UserMapper.xml
> ### The error may involve de.e2n.stadtlichter.db.data.UserMapper.validate
> ### The error occurred while executing an update
> ### Cause: org.apache.ibatis.type.TypeException: Could not resolve type 
> alias 'IN'.  Cause: java.lang.ClassNotFoundException: Cannot find class: IN
>  at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(
> ExceptionFactory.java:8)
>  at org.apache.ibatis.session.defaults.DefaultSqlSession.update(
> DefaultSqlSession.java:95)
>  at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:55)
>  at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:18)
> 
> Any help would be appreciated. Thanks in advance.
> 
> Btw, there is a typo in the documentation.
> p21. delete - A mapped DELEETE statement
> ...



---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org
For additional commands, e-mail: user-java-h...@ibatis.apache.org

Reply via email to