Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 48953 invoked from network); 26 Apr 2006 16:22:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Apr 2006 16:22:41 -0000 Received: (qmail 32659 invoked by uid 500); 26 Apr 2006 16:22:36 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 32618 invoked by uid 500); 26 Apr 2006 16:22:36 -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 32588 invoked by uid 99); 26 Apr 2006 16:22:36 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Apr 2006 09:22:36 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of jeffgbutler@gmail.com designates 66.249.82.197 as permitted sender) Received: from [66.249.82.197] (HELO xproxy.gmail.com) (66.249.82.197) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Apr 2006 09:22:34 -0700 Received: by xproxy.gmail.com with SMTP id i31so1031047wxd for ; Wed, 26 Apr 2006 09:22:12 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=aSLm9D1q4eT1d+6IxIt8Np+49J4QWdJhHM2mDtJDOg16C4lCI/p5xSIh4mvF97zYy61QP3s9gw4eD3uaMMpXFiJCjyoSaOqCAvcoIFmWZiq5CeSYfYfgn/bJWh0w9t8IfUSNJTpJp1Z5tqWOCG3ToSqxJUbpWH4g/jOMe4sooTQ= Received: by 10.70.117.15 with SMTP id p15mr3822739wxc; Wed, 26 Apr 2006 09:22:11 -0700 (PDT) Received: by 10.70.72.13 with HTTP; Wed, 26 Apr 2006 09:22:11 -0700 (PDT) Message-ID: Date: Wed, 26 Apr 2006 12:22:11 -0400 From: "Jeff Butler" To: user-java@ibatis.apache.org Subject: Re: Update Statement Error ? In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_8437_21288588.1146068531918" References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_8437_21288588.1146068531918 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline There is no iBATIS issue with NULL. But in general with nulls, you need to change your mapping to let iBATIS know about the dataype. For example: first_name =3D #firstName:VARCHAR#, last_name =3D #lastName:VARCHAR#, phone =3D #phone:VARCHAR#, fax =3D #fax:VARCHAR#, e_mail =3D #email:VARCHAR#, location =3D #location:VARCHAR#, address1 =3D #address1:VARCHAR#, address2 =3D #address2:VARCHAR#, city =3D #city:VARCHAR#, state =3D #state:VARCHAR#, zip =3D #zip:VARCHAR#, password =3D #password:VARCHAR#, password_last_updated =3D #password_last_updated:VARCHAR# WHERE user_id =3D #userId:INTEGER# (Note: use your actual datatypes, I'm just guessing) Jeff Butler On 4/26/06, Ali, Mohammed (Liquidity & Risk Technology) wrote: > > Hi All, > I ran the update sql outside with the same values and no issues. > > I have "null" data values in updates as column allows NULLS for VARCHAR. = I > think it is giving error on "null" data. > > Is there an issue in IBATIS with null data updating in Varchar field? > > Thanks, > Ali > (201) 671-5499 > > -----Original Message----- > From: larry.meadors@gmail.com [*mailto:larry.meadors@gmail.com*] > On Behalf Of Larry Meadors > Sent: Wednesday, April 26, 2006 11:08 AM > To: user-java@ibatis.apache.org; Balaji > Subject: Re: Update Statement Error ? > > Another quick-n-dirty way to find these (if you have a unit test) is > to remove columns from the update until it works. The last one you > removed is the problem. > > Larry > > On 4/26/06, Balaji wrote: > > > > Ali, > > > > It could be because of null value(s) in password date etc. Check the > > datatype & acceptable value for fields in db table vs the dto. Execute > the > > SQL outside ibatis (winsql, plsql etc) with the values you are passing > when > > this error is occuring. That should give you a better error message. > > > > > > Balaji > > > > > > > > ----- Original Message ----- > > From: Ali, Mohammed (Liquidity & Risk Technology) > > To: user-java@ibatis.apache.org > > Sent: Wednesday, April 26, 2006 9:25 AM > > Subject: Update Statement Error ? > > > > > > > > > > Hi All, > > I am getting the following error when calling an Update. I can see > UserDTO > > is passes properly with data. May be declaration is not right ? > > > > Error > > com.ibatis.common.jdbc.exception.NestedSQLException: > > --- The error occurred in > > com/ml/camsweb/resources/User.xml. > > --- The error occurred while applying a parameter map. > > --- Check the update-InlineParameterMap. > > --- Check the statement (update failed). > > --- Cause: java.sql.SQLException: JZ006: Caught IOException: > > java.io.IOException: JZ0SL: Unsupported SQL type 0. > > Caused by: java.sql.SQLException: JZ006: Caught IOException: > > java.io.IOException: JZ0SL: Unsupported SQL type 0. > > > > Update > > public void update(UserDTO userDTO) throws SQLException { > > try { > > sqlMapCams.startTransaction(); > > sqlMapCams.update("update",userDTO); > > sqlMapCams.commitTransaction(); > > } finally{ > > sqlMapCams.endTransaction(); > > } > > } > > > > User.XML > > > > > > > > UPDATE users > > SET > > first_name =3D #firstName#, > > last_name =3D #lastName#, > > phone =3D #phone#, > > fax =3D #fax#, > > e_mail =3D #email#, > > location =3D #location#, > > address1 =3D #address1#, > > address2 =3D #address2#, > > city =3D #city#, > > state =3D #state#, > > zip =3D #zip#, > > password =3D #password#, > > password_last_updated =3D #password_last_updated# > > WHERE user_id =3D #userId# > > > > > > > > Thanks, > > Ali > > (201) 671-5499 > > ________________________________ > > > > If you are not an intended recipient of this e-mail, please notify the > > sender, delete it and do not read, act upon, print, disclose, copy, > retain > > or redistribute it. Click here for important additional terms relating > to > > this e-mail. *http://www.ml.com/email_terms/* > > ________________________________ > > > ------------------------------ > If you are not an intended recipient of this e-mail, please notify the > sender, delete it and do not read, act upon, print, disclose, copy, retai= n > or redistribute it. Click here for > important additional terms relating to this e-mail. > http://www.ml.com/email_terms/ > ------------------------------ > ------=_Part_8437_21288588.1146068531918 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
There is no iBATIS issue with NULL.  But in general with nulls, y= ou need to change your mapping to let iBATIS know about the dataype.  = For example:
 
first_name =3D #firstName:VARCHAR#,
     =    last_name =3D #lastName:VARCHAR#,
    =     phone =3D #phone:VARCHAR#,
    &= nbsp;   fax =3D #fax:VARCHAR#,
     =    e_mail =3D #email:VARCHAR#,
     =    location =3D #location:VARCHAR#,=20
        address1 =3D #address1:VARCH= AR#,
        address2 =3D #address2:= VARCHAR#,
        city =3D #city:VAR= CHAR#,
        state =3D #state:VARC= HAR#,
        zip =3D #zip:VARCHAR#,=
        password =3D #password:VARC= HAR#,=20
            = ;    password_last_updated =3D #password_last_updated:VARCHA= R#
        WHERE user_id =3D #userId= :INTEGER#
 
(Note: use your actual datatypes, I'm just guessing)
 
Jeff Butler

 
On 4/26/06, = Ali, Mohammed (Liquidity & Risk Technology) <Mohammed_Ali@ml.com> wrote:

Hi All,
I ran the updat= e sql outside with the same values and no issues.

I have "null&q= uot; data values in updates as column allows NULLS for VARCHAR. I think it = is giving error on "null" data.

Is there an issue i= n IBATIS with null data updating in Varchar field?

Thanks,
Ali
(201) 671-5499<= /font>


-----Original Messa= ge-----
From: larry.meadors@gmail.com [ mailto:larry.meadors@gmail.com] On Behalf Of Larry Meadors
Sent: Wednesday, Apr= il 26, 2006 11:08 AM
To:= user-java@ibatis.apache.org= ; Balaji
Sub= ject: Re: Update Statement Error ?


Another quick-n-dir= ty way to find these (if you have a unit test) is
to remove columns from the up= date until it works. The last one you
rem= oved is the problem.

Larry=


On 4/26/06, Balaji = <balaji@objectec.com> wrot= e:
>
> Ali,=
>= ;
> It could be = because of null value(s) in password date etc. Check the
= > datatype & ac= ceptable value for fields in db table vs the dto.  Execute the
>= ; SQL outside ibatis (winsql, plsql etc) with the values you are passing wh= en
&= gt; this error is occuring.  That should give you a better error messa= ge.
>= ;
&g= t;
&= gt; Balaji
>
>
>
> ----- Original Me= ssage -----
> From: Ali, Mohammed (Liquidity & Risk Technology)
> To: user-java@ibatis.apache.org
> Sent: Wednesday, = April 26, 2006 9:25 AM
> Subject: Update Statement Error ? >
>
>
>
> Hi All,
> I am getting the following error when calling an Update. I c= an see UserDTO
>= ; is passes properly with data. May be declaration is not right ?
>
> Error
> com.ibatis= .common.jdbc.exception.NestedSQLException:
> --- The error occurred in
> com/ml/camsweb/resources/User.xml.

> --- The= error occurred while applying a parameter map.
>= ; --- Check the update-InlineParameterMap.
> --- Check the statement (update= failed).
>= ; --- Cause: java.sql.SQLException: JZ006: Caught IOException:
> java.io.IOE= xception : JZ0SL: Unsupported SQL type 0.
> Caused by: java.sql.SQLException: JZ006: = Caught IOException:

> java.io.IOException: JZ0SL: Unsupported SQL type 0.
= > > Update
> public void updat= e(UserDTO userDTO) throws SQLException {
>     &nbs= p;            &= nbsp;      try {
>  &= nbsp;           &nbs= p;            &= nbsp;     sqlMapCams.startTransaction(); =
>  &n= bsp;            = ;            &n= bsp;    =20 sqlMapCams.update("update",userDTO);
>    &nbs= p;            &= nbsp;           &nbs= p;   sqlMapCams.commitTransaction();
>            = ;             }= finally{
>          &nbs= p;            &= nbsp;         sqlMapCams.endTransac= tion();
>            = ;             }=
>= ;            &n= bsp;    }
>
> User.XML
> <typeAlias alias=3D"= ;UserObject" type=3D"com.ml.camsweb.dto.UserDTO"/>=
> > <update id=3D= "update" parameterClass=3D"UserObject">
>      &nb= sp;  UPDATE users
>         SET=
>= ;         first_name =3D #firstName= #,
>= ;         last_name =3D #lastName#,=
>= ;         phone =3D #phone#,=
>      &nb= sp;  fax =3D #fax#,
>         = e_mail =3D #email#,
>         locati= on =3D #location#,
>= ;         address1 =3D #address1#,<= /font>
>=          address2 =3D #address2#,
>   =       city =3D #city#,
>    &nb= sp;    state =3D #state#,
>         zip =3D #zip#,<= /span>
> &= nbsp;       password =3D #password#,
> &n= bsp;            = ;   password_last_updated =3D #password_last_updated#
>= ;         WHERE user_id =3D #userId= #
&g= t;     </update>
>
>
> Thanks,
> Ali
> (201) 671-5499
>  ________________________________
>
> If you are not an intended recipient = of this e-mail, please notify the
> sender, delete it and do not read, act upon, print, disclose, copy, re= tain

> or redistribute it. Click here for important additional terms relatin= g to
>= ; this e-mail.     http://www.ml.com/emai= l_terms/
>  _____________________= ___________
>


If you are not an intended recipient of this e-mail, please notify the= sender, delete it and do not read, act upon, print, disclose, copy, retain= or redistribute it. Click here for important additional terms relating to this e-mail. = ;    http://www.m= l.com/email_terms/


------=_Part_8437_21288588.1146068531918--