aspose file tools
The moose likes Object Relational Mapping and the fly likes Getting specific exception message with hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "Getting specific exception message with hibernate" Watch "Getting specific exception message with hibernate" New topic
Author

Getting specific exception message with hibernate

sameer joshi
Greenhorn

Joined: Jul 20, 2007
Posts: 1
Hi all i am working on one project in which we are using hibernate3 for database transactions.. proper mapping is done.. now when i try to insert any record in database which violates any relation it throws exception.. How to catch appropriate message of exception and get it in variable... i am finding it difficult as i am getting generic exception bellow save method of hibernate.. I tried catching it with GenericJDBCException and BatchUpdateException but it is not caught by them it is going in final catch block of normal Exception which does not give me specific error...

here is logger output...


thanks
 
 
subject: Getting specific exception message with hibernate
 
Threads others viewed
DB2 AS400 JDBC Driver
A Problem about Chinese
java.net.SocketException: Broken pipe
Hibernate @JoinColumns modifies the composite key
NullPointerException using Arrays.sort
IntelliJ Java IDE