ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Gottschling <jo...@myndian.de>
Subject Re: How to custom database exception?
Date Sat, 29 Dec 2007 16:09:38 GMT
Hello,

> I'm new to iBatis, and wonder how to get custom data exception in 
> the web application.
> [...]
> Ps : I use Tapestry 5 + spring 2.5M + iBatis 2 + postgresql 8.3 beta + 
> tomcat 6.0.14 for evaluation.

As mentioned IBatis can not do this for you and I think it would also be 
the wrong place. You are using Spring. If you use Springs 
SqlMapClientDaoSupport to implement your DAOs the SqlMapClientTemplate 
will translate DBMS-specific Exception into a Spring-specific Exception. 
It think org.springframework.dao.DataIntegrityViolationException will be 
thrown. The Template uses a SQLExceptionTranslator to do that. You could 
implement your own if you like.

This may be an entry point:
<http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/jdbc/support/SQLExceptionTranslator.html>

Greetings and a happy new year,
   Jörg Gottschling

-- 
Jörg Gottschling
web:    http://www.myndian.de
eMail:  joerg@myndian.de
GnuPG:  0x9B1C64BB
ICQ:    177003788


Mime
View raw message