• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is SQLState inSQL Esxceptions?

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

SQLException.getSQLState retrieves the SQLState for the SQLException object. What are all the possible values that can be returned by this method?
Can I use the value to identify specific errors that ocured in the database (i.e. can this value tell me if it was a PK violation, or a unique constraint, or column value to large etc)?

Thanks
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SQL State is an error code. Oracle has a list of SQL State codes for their database.

And yes, it tells you about specific error types.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic