/** * Set the database product name for this translator. * * <p>Setting this property will avoid obtaining a Connection from the DataSource to get the * metadata. * * @param dbName the database product name that identifies the error codes entry * @see SQLErrorCodesFactory#getErrorCodes(String) * @see java.sql.DatabaseMetaData#getDatabaseProductName() */ public void setDatabaseProductName(String dbName) { this.sqlErrorCodes = SQLErrorCodesFactory.getInstance().getErrorCodes(dbName); }
/** * Set the DataSource for this translator. * * <p>Setting this property will cause a Connection to be obtained from the DataSource to get the * metadata. * * @param dataSource DataSource to use to find metadata and establish which error codes are usable * @see SQLErrorCodesFactory#getErrorCodes(javax.sql.DataSource) * @see java.sql.DatabaseMetaData#getDatabaseProductName() */ public void setDataSource(DataSource dataSource) { this.sqlErrorCodes = SQLErrorCodesFactory.getInstance().getErrorCodes(dataSource); }