Package org.springframework.jdbc.support
Class SQLErrorCodes
java.lang.Object
org.springframework.jdbc.support.SQLErrorCodes
JavaBean for holding JDBC error codes for a particular database.
Instances of this class are normally loaded through a bean factory.
Used by Spring's SQLErrorCodeSQLExceptionTranslator
.
The file "sql-error-codes.xml" in this package contains default
SQLErrorCodes
instances for various databases.
- Author:
- Thomas Risberg, Juergen Hoeller
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionString[]
String[]
String[]
String[]
String[]
String[]
String[]
String[]
String[]
String[]
String[]
boolean
void
setBadSqlGrammarCodes
(String... badSqlGrammarCodes) void
setCannotAcquireLockCodes
(String... cannotAcquireLockCodes) void
setCannotSerializeTransactionCodes
(String... cannotSerializeTransactionCodes) void
setCustomSqlExceptionTranslator
(SQLExceptionTranslator customSqlExceptionTranslator) void
setCustomSqlExceptionTranslatorClass
(Class<? extends SQLExceptionTranslator> customTranslatorClass) void
setCustomTranslations
(CustomSQLErrorCodesTranslation... customTranslations) void
setDataAccessResourceFailureCodes
(String... dataAccessResourceFailureCodes) void
setDatabaseProductName
(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
(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
(String... dataIntegrityViolationCodes) void
setDeadlockLoserCodes
(String... deadlockLoserCodes) void
setDuplicateKeyCodes
(String... duplicateKeyCodes) void
setInvalidResultSetAccessCodes
(String... invalidResultSetAccessCodes) void
setPermissionDeniedCodes
(String... permissionDeniedCodes) void
setTransientDataAccessResourceCodes
(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).
-
Constructor Details
-
SQLErrorCodes
public SQLErrorCodes()
-
-
Method Details
-
setDatabaseProductName
Set this property if the database name contains spaces, in which case we can not use the bean name for lookup. -
getDatabaseProductName
-
setDatabaseProductNames
Set this property to specify multiple database names that contains spaces, in which case we can not use bean names for lookup. -
getDatabaseProductNames
-
setUseSqlStateForTranslation
public 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). -
isUseSqlStateForTranslation
public boolean isUseSqlStateForTranslation() -
setBadSqlGrammarCodes
-
getBadSqlGrammarCodes
-
setInvalidResultSetAccessCodes
-
getInvalidResultSetAccessCodes
-
getDuplicateKeyCodes
-
setDuplicateKeyCodes
-
setDataIntegrityViolationCodes
-
getDataIntegrityViolationCodes
-
setPermissionDeniedCodes
-
getPermissionDeniedCodes
-
setDataAccessResourceFailureCodes
-
getDataAccessResourceFailureCodes
-
setTransientDataAccessResourceCodes
-
getTransientDataAccessResourceCodes
-
setCannotAcquireLockCodes
-
getCannotAcquireLockCodes
-
setDeadlockLoserCodes
-
getDeadlockLoserCodes
-
setCannotSerializeTransactionCodes
-
getCannotSerializeTransactionCodes
-
setCustomTranslations
-
getCustomTranslations
-
setCustomSqlExceptionTranslatorClass
public void setCustomSqlExceptionTranslatorClass(@Nullable Class<? extends SQLExceptionTranslator> customTranslatorClass) -
setCustomSqlExceptionTranslator
public void setCustomSqlExceptionTranslator(@Nullable SQLExceptionTranslator customSqlExceptionTranslator) -
getCustomSqlExceptionTranslator
-