ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clinton Begin" <clinton.be...@gmail.com>
Subject Re: JDBC Type 0 not yet supported
Date Fri, 06 Jun 2008 12:17:44 GMT
I can assure you, it's not iBATIS doing that...  iBATIS does not translate
any values.  So your JDBC driver is the problem here, and it appears you've
found a way for iBATIS to solve it.  I've known other drivers to do the same
thing.  I belive NULL and '' are equal in Sybase/SQL Server as well...

Clinton

On Fri, Jun 6, 2008 at 3:50 AM, WhyDontYouSlide <whydontyouslide@gmail.com>
wrote:

>
> Hey all,
>
> I would like to share you guys this problem im getting constantly by using
> Ibatis via jdbc to do queries on DB2...
>
> Let's say we have written a simple query like this
>
> SELECT  PCT_SCO_MAX,
>       FROM    $schema$.FLES_PERC_SCO
>       WHERE   COD_COMPANY      = #codCompany#
>             AND  COD_SELLER     = #codSeller#
>
> the JDBC drivers via Ibatis framework CANNOT map a EMPTY STRING value into
> "codSeller"
> infact it maps "null"  as you can see in the log:
>
> DEBUG [java.sql.PreparedStatement]--<{pstm-105524} Parameters: [112, null]>
>
> but this way makes your query NOT fetch any results...
>
> So i've rounded the problem witha /dynamic TAG but this solution is not
> stylish ;-)
>
> <dynamic>
>               <isNotEmpty prepend="AND" property="codSeller">
>                       COD_SELLER     = #codTipoUnita#
>                </isNotEmpty>
>                <isEmpty prepend="AND" property="codSeller">
>                       COD_SELLER     = ' '
>                </isEmpty>
> </dynamic>
>
> someone got a better idea???
>
> thx
>
> WDYS
> --
> View this message in context:
> http://www.nabble.com/JDBC-Type-0-not-yet-supported-tp17688418p17688418.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

Mime
View raw message