org.springframework.jdbc.support
Class SQLErrorCodes

java.lang.Object
  extended byorg.springframework.jdbc.support.SQLErrorCodes

public class SQLErrorCodes
extends Object

JavaBean for holding JDBC error codes for a particular database. Normally loaded through a BeanFactory implementation. Used by the SQLErrorCodeSQLExceptionTranslator.

Author:
Thomas Risberg
See Also:
SQLErrorCodeSQLExceptionTranslator, SQLErrorCodesFactory

Constructor Summary
SQLErrorCodes()
           
 
Method Summary
 String[] getBadSqlGrammarCodes()
           
 String[] getCannotAcquireLockCodes()
           
 List getCustomTranslations()
           
 String[] getDataAccessResourceFailureCodes()
           
 String getDatabaseProductName()
           
 String[] getDatabaseProductNames()
           
 String[] getDataIntegrityViolationCodes()
           
 String[] getDataRetrievalFailureCodes()
           
 String[] getOptimisticLockingFailureCodes()
           
 boolean isUseSqlStateForTranslation()
           
 void setBadSqlGrammarCodes(String[] badSqlGrammarCodes)
           
 void setCannotAcquireLockCodes(String[] cannotAcquireLockCodes)
           
 void setCustomTranslations(List 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 setDataRetrievalFailureCodes(String[] dataRetrievalFailureCodes)
           
 void setOptimisticLockingFailureCodes(String[] optimisticLockingFailureCodes)
           
 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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLErrorCodes

public SQLErrorCodes()
Method Detail

setDatabaseProductName

public 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.


getDatabaseProductName

public String getDatabaseProductName()

setDatabaseProductNames

public 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.


getDatabaseProductNames

public String[] 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

public void setBadSqlGrammarCodes(String[] badSqlGrammarCodes)

getBadSqlGrammarCodes

public String[] getBadSqlGrammarCodes()

setDataIntegrityViolationCodes

public void setDataIntegrityViolationCodes(String[] dataIntegrityViolationCodes)

getDataIntegrityViolationCodes

public String[] getDataIntegrityViolationCodes()

setDataRetrievalFailureCodes

public void setDataRetrievalFailureCodes(String[] dataRetrievalFailureCodes)

getDataRetrievalFailureCodes

public String[] getDataRetrievalFailureCodes()

setOptimisticLockingFailureCodes

public void setOptimisticLockingFailureCodes(String[] optimisticLockingFailureCodes)

getOptimisticLockingFailureCodes

public String[] getOptimisticLockingFailureCodes()

setCannotAcquireLockCodes

public void setCannotAcquireLockCodes(String[] cannotAcquireLockCodes)

getCannotAcquireLockCodes

public String[] getCannotAcquireLockCodes()

setDataAccessResourceFailureCodes

public void setDataAccessResourceFailureCodes(String[] dataAccessResourceFailureCodes)

getDataAccessResourceFailureCodes

public String[] getDataAccessResourceFailureCodes()

setCustomTranslations

public void setCustomTranslations(List customTranslations)
Parameters:
customTranslations - List of CustomSQLErrorCodesTranslation objects
See Also:
CustomSQLErrorCodesTranslation

getCustomTranslations

public List getCustomTranslations()
Returns:
List of CustomSQLErrorCodesTranslation objects
See Also:
CustomSQLErrorCodesTranslation


Copyright (C) 2003-2004 The Spring Framework Project.