Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 9820 invoked from network); 23 Mar 2010 06:29:01 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Mar 2010 06:29:01 -0000 Received: (qmail 58862 invoked by uid 500); 23 Mar 2010 06:29:00 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 58755 invoked by uid 500); 23 Mar 2010 06:29:00 -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 58745 invoked by uid 99); 23 Mar 2010 06:28:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Mar 2010 06:28:59 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of yuqianguo@gmail.com designates 209.85.216.198 as permitted sender) Received: from [209.85.216.198] (HELO mail-px0-f198.google.com) (209.85.216.198) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Mar 2010 06:28:53 +0000 Received: by pxi36 with SMTP id 36so1437296pxi.21 for ; Mon, 22 Mar 2010 23:28:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=RnDdVUrLDR/ucz0Mhm9XpQfs6UwjCmaX+YjnsggcPIU=; b=k9u9XOqmUi8PdEWyPD7GN1+xRwFkWitcKimpfMMSRBDqzDF9WoPqLwwjSz/oh2Riby 317R7XY94vuE2rL3aQABWiAMb/HMumxhSVKkQlhWYCndRSTdc369+ATB5BOVe+lbUJ/S KrTgc4EKPU+bEx2C/pRpkuw6bqo9GwSawpY5Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=g6FBTu7tTFiWIRUIOUPmeT/RBahtyZo3X43RFohuljv+NSEJ8UQoJ4Th8sRkNPE991 VzxvRGCq0vXVp8r5x4mYqusmt0FsuUC4R+UgKQQ5fVIbfuJx59qGiY2AjLC311g5nUR/ LbwK0Wsc0EPP4gQPF6tO9idmV6pC+1bdoYEWg= MIME-Version: 1.0 Received: by 10.115.134.32 with SMTP id l32mr435225wan.44.1269325712544; Mon, 22 Mar 2010 23:28:32 -0700 (PDT) In-Reply-To: References: <8bbd2311003222234j71efe3fel3603c129c67f9196@mail.gmail.com> Date: Tue, 23 Mar 2010 14:28:32 +0800 Message-ID: <8bbd2311003222328r5b153fc1l1f89cfc81e8d2b34@mail.gmail.com> Subject: Re: db2 -302 error From: joson yu To: user-java@ibatis.apache.org Content-Type: multipart/alternative; boundary=0016e64bea06335622048271ecc7 --0016e64bea06335622048271ecc7 Content-Type: text/plain; charset=ISO-8859-1 ok. i have got it. thank you. but i want ask one question more. the root of the problem is caused by JDBC or DB2. if i dont use a parameter marker when i use ibatis ,i think it is not a good idea for the security reason. or just catch the exception and ignore it? and can you give some advice for this situation. really thank you. 2010/3/23 Mario Ds Briggs > ok... i will try to explain 1 more time. > > In DB2, if you use a parameter marker in the SQL query, then DB2 WILL > 'constraint the paramter value to the db column length constraint'. If you > dont use a parameter marker, then DB2 will NOT 'constraint the value to the > db column length ' > > cheers > Mario > > > > > joson yu > com> To > user-java@ibatis.apache.org > 03/23/2010 11:04 cc > AM > Subject > Re: db2 -302 error > Please respond to > user-java@ibatis. > apache.org > > > > > > > > maybe i am not discribe clearly. > the parameter's length is longger than the column length .but the the same > sql. in the db2 client is fine,but use ibatis it throw exception. > the db constraint the column's lenth but don't constraint the condition > parameter's.but in ibatis ,it runs like it also constraint the parameter's. > > i don't know does i show the problem clear. > > > 2010/3/23 Mario Ds Briggs > Hi Joson, > > I guess you figured the error out yourself i.e. length of the parameter > value is > than the column length (30). It works fine in db2 client > since > there you are not using a parameter > marker but have value as a literal inside the SQL statement string. > > cheers > Mario joson yu com> > To user-java@ibatis.apache.org > 03/23/2010 07:44 > cc > AM > Subject Re: db2 -302 > error Please respond to > user-java@ibatis. apache.org > > > > > > > > ps:in the sql the parameter should passed in with String that is longger > than 30. > > 2010/3/23 joson yu there is an error happend in my > situation.and want to know is there anyone else meet this problem. i use > ibatis2. the database is used db2. sql: select [columns] from tables > where column1 = ''. and the column1 is varchar type and it's length is > 30. the sql is execute fine in the db2 client. but when i use ibatis > to execute it .it throw exception ,blow is all exception > info. org.springframework.dao.DataIntegrityViolationException: > SqlMapClient operation; SQL []; --- The error occurred > in com/hcss/fy/business/resource/ccr/model/HCSS_CCR_INFO_SqlMap.xml. --- > The error occurred while applying a parameter map. --- Check the > load_inheritor_baseinfo-InlineParameterMap. --- Check the statement > (query failed). --- Cause: com.ibm.db2.jcc.a.jm: DB2 SQL Error: > SQLCODE=-302, SQLSTATE=22001, SQLERRMC=null, DRIVER=3.50.151; nested > exception is com.ibatis.common.jdbc.exception.NestedSQLException: --- > The > error occurred > in com/hcss/fy/business/resource/ccr/model/HCSS_CCR_INFO_SqlMap.xml. --- > The error occurred while applying a parameter map. --- Check the > load_inheritor_baseinfo-InlineParameterMap. --- Check the statement > (query failed). --- Cause: com.ibm.db2.jcc.a.jm: DB2 SQL Error: > SQLCODE=-302, SQLSTATE=22001, SQLERRMC=null, DRIVER=3.50.151 > at > org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:114) > at > org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:322) > at > org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:212) > at > org.springframework.orm.ibatis.SqlMapClientTemplate.queryForObject(SqlMapClientTemplate.java:271) > at > com.hcss.fy.business.resource.ccr.dao.impl.InheritorDaoImpl.loadInheritor(InheritorDaoImpl.java:48) > at > com.hcss.fy.business.resource.ccr.dao.InheritorDaoTest.loadInheritor(InheritorDaoTest.java:57) > at > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at > java.lang.reflect.Method.invoke(Method.java:597) > at > org.springframework.test.context.junit4.SpringTestMethod.invoke(SpringTestMethod.java:160) > at > org.springframework.test.context.junit4.SpringMethodRoadie.runTestMethod(SpringMethodRoadie.java:233) > at > org.springframework.test.context.junit4.SpringMethodRoadie$RunBeforesThenTestThenAfters.run(SpringMethodRoadie.java:333) > at > org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie.java:217) > at > org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:197) > at > org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:143) > at > org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:160) > at > org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:59) > at > org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:52) > at > org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:34) > at > org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:44) > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org > For additional commands, e-mail: user-java-help@ibatis.apache.org > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org > For additional commands, e-mail: user-java-help@ibatis.apache.org > > --0016e64bea06335622048271ecc7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable ok. i have got it.=A0 thank you.
but i want ask one question more.
th= e root of the problem is caused by JDBC or DB2.
if i dont use a paramete= r marker=A0 when i use ibatis ,i think it is not a good idea for the securi= ty reason.=A0 or just catch the exception and ignore it?
and can you give some advice for this situation.

really thank you.

2010/3/23 Mario Ds Briggs <mari= o.briggs@in.ibm.com>
ok... i will try = to explain 1 more time.

In DB2, if you use a parameter marker in the SQL query, then DB2 =A0WILL 'constraint the paramter value to the db column length constraint'.= If you
dont use a parameter marker, then DB2 will NOT 'constraint the value to= the
db column length '

cheers
Mario




=A0 =A0 =A0 =A0 =A0 =A0 joson yu
=A0 =A0 =A0 =A0 =A0 =A0 <yuqianguo@gmail.
=A0 =A0 =A0 =A0 =A0 =A0 com> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 To
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 user-j= ava@ibatis.apache.org
=A0 =A0 =A0 =A0 =A0 =A0 03/23/2010 11:04 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 cc
=A0 =A0 =A0 =A0 =A0 =A0 AM
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Subject
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 Re: db2 -302 error
=A0 =A0 =A0 =A0 =A0 =A0 Please respond to
=A0 =A0 =A0 =A0 =A0 =A0 user-java@ibatis.
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0apache.org







maybe i am not discribe clearly.
the parameter's length is longger than the column length .but the the s= ame
sql.=A0 in the db2 client is fine,but use ibatis it throw exception.
the db constraint the column's lenth but don't constraint the=A0 co= ndition
parameter's.but in ibatis ,it runs like it also constraint the paramete= r's.

i don't know does i show the problem clear.


2010/3/23 Mario Ds Briggs <mario.briggs@in.ibm.com>
=A0Hi Joson,

=A0I guess you figured the error out yourself i.e. length of the parameter=
=A0value is > than the column length (30). =A0=A0It works fine in db2 c= lient since
=A0there you are not using a parameter
=A0marker but have value as a literal inside the SQL statement string.

=A0cheers
=A0Mario =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 joson yu =A0 =A0 =A0 =A0 =A0 =A0 = <yuqianguo@gmail.
=A0com>
=A0To =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 us= er-java@ibatis.apache.org
=A0=A0 =A0 =A0 =A0 =A0 =A0 03/23/2010 07:44
=A0cc
=A0AM
=A0Subject =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 Re: db2 -302
=A0error =A0 =A0 =A0 =A0 =A0 =A0 Please respond to
=A0user-java@ibatis. =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0apache.org







=A0ps:in the sql the parameter should passed in with String=A0 that is lon= gger
=A0than 30.

=A02010/3/23 joson yu <yuqianguo@gmail.com> =A0there is an error happend in my
=A0situation.and want to know is there =A0anyone else meet this problem. = =A0i use
=A0ibatis2.=A0 the database is used=A0 db2. =A0sql: select [columns] from= =A0 tables
=A0where column1 =3D ''. =A0and the column1 is varchar type and it= 's length is
=A030. =A0the sql is execute fine in the db2 client. but when i use ibatis=
=A0to =A0execute it .it throw exception ,blow is all exception
=A0info. =A0 =A0 =A0 =A0org.springframework.dao.DataIntegrityViolationExce= ption:
=A0SqlMapClient =A0operation; SQL []; =A0--- The error occurred
=A0in =A0com/hcss/fy/business/resource/ccr/model/HCSS_CCR_INFO_SqlMap.xml.= =A0---
=A0The error occurred while applying a parameter map. =A0--- Check the
=A0load_inheritor_baseinfo-InlineParameterMap. =A0--- Check the statement<= br> =A0(query failed). =A0--- Cause: com.ibm.db2.jcc.a.jm: DB2 SQL Error:
=A0SQLCODE=3D-302, =A0SQLSTATE=3D22001, SQLERRMC=3Dnull, DRIVER=3D3.50.151= ; nested
=A0exception is =A0com.ibatis.common.jdbc.exception.NestedSQLException: = =A0--- The
=A0error occurred
=A0in =A0com/hcss/fy/business/resource/ccr/model/HCSS_CCR_INFO_SqlMap.xml.= =A0---
=A0The error occurred while applying a parameter map. =A0--- Check the
=A0load_inheritor_baseinfo-InlineParameterMap. =A0--- Check the statement<= br> =A0(query failed). =A0--- Cause: com.ibm.db2.jcc.a.jm: DB2 SQL Error:
=A0SQLCODE=3D-302, =A0SQLSTATE=3D22001, SQLERRMC=3Dnull, DRIVER=3D3.50.151=
=A0at =A0org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.t= ranslate(SQLStateSQLExceptionTranslator.java:114) =A0=A0=A0 =A0at =A0org.sp= ringframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQL= ErrorCodeSQLExceptionTranslator.java:322) =A0=A0=A0 =A0at =A0org.springfram= ework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:212= ) =A0=A0=A0 =A0at =A0org.springframework.orm.ibatis.SqlMapClientTemplate.qu= eryForObject(SqlMapClientTemplate.java:271) =A0=A0=A0 =A0at =A0com.hcss.fy.= business.resource.ccr.dao.impl.InheritorDaoImpl.loadInheritor(InheritorDaoI= mpl.java:48) =A0=A0=A0 =A0at =A0com.hcss.fy.business.resource.ccr.dao.Inher= itorDaoTest.loadInheritor(InheritorDaoTest.java:57) =A0=A0=A0 =A0at
=A0sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
=A0at =A0sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorI= mpl.java:39) =A0=A0=A0 =A0at =A0sun.reflect.DelegatingMethodAccessorImpl.in= voke(DelegatingMethodAccessorImpl.java:25) =A0=A0=A0 =A0at
=A0java.lang.reflect.Method.invoke(Method.java:597)
=A0at =A0org.springframework.test.context.junit4.SpringTestMethod.invoke(S= pringTestMethod.java:160) =A0=A0=A0 =A0at =A0org.springframework.test.conte= xt.junit4.SpringMethodRoadie.runTestMethod(SpringMethodRoadie.java:233) =A0= =A0=A0 =A0at =A0org.springframework.test.context.junit4.SpringMethodRoadie$= RunBeforesThenTestThenAfters.run(SpringMethodRoadie.java:333) =A0=A0=A0 =A0= at =A0org.springframework.test.context.junit4.SpringMethodRoadie.runWithRep= etitions(SpringMethodRoadie.java:217) =A0=A0=A0 =A0at =A0org.springframewor= k.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:19= 7) =A0=A0=A0 =A0at =A0org.springframework.test.context.junit4.SpringMethodR= oadie.run(SpringMethodRoadie.java:143) =A0=A0=A0 =A0at =A0org.springframewo= rk.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit= 4ClassRunner.java:160) =A0=A0=A0 =A0at =A0org.junit.internal.runners.JUnit4= ClassRunner.runMethods(JUnit4ClassRunner.java:59) =A0=A0=A0 =A0at =A0org.ju= nit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:52) =A0= =A0=A0 =A0at =A0org.junit.internal.runners.ClassRoadie.runUnprotected(Class= Roadie.java:34) =A0=A0=A0 =A0at =A0org.junit.internal.runners.ClassRoadie.r= unProtected(ClassRoadie.java:44)




=A0--------------------------------------------------------------------- =A0To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org =A0For additional commands, e-mail: user-java-help@ibatis.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


--0016e64bea06335622048271ecc7--