Package com.softwaremining.sql
Class DB2Features
java.lang.Object
com.softwaremining.sql.DB2Features
- All Implemented Interfaces:
DbFeatures
DB2 Specific Features
-
Field Summary
Fields inherited from interface com.softwaremining.sql.DbFeatures
ERROR_CODE__INVALID_DATE_FORMAT, LIKE_SYMBOL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDB2 Supports AutoGenreated KeysintgenerateKey(String keyName, String tableName, Connection connection) When a database does not allow autoGeneration of ID's - then the system will use this method to find the latest key - or generate it from a table, or key generator ...intgetInsertedKey(Statement _statement) DB2 supports retrieving autogenerated key as IDENTITY_VAL_LOCAL()'%' is used in most database as the Like-SymbolString[]for SEEK we need to first get 1st record.booleanSELECT xxx FROM TABLEbooleanDoes the database support views ?
-
Constructor Details
-
DB2Features
public DB2Features()
-
-
Method Details
-
autoGeneratedKeySupported
public boolean autoGeneratedKeySupported()DB2 Supports AutoGenreated Keys- Specified by:
autoGeneratedKeySupportedin interfaceDbFeatures- Returns:
-
generateKey
Description copied from interface:DbFeaturesWhen a database does not allow autoGeneration of ID's - then the system will use this method to find the latest key - or generate it from a table, or key generator ...- Specified by:
generateKeyin interfaceDbFeatures- Parameters:
keyName- - Column-nametableName- -connection- -- Returns:
- Throws:
SQLException
-
getInsertedKey
DB2 supports retrieving autogenerated key as IDENTITY_VAL_LOCAL()- Specified by:
getInsertedKeyin interfaceDbFeatures- Returns:
- Throws:
SQLException
-
viewsSupported
public boolean viewsSupported()Description copied from interface:DbFeaturesDoes the database support views ?- Specified by:
viewsSupportedin interfaceDbFeatures- Returns:
- See Also:
-
lockingClause
Description copied from interface:DbFeaturesSELECT xxx FROM TABLEFOR UPDATE
- Specified by:
lockingClausein interfaceDbFeatures- Returns:
- If the database does not support this feature then the method will throw an RunTime Exception Otherwise it will return " FOR UPDATE" .
- See Also:
-
isLockingSupported
public boolean isLockingSupported()- Specified by:
isLockingSupportedin interfaceDbFeatures
-
getTopRecordCriteria
Description copied from interface:DbFeaturesfor SEEK we need to first get 1st record. In order to make sure we get only 1 record (rather than millions) we can use the following in SQLSever: select [TOP 1] * from table WHERE ... MySQL : select * from table [LIMIT 1] WHERE ... ORACLE : select * from table WHERE ... [rownum = 1] DB2 : select * from table WHERE ... [FETCH FIRST ROW ONLY]- Specified by:
getTopRecordCriteriain interfaceDbFeatures- Returns:
-
getLikeSymbol
'%' is used in most database as the Like-Symbol- Specified by:
getLikeSymbolin interfaceDbFeatures
-