title: What are all the possible values for SQLException.getSQLState?
body: <p><code>SQLException.getSQLState</code> retrieves the <code>SQLState</code> for the <code>SQLException</code> object. What are all the possible values that can be returned by this method? Can I use the value to identify specific errors that occurred in the database (i.e. can this value tell me if it was a PK violation, or a unique constraint, or column value too large, etc.)?</p>
  <p>Also, the <code>DatabaseMetaData.getSQLStateType()</code> method is supposed to indicate whether the <code>SQLSTATE</code> returned by <code>SQLException.getSQLState</code> is X/Open (now known as Open Group) SQL CLI or SQL99. The only possible value for this should be <code>DatabaseMetaData.sqlStateXOpen == 1</code> and <code>DatabaseMetaData.sqlStateSQL99 == 2</code> but I am getting the value <code>0</code>. Am I missing something?</p>
  <p>Is there a way that I can determine the specific type of error that occurred in the DB using combinations from the above mentioned methods? Can I count on the values of <code>SQLException.getSQLState</code>? Are these values different from DB provider to DB provider?</p>