If possible you can do what Nathan suggested.
Alternately you are getting a DataIntegrityViolationException (since u are
using spring) so you can catch that explicitly and handle however you want
- if u are always sure it is a 'query' i.e. readonly, ignore it if thats
what the higher level business use-case expects for such a scenario.
- u know that the supplied input value is not matching the DB
constraints, so report it back.
Mario
Nathan Maves
<nathan.ma...@gma
il.com> To
[email protected]
03/23/2010 01:18 cc
PM
Subject
Re: db2 -302 error
Please respond to
user-j...@ibatis.
apache.org
validate your data before you send it to IB. If you know that your column
is set to a max length of 30 then check that before you try and send it.
On Tue, Mar 23, 2010 at 12:28 AM, joson yu <[email protected]> wrote:
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 <[email protected]>
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 <yuqian...@gmail.
com>
To [email protected]
03/23/2010 11:04
cc
AM
Subject Re: db2 -302
error Please respond to
user-j...@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 <[email protected]>