Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 84016 invoked from network); 10 Oct 2006 07:10:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 Oct 2006 07:10:12 -0000 Received: (qmail 49413 invoked by uid 500); 10 Oct 2006 07:10:09 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 49308 invoked by uid 500); 10 Oct 2006 07:10:07 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 49297 invoked by uid 99); 10 Oct 2006 07:10:06 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Oct 2006 00:10:06 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [212.227.76.129] (HELO www.intland.com) (212.227.76.129) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Oct 2006 00:10:03 -0700 Received: (qmail 10809 invoked from network); 10 Oct 2006 09:09:39 +0200 Received: from p54a0e8ad.dip.t-dialin.net (HELO lat) (84.160.232.173) by p15187949.pureserver.info with (RC4-MD5 encrypted) SMTP; 10 Oct 2006 09:09:39 +0200 From: "Zsolt" To: Subject: RE: iBATIS with the embedded Derby JDBC driver Date: Tue, 10 Oct 2006 09:09:36 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01C0_01C6EC4B.CF53B630" X-Mailer: Microsoft Office Outlook, Build 11.0.6353 Thread-Index: Acbrr/Wp/Qj4AqWgQUyLMpv54brD4wAirc+w X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 In-Reply-To: X-Virus-Checked: Checked by ClamAV on apache.org Message-Id: <20061010071004.9372510FB012@asf.osuosl.org> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_01C0_01C6EC4B.CF53B630 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Thank you Jeff, Why is that necessary if I pass (java.lang.Integer)null? Zsolt _____ From: Jeff Butler [mailto:jeffgbutler@gmail.com] Sent: Monday, October 09, 2006 4:34 PM To: user-java@ibatis.apache.org Subject: Re: iBATIS with the embedded Derby JDBC driver If a column can be null, then you need to specify the JDBC type in the mapping. For example: insert into sometable (id, desc) values(#id:INTEGER#, #desc:VARCHAR#) This is true for all the DB2-like databases. Jeff Butler On 10/9/06, Zsolt wrote: Hi, Our product uses the services of iBATIS and we are using MySQL for the database layer. We recently tried out the Derby database engine and we were mainly successful. We have an issue though, which seems to be related to iBATIS. While things are under control with the networked Derby JDBC driver, the embedded Derby JDBC driver does not work and we systematically receive the following stack trace pattern: java.sql.SQLException: An attempt was made to get a data value of type 'VARCHAR' from a data value of type '0'. at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate (Ge neralStatement.java:91) Based on discussions with the Derby team, the problem seems to appear due to a misbehaving iBATIS call. More specifically, the java.sql.PreparedStatement.setNull(int parameterIndex, int sqlType) call seems to be always made with the sqlType argument being 0 instead of the type of the parameter. We are using iBATIS 2.1.7.597. We did not dive into the iBATIS source code but instead thought to ask here. Is this a known issue? Zsolt ------=_NextPart_000_01C0_01C6EC4B.CF53B630 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Thank you = Jeff,

 

Why is that = necessary if I pass (java.lang.Integer)null?

 =

Zsolt

 =


From: Jeff Butler [mailto:jeffgbutler@gmail.com]
Sent:
Monday, October 09, 2006 4:34 PM
To: user-java@ibatis.apache.org
Subject: Re: iBATIS with = the embedded Derby JDBC driver

 

If a column can be null, then you need to specify the JDBC type = in the mapping.  For example:

 

<insert ...>

  insert into sometable (id, = desc)

  values(#id:INTEGER#, = #desc:VARCHAR#)

</insert>
 

This is true for all the = DB2-like databases.

 

Jeff Butler

 


 

On 10/9/06, Zsolt <zkoppanylist@intland.com>= wrote:

Hi,

Our product uses the services of iBATIS and we are using MySQL for = the
database layer. We recently tried out the Derby database engine and we =
were mainly successful.

We have an issue though, which seems to be related to iBATIS. While
things are under control with the networked Derby JDBC driver, the
embedded Derby JDBC driver does not work and we systematically receive =
the following stack trace pattern:

java.sql.SQLException: An attempt was made to get a data value of = type
'VARCHAR' from a data value of type '0'.
   at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate= (Ge
neralStatement.java:91)

Based on discussions with the Derby team, the problem seems to = appear
due to a misbehaving iBATIS call. More specifically, the
java.sql.PreparedStatement.setNull(int parameterIndex, int sqlType)
call seems to be always made with the sqlType argument being 0 = instead
of the type of the parameter.

We are using iBATIS 2.1.7.597. We did not dive into the iBATIS = source
code but instead thought to ask here. Is this a known issue?

Zsolt

 

------=_NextPart_000_01C0_01C6EC4B.CF53B630--