ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brandon Goodin <brandon.goo...@gmail.com>
Subject Re: Problem with inlineParameterMap using DB2-Database
Date Wed, 08 Jun 2005 01:47:19 GMT
yes it should be possible. try simplifying the statement by removing
the <include> to see if it works. If it still fails you may want to
see what type the db field is and what type your java object property
is. The other thing it could be is a JDBC bug. So, you can simplify,
examine your fields to make sure they are converting correct and then
try the query using straight JDBC.

Brandon

On 6/6/05, Legler, Steffen <Steffen.Legler@rossmann.de> wrote:
> 
> Hi.
> 
> I am using iBATIS for mapping java objects to a DB2 database and a
> PostgreSQL-Database.
> 
> My sqlMap looks like this:
> 
> <sqlMap namespace="namespace1">
> 
>         <typeAlias alias="vo" type="org.company.PropertyType_VO"/>
> 
>         <resultMap id="map" class="vo">
>                 <result property="instanceId" column="instance"/>
>                 <result property="value" column="column1"/>
>         </resultMap>
> 
>         <sql id="where">
>                 where instance=#instanceId#
>         </sql>
> 
>         <select id="select" resultMap="map" resultClass="vo"
> parameterClass="vo">
>                 select #instanceId# as instance, column1 from schema.table1
> <include refid="where"/>
>         </select>
> 
> </sqlMap>
> 
> The sqlmap generates an sql-statement which should look like this.
> 
>         Select 12345 as instance, column1 from schema.table1 where
> instance=12345
> 
> Using the PostgreSQL-Database the mapping is OK an i get the right data from
> the database.
> 
> Using the DB2-database it throws the following exception:
> 
> Exception in thread "main"
> com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in org/company/ibatis/sql/db2/prop1.xml.
> --- The error occurred while applying a parameter map.
> --- Check the namespace1.select-InlineParameterMap.
> --- Check the parameter mapping for the 'instanceId' property.
> 
> Is it not possible in iBATIS and DB2 to use the same inline-Parameter in one
> statement?
> 
> Hope you can help me.
> 
> steffen
>

Mime
View raw message