de.esprit.appsuite.database.dbase.rdbms

## Class RdbmsSupport

- java.lang.Object
- - de.esprit.appsuite.database.dbase.rdbms.RdbmsSupport

- Direct Known Subclasses:
    RdbmsDB2J, RdbmsDB2NT, RdbmsDerby, RdbmsInformix, RdbmsMySQL, RdbmsOracle, RdbmsPointBase, RdbmsUnsupported

      public abstract class RdbmsSupport
      extends java.lang.Object

  This class is supposed to encapsulate RDBMS differences by providing RDBMS specific support.
  Author:
    Rainer Buesch

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `RDBMS_ACCESS`
    `static java.lang.String` | `RDBMS_CLOUDSCAPE`
    `static java.lang.String` | `RDBMS_DB2NT`
    `static java.lang.String` | `RDBMS_DERBY`
    `static java.lang.String` | `RDBMS_INFORMIX`
    `static java.lang.String` | `RDBMS_MYSQL`
    `static java.lang.String` | `RDBMS_ORACLE`
    `static java.lang.String` | `RDBMS_POINTBASE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RdbmsSupport(javax.sql.DataSource cp, java.sql.Connection dbConn, RdbmsInfo dbInfo)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `createAddForeignKeyStatement(java.lang.String sourceTable, java.lang.String sourceCols, java.lang.String targetTable, java.lang.String targetCols, java.lang.String constrName)` This default implementation is valid for most RDBMS systems.
    `static RdbmsSupport` | `createRdbmsSupport(javax.sql.DataSource cp)`
    `abstract java.lang.String` | `getBlobDef()`
    `abstract java.lang.String` | `getBooleanDef()`
    `abstract java.lang.String` | `getCharDef(int length)`
    `abstract java.lang.String` | `getClobDef()`
    `javax.sql.DataSource` | `getDataSource()`
    `abstract java.lang.String` | `getDateDef()`
    `DBSupport` | `getDBSupport()`
    `abstract java.lang.String` | `getDoubleDef()`
    `java.sql.Blob` | `getEmptyBlob()` Most RDBMS systems need 'null', but Informix needs and empty Blob Object
    `java.sql.Clob` | `getEmptyClob()` Most RDBMS systems need 'null', but Informix needs and empty Clob Object
    `abstract java.lang.String` | `getFloatDef()`
    `static RdbmsSupport` | `getInstance()`
    `abstract java.lang.String` | `getIntDef()`
    `abstract java.lang.String` | `getLongDef()`
    `abstract java.lang.String` | `getLongVarcharDef()`
    `RdbmsInfo` | `getRdbmsInfo()` Returns the RdbmsInfo object which caches the most frequently used database meta data
    `static java.lang.String[]` | `getSupportedRdbmsTypes()` Returns the short-names of all supported RDBMS types that are defined as public constants RDBMS_* in this class.
    `abstract java.lang.String` | `getTimeDef()`
    `abstract java.lang.String` | `getTimestampDef()`
    `abstract java.lang.String` | `getVarcharDef()`
    `abstract java.lang.String` | `getVarcharDef(int length)`
    `protected void` | `init(java.sql.Connection dbConn)` May be overridden by subclasses in order to do any RDBMS-specific initialization on the given connection.
    `static boolean` | `isSupportedRdbmsType(java.lang.String rdbmsType)` Tells whether the given RDBMS type name is one of the RdbmsSupport.RDBMS_* constants.
    `java.lang.String` | `toString()`
    `int` | `updateStatisticsAll()` Updates the database statistics for all tables (Not supported on most RDBMS systems)
    `int` | `updateStatisticsFor(java.lang.String tableName)` Updates the database statistics for the given table (Not supported on most RDBMS systems)

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### RDBMS_MYSQL

          public static final java.lang.String RDBMS_MYSQL

      See Also:
        Constant Field Values

    - #### RDBMS_CLOUDSCAPE

          public static final java.lang.String RDBMS_CLOUDSCAPE

      See Also:
        Constant Field Values

    - #### RDBMS_DB2NT

          public static final java.lang.String RDBMS_DB2NT

      See Also:
        Constant Field Values

    - #### RDBMS_INFORMIX

          public static final java.lang.String RDBMS_INFORMIX

      See Also:
        Constant Field Values

    - #### RDBMS_POINTBASE

          public static final java.lang.String RDBMS_POINTBASE

      See Also:
        Constant Field Values

    - #### RDBMS_ORACLE

          public static final java.lang.String RDBMS_ORACLE

      See Also:
        Constant Field Values

    - #### RDBMS_DERBY

          public static final java.lang.String RDBMS_DERBY

      See Also:
        Constant Field Values

    - #### RDBMS_ACCESS

          public static final java.lang.String RDBMS_ACCESS

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### RdbmsSupport

          public RdbmsSupport(javax.sql.DataSource cp,
                      java.sql.Connection dbConn,
                      RdbmsInfo dbInfo)
                       throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`

  - ### Method Detail

    - #### getDataSource

          public javax.sql.DataSource getDataSource()

    - #### getRdbmsInfo

          public RdbmsInfo getRdbmsInfo()

      Returns the RdbmsInfo object which caches the most frequently used database meta data

    - #### init

          protected void init(java.sql.Connection dbConn)
                       throws java.sql.SQLException

      May be overridden by subclasses in order to do any RDBMS-specific initialization on the given connection.
      Throws:
        `java.sql.SQLException`

    - #### createAddForeignKeyStatement

          public java.lang.String createAddForeignKeyStatement(java.lang.String sourceTable,
                                                      java.lang.String sourceCols,
                                                      java.lang.String targetTable,
                                                      java.lang.String targetCols,
                                                      java.lang.String constrName)

      This default implementation is valid for most RDBMS systems. There are few exceptions like INFORMIX and DB2 which have overridden this method
      Returns:
        SQL Statement for creating a foreign key

    - #### updateStatisticsFor

          public int updateStatisticsFor(java.lang.String tableName)

      Updates the database statistics for the given table (Not supported on most RDBMS systems)

    - #### updateStatisticsAll

          public int updateStatisticsAll()

      Updates the database statistics for all tables (Not supported on most RDBMS systems)

    - #### getEmptyBlob

          public java.sql.Blob getEmptyBlob()

      Most RDBMS systems need 'null', but Informix needs and empty Blob Object

    - #### getDBSupport

          public DBSupport getDBSupport()

    - #### getEmptyClob

          public java.sql.Clob getEmptyClob()

      Most RDBMS systems need 'null', but Informix needs and empty Clob Object

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### getBooleanDef

          public abstract java.lang.String getBooleanDef()

    - #### getCharDef

          public abstract java.lang.String getCharDef(int length)

    - #### getIntDef

          public abstract java.lang.String getIntDef()

    - #### getLongDef

          public abstract java.lang.String getLongDef()

    - #### getFloatDef

          public abstract java.lang.String getFloatDef()

    - #### getDoubleDef

          public abstract java.lang.String getDoubleDef()

    - #### getDateDef

          public abstract java.lang.String getDateDef()

    - #### getTimeDef

          public abstract java.lang.String getTimeDef()

    - #### getTimestampDef

          public abstract java.lang.String getTimestampDef()

    - #### getVarcharDef

          public abstract java.lang.String getVarcharDef()

    - #### getVarcharDef

          public abstract java.lang.String getVarcharDef(int length)

    - #### getLongVarcharDef

          public abstract java.lang.String getLongVarcharDef()

    - #### getClobDef

          public abstract java.lang.String getClobDef()

    - #### getBlobDef

          public abstract java.lang.String getBlobDef()

    - #### getSupportedRdbmsTypes

          public static java.lang.String[] getSupportedRdbmsTypes()

      Returns the short-names of all supported RDBMS types that are defined as public constants RDBMS_* in this class.

    - #### isSupportedRdbmsType

          public static boolean isSupportedRdbmsType(java.lang.String rdbmsType)

      Tells whether the given RDBMS type name is one of the RdbmsSupport.RDBMS_* constants.

    - #### createRdbmsSupport

          public static RdbmsSupport createRdbmsSupport(javax.sql.DataSource cp)
                                                 throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`

    - #### getInstance

          public static RdbmsSupport getInstance()

Copyright © 2014 EsprIT-Systems. All Rights Reserved.