• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to display all SQLExceptions?

 
Rajiv KumarRai
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If there is more than one exception in SQLException,
then how to go about displaying it?

Thanks
 
Dave Tolls
Ranch Hand
Posts: 2112
16
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Displaying it where?
Printing the stack trace will give you the chain of exceptions.
 
Rajiv KumarRai
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah we can know through stack trace. But I find a method
getNextException() in SQLException class.

I wanted to know what is the purpose of that method and how to use it?
 
Paul Clapham
Sheriff
Posts: 21588
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The API documentation for SQLException describes that like so:

a chain to a next Exception. This can be used to provide additional error information.


So, that's its purpose. Are you sure you can't figure out how to use the method? I mean, the usual way to use a method is to call it and do something with the result it returns.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic