Package org.springframework.jdbc.support
Class CustomSQLErrorCodesTranslation
- java.lang.Object
- org.springframework.jdbc.support.CustomSQLErrorCodesTranslation
public class CustomSQLErrorCodesTranslation extends Object
JavaBean for holding custom JDBC error codes translation for a particular database. The "exceptionClass" property defines which exception will be thrown for the list of error codes specified in the errorCodes property.- Since:
- 1.1
- Author:
- Thomas Risberg
- See Also:
SQLErrorCodeSQLExceptionTranslator
Constructor Summary
Constructors Constructor Description CustomSQLErrorCodesTranslation()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]
getErrorCodes()
Return the SQL error codes to match.Class<?>
getExceptionClass()
Return the exception class for the specified error codes.void
setErrorCodes(String... errorCodes)
Set the SQL error codes to match.void
setExceptionClass(Class<?> exceptionClass)
Set the exception class for the specified error codes.
Constructor Detail
CustomSQLErrorCodesTranslation
public CustomSQLErrorCodesTranslation()
Method Detail
setErrorCodes
public void setErrorCodes(String... errorCodes)
Set the SQL error codes to match.
getErrorCodes
public String[] getErrorCodes()
Return the SQL error codes to match.
setExceptionClass
public void setExceptionClass(@Nullable Class<?> exceptionClass)
Set the exception class for the specified error codes.
getExceptionClass
@Nullable public Class<?> getExceptionClass()
Return the exception class for the specified error codes.