• 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
Sheriff
Posts: 36031
432
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.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!