ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "yuan gogo" <gogoy...@gmail.com>
Subject How to custom database exception?
Date Sat, 29 Dec 2007 05:59:36 GMT
Hi, all.
    I'm new to iBatis, and wonder how to get custom data exception in the
web application.

   Say, I have a database table Users (id, username, password), the username
is UNIQUE.
   While insert new user data with a duplicated username , a data exception
will be thrown from jdbc indicate constraint conflict on some datafileds.
But I personally think throw a custom exception like
UsernameExistedException will be a better way for other layer to log or
notify user.

   How can I do it?

Ps : I use Tapestry 5 + spring 2.5M + iBatis 2 + postgresql 8.3 beta +
tomcat 6.0.14 for evaluation.

Thanks!

gogoyuan [_at_] gmail.com

Mime
View raw message