java.sql.SQLException offers an int getErrorCode() function so the program can know what in particular has happened to cause the exception. Any cha
java.sql.SQLException
int getErrorCode()
They're available in the MySQL documentation.