public class SQLErrorCodes
extends java.lang.Object
Used by Spring's SQLErrorCodeSQLExceptionTranslator
.
The file "sql-error-codes.xml" in this package contains default
SQLErrorCodes
instances for various databases.
SQLErrorCodesFactory
,
SQLErrorCodeSQLExceptionTranslator
Constructor and Description |
---|
SQLErrorCodes() |
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
getBadSqlGrammarCodes() |
java.lang.String[] |
getCannotAcquireLockCodes() |
java.lang.String[] |
getCannotSerializeTransactionCodes() |
SQLExceptionTranslator |
getCustomSqlExceptionTranslator() |
CustomSQLErrorCodesTranslation[] |
getCustomTranslations() |
java.lang.String[] |
getDataAccessResourceFailureCodes() |
java.lang.String |
getDatabaseProductName() |
java.lang.String[] |
getDatabaseProductNames() |
java.lang.String[] |
getDataIntegrityViolationCodes() |
java.lang.String[] |
getDeadlockLoserCodes() |
java.lang.String[] |
getDuplicateKeyCodes() |
java.lang.String[] |
getInvalidResultSetAccessCodes() |
java.lang.String[] |
getPermissionDeniedCodes() |
java.lang.String[] |
getTransientDataAccessResourceCodes() |
boolean |
isUseSqlStateForTranslation() |
void |
setBadSqlGrammarCodes(java.lang.String... badSqlGrammarCodes) |
void |
setCannotAcquireLockCodes(java.lang.String... cannotAcquireLockCodes) |
void |
setCannotSerializeTransactionCodes(java.lang.String... cannotSerializeTransactionCodes) |
void |
setCustomSqlExceptionTranslator(SQLExceptionTranslator customSqlExceptionTranslator) |
void |
setCustomSqlExceptionTranslatorClass(java.lang.Class<? extends SQLExceptionTranslator> customTranslatorClass) |
void |
setCustomTranslations(CustomSQLErrorCodesTranslation... customTranslations) |
void |
setDataAccessResourceFailureCodes(java.lang.String... dataAccessResourceFailureCodes) |
void |
setDatabaseProductName(java.lang.String databaseProductName)
Set this property if the database name contains spaces,
in which case we can not use the bean name for lookup.
|
void |
setDatabaseProductNames(java.lang.String... databaseProductNames)
Set this property to specify multiple database names that contains spaces,
in which case we can not use bean names for lookup.
|
void |
setDataIntegrityViolationCodes(java.lang.String... dataIntegrityViolationCodes) |
void |
setDeadlockLoserCodes(java.lang.String... deadlockLoserCodes) |
void |
setDuplicateKeyCodes(java.lang.String... duplicateKeyCodes) |
void |
setInvalidResultSetAccessCodes(java.lang.String... invalidResultSetAccessCodes) |
void |
setPermissionDeniedCodes(java.lang.String... permissionDeniedCodes) |
void |
setTransientDataAccessResourceCodes(java.lang.String... transientDataAccessResourceCodes) |
void |
setUseSqlStateForTranslation(boolean useStateCodeForTranslation)
Set this property to true for databases that do not provide an error code
but that do provide SQL State (this includes PostgreSQL).
|
public void setDatabaseProductName(java.lang.String databaseProductName)
public java.lang.String getDatabaseProductName()
public void setDatabaseProductNames(java.lang.String... databaseProductNames)
public java.lang.String[] getDatabaseProductNames()
public void setUseSqlStateForTranslation(boolean useStateCodeForTranslation)
public boolean isUseSqlStateForTranslation()
public void setBadSqlGrammarCodes(java.lang.String... badSqlGrammarCodes)
public java.lang.String[] getBadSqlGrammarCodes()
public void setInvalidResultSetAccessCodes(java.lang.String... invalidResultSetAccessCodes)
public java.lang.String[] getInvalidResultSetAccessCodes()
public java.lang.String[] getDuplicateKeyCodes()
public void setDuplicateKeyCodes(java.lang.String... duplicateKeyCodes)
public void setDataIntegrityViolationCodes(java.lang.String... dataIntegrityViolationCodes)
public java.lang.String[] getDataIntegrityViolationCodes()
public void setPermissionDeniedCodes(java.lang.String... permissionDeniedCodes)
public java.lang.String[] getPermissionDeniedCodes()
public void setDataAccessResourceFailureCodes(java.lang.String... dataAccessResourceFailureCodes)
public java.lang.String[] getDataAccessResourceFailureCodes()
public void setTransientDataAccessResourceCodes(java.lang.String... transientDataAccessResourceCodes)
public java.lang.String[] getTransientDataAccessResourceCodes()
public void setCannotAcquireLockCodes(java.lang.String... cannotAcquireLockCodes)
public java.lang.String[] getCannotAcquireLockCodes()
public void setDeadlockLoserCodes(java.lang.String... deadlockLoserCodes)
public java.lang.String[] getDeadlockLoserCodes()
public void setCannotSerializeTransactionCodes(java.lang.String... cannotSerializeTransactionCodes)
public java.lang.String[] getCannotSerializeTransactionCodes()
public void setCustomTranslations(CustomSQLErrorCodesTranslation... customTranslations)
public CustomSQLErrorCodesTranslation[] getCustomTranslations()
public void setCustomSqlExceptionTranslatorClass(java.lang.Class<? extends SQLExceptionTranslator> customTranslatorClass)
public void setCustomSqlExceptionTranslator(SQLExceptionTranslator customSqlExceptionTranslator)
public SQLExceptionTranslator getCustomSqlExceptionTranslator()