ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From WhyDontYouSlide <whydontyousl...@gmail.com>
Subject JDBC Type 0 not yet supported
Date Fri, 06 Jun 2008 09:50:17 GMT

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