• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to display all SQLExceptions?  RSS feed

 
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: 2554
27
  • 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: 22204
38
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!