File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Handling Different type of java.sql.SQLException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Handling Different type of java.sql.SQLException" Watch "Handling Different type of java.sql.SQLException" New topic

Handling Different type of java.sql.SQLException

Jay Shukla
Ranch Hand

Joined: Jun 08, 2008
Posts: 214
Hi All,

I need to handle sqlexcpetion and show the specific error message to the user, due to which perticular scenario this exception has been thrown.
Can anyone please help where would i get these information?

Thanks in Advance.
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46334
The SQLException class has methods which give you all that information. There are additional data in SQLException which are not available in ordinary Exceptions; you would have to check the documentation of the database you are using for their details.

This is not a "beginning Java™⅛ question, so I shall move it to our databases forum.
I agree. Here's the link:
subject: Handling Different type of java.sql.SQLException
It's not a secret anymore!