Interface DbFeatures

All Known Implementing Classes:
DB2Features

public interface DbFeatures
CopyRight: SoftwareMining database Specific Features
  • Field Details

  • Method Details

    • autoGeneratedKeySupported

      boolean autoGeneratedKeySupported()
      Does the database allow automatic ID generation for a field ?
      Returns:
    • generateKey

      int generateKey(String keyName, String tableName, Connection connection) throws SQLException
      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-name
      tableName - -
      connection - -
      Returns:
      Throws:
      SQLException
    • getInsertedKey

      int getInsertedKey(Statement statement) throws SQLException
      Parameters:
      tableName -
      connection -
      Returns:
      Throws:
      SQLException
    • viewsSupported

      boolean viewsSupported()
      Does the database support views ?
      Returns:
    • lockingClause

      String lockingClause()
      SELECT xxx FROM TABLE

      FOR 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()