• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting specific exception message with hibernate

 
sameer joshi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!