Class AbstractSql2003Backend

All Implemented Interfaces:
Backend
Direct Known Subclasses:
AbstractSql2008Backend, Db2, MsSql, Oracle8

public abstract class AbstractSql2003Backend extends AbstractSql92Backend
Common to all SQL2003 backends.
Author:
harald
  • Field Details

    • SQL_WINDOW_1

      public static final String SQL_WINDOW_1
      window function part 1.
      See Also:
    • SQL_WINDOW_2

      public static final String SQL_WINDOW_2
      window function part 2.
      See Also:
    • SQL_WINDOW_LIMIT

      public static final String SQL_WINDOW_LIMIT
      condition for limit and offset.
      See Also:
    • SQL_WINDOW_OFFSET

      public static final String SQL_WINDOW_OFFSET
      condition for limit and offset.
      See Also:
    • RESERVED_WORDS_SQL2003

      public static final String[] RESERVED_WORDS_SQL2003
      array of additional reserved words.
  • Constructor Details

    • AbstractSql2003Backend

      public AbstractSql2003Backend()
      Parent constructor.
  • Method Details

    • getReservedWords

      public Set<String> getReservedWords()
      Description copied from interface: Backend
      Gets the list of reserved words for this backend.
      Specified by:
      getReservedWords in interface Backend
      Overrides:
      getReservedWords in class AbstractSql92Backend
      Returns:
      the set of reserved words
    • buildSelectSql

      public void buildSelectSql(StringBuilder sqlBuilder, boolean writeLock, int limit, int offset)
      Description copied from interface: Backend
      Creates a select statement string from an inner sql string.

      sqlBuilder is anything as [SELECT] FROM... WHERE... ORDER BY....
      It is decorated with a leading SELECT, if missing, plus optional clauses like for the given parameters.

      Specified by:
      buildSelectSql in interface Backend
      Overrides:
      buildSelectSql in class AbstractSql92Backend
      Parameters:
      sqlBuilder - the sql builder, initially containing the inner sql without leading SELECT.
      writeLock - true select should write lock
      limit - the limit value, ≤ 0 if no limit clause
      offset - the offset value, ≤ 0 if no offset clause
    • setLeadingSelectParameters

      public int setLeadingSelectParameters(BackendPreparedStatement stmt, int limit, int offset)
      Description copied from interface: Backend
      Sets optional parameters before applying the original parameters.
      Specified by:
      setLeadingSelectParameters in interface Backend
      Overrides:
      setLeadingSelectParameters in class AbstractSql92Backend
      Parameters:
      stmt - the prepared statement
      limit - the limit value, ≤ 0 if no limit clause
      offset - the offset value, ≤ 0 if no offset clause
      Returns:
      the next parameter index
    • setTrailingSelectParameters

      public int setTrailingSelectParameters(BackendPreparedStatement stmt, int index, int limit, int offset)
      Description copied from interface: Backend
      Sets optional parameters after applying the original parameters.
      Specified by:
      setTrailingSelectParameters in interface Backend
      Overrides:
      setTrailingSelectParameters in class AbstractSql92Backend
      Parameters:
      stmt - the prepared statement
      index - the first parameter index
      limit - the limit value, ≤ 0 if no limit clause
      offset - the offset value, ≤ 0 if no offset clause
      Returns:
      the next parameter index
    • isSequenceSupported

      public boolean isSequenceSupported()
      Description copied from interface: Backend
      True if backend provides locking-free sequences.
      Sequences must not take part in transactions, i.e. no read- or write-locks!
      Specified by:
      isSequenceSupported in interface Backend
      Overrides:
      isSequenceSupported in class AbstractSql92Backend
      Returns:
      true if database supports sequences
    • sqlCreateSequence

      public String sqlCreateSequence(String name, Long start, Long increment)
      Description copied from interface: Backend
      Creates the SQL string to create a sequence.
      Specified by:
      sqlCreateSequence in interface Backend
      Overrides:
      sqlCreateSequence in class AbstractSql92Backend
      Parameters:
      name - the sequence name
      start - the optional start value, defaults to 1
      increment - the optional increment, defaults to 1
      Returns:
      the SQL code
    • sqlNextFromSequence

      public String sqlNextFromSequence(String name)
      Description copied from interface: Backend
      Creates the SQL string to retrieve the next id from a sequence.
      Specified by:
      sqlNextFromSequence in interface Backend
      Overrides:
      sqlNextFromSequence in class AbstractSql92Backend
      Parameters:
      name - the name of the sequence
      Returns:
      the SQL code