|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.jdbc.support.SQLErrorCodesFactory
Factory for creating SQLErrorCodes based on the "databaseProductName" taken from the DatabaseMetaData.
Returns SQLErrorCodes populated with vendor codes defined in a configuration file named "sql-error-codes.xml". Reads the default file in this package if not overridden by a file in the root of the classpath (e.g. in the "/WEB-INF/classes" directory).
DatabaseMetaData.getDatabaseProductName()
Field Summary | |
protected org.apache.commons.logging.Log |
logger
|
static java.lang.String |
SQL_ERROR_CODE_DEFAULT_PATH
Name of default SQL error code files, loading from the class path. |
static java.lang.String |
SQL_ERROR_CODE_OVERRIDE_PATH
Name of custom SQL error codes file, loading from the root of the class path (e.g. in the WEB-INF/classes directory). |
Constructor Summary | |
protected |
SQLErrorCodesFactory()
Not public to enforce Singleton design pattern. |
Method Summary | |
SQLErrorCodes |
getErrorCodes(javax.sql.DataSource ds)
Return SQLErrorCodes for the given DataSource, evaluating databaseProductName from DatabaseMetaData, or an empty error codes instance if no SQLErrorCodes were found. |
SQLErrorCodes |
getErrorCodes(java.lang.String dbName)
Return SQLErrorCodes instance for the given database. |
static SQLErrorCodesFactory |
getInstance()
Return singleton instance. |
protected Resource |
loadResource(java.lang.String path)
Protected for testability. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final org.apache.commons.logging.Log logger
public static final java.lang.String SQL_ERROR_CODE_OVERRIDE_PATH
public static final java.lang.String SQL_ERROR_CODE_DEFAULT_PATH
Constructor Detail |
protected SQLErrorCodesFactory()
Method Detail |
public static SQLErrorCodesFactory getInstance()
protected Resource loadResource(java.lang.String path)
path
- resource path. SQL_ERROR_CODE_DEFAULT_PATH or
SQL_ERROR_CODE_OVERRIDE_PATH.
Not to be overriden by application developers, who should obtain instances
of this class from the static getInstance() method.
public SQLErrorCodes getErrorCodes(javax.sql.DataSource ds)
DatabaseMetaData.getDatabaseProductName()
public SQLErrorCodes getErrorCodes(java.lang.String dbName)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |