Package com.softwaremining.sql
Interface DbFeatures
- All Known Implementing Classes:
DB2Features
public interface DbFeatures
CopyRight: SoftwareMining
database Specific Features
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Does the database allow automatic ID generation for a field ?int
generateKey
(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 ...int
getInsertedKey
(Statement statement) String[]
for SEEK we need to first get 1st record.boolean
SELECT xxx FROM TABLEboolean
Does the database support views ?
-
Field Details
-
ERROR_CODE__INVALID_DATE_FORMAT
static final int ERROR_CODE__INVALID_DATE_FORMAT- See Also:
-
LIKE_SYMBOL
- See Also:
-
-
Method Details
-
autoGeneratedKeySupported
boolean autoGeneratedKeySupported()Does the database allow automatic ID generation for a field ?- Returns:
-
generateKey
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 ...- Parameters:
keyName
- - Column-nametableName
- -connection
- -- Returns:
- Throws:
SQLException
-
getInsertedKey
- Parameters:
tableName
-connection
-- Returns:
- Throws:
SQLException
-
viewsSupported
boolean viewsSupported()Does the database support views ?- Returns:
-
lockingClause
String lockingClause()SELECT xxx FROM TABLEFOR UPDATE
- Returns:
- If the database does not support this feature then the method will throw an RunTime Exception Otherwise it will return " FOR UPDATE" .
-
isLockingSupported
boolean isLockingSupported() -
getTopRecordCriteria
String[] getTopRecordCriteria()for 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]- Returns:
-
getLikeSymbol
String getLikeSymbol()
-