org.eclipse.net4j.db.h2

## Class H2Adapter

- java.lang.Object
- - org.eclipse.net4j.spi.db.DBAdapter
  - - org.eclipse.net4j.db.h2.H2Adapter

- All Implemented Interfaces:
    IDBAdapter

      public class H2Adapter
      extends DBAdapter

  A `DB adapter` for H2 databases.
  Since:
    2.0
  Author:
    Eike Stepper

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.eclipse.net4j.spi.db.DBAdapter

      `DBAdapter.FieldInfo`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `VERSION`

    - ### Fields inherited from interface org.eclipse.net4j.db.IDBAdapter

      `REGISTRY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `H2Adapter()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `createSchema(javax.sql.DataSource dataSource, java.lang.String name, boolean dropIfExists)`
    `java.lang.String[]` | `getReservedWords()`
    `protected java.lang.String` | `getTypeName(IDBField field)`
    `boolean` | `isDuplicateKeyException(java.sql.SQLException ex)` Check if an exception indicates a constraint violation (duplicate key)
    `protected boolean` | `isPrimaryKeyShadow(java.sql.Connection connection, IDBTable table, java.lang.String name, IDBIndex.Type type, IDBField[] fields)`
    `static void` | `shutdown(javax.sql.DataSource dataSource)`
    `java.lang.String` | `sqlRenameField(IDBField field, java.lang.String oldName)`

    - ### Methods inherited from class org.eclipse.net4j.spi.db.DBAdapter

      `adaptType, addIndex, addIndexField, alterTable, appendFieldDefs, appendFieldNames, convertString, convertString, convertString, createConnectionProvider, createConstraints, createField, createFieldDefinition, createFieldDefinitions, createIndex, createIndex, createIndex, createIndexFields, createJDBCDataSource, createPrimaryKey, createTable, createTable, createTables, doCreateTable, dropField, dropIndex, dropIndex, dropPrimaryKey, dropTable, dropTable, dropTables, format, format, getDefaultDBLength, getDropTableSQL, getFieldLength, getJDBCDriver, getMaxFieldNameLength, getMaxTableNameLength, getName, getSQL92ReservedWords, getVersion, isColumnNotFoundException, isReservedWord, isTableNotFoundException, isTypeIndexable, isValidFirstChar, modifyConnection, readFields, readIndices, readIndices, readSchema, readSchema, readTables, sqlModifyField, sqlModifyField, toString, updateSchema, validateTable`

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

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

- - ### Field Detail

    - #### VERSION

          public static final java.lang.String VERSION

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### H2Adapter

          public H2Adapter()

  - ### Method Detail

    - #### getTypeName

          protected java.lang.String getTypeName(IDBField field)

      Overrides:
        `getTypeName` in class `DBAdapter`

    - #### getReservedWords

          public java.lang.String[] getReservedWords()

    - #### isPrimaryKeyShadow

          protected boolean isPrimaryKeyShadow(java.sql.Connection connection,
                                               IDBTable table,
                                               java.lang.String name,
                                               IDBIndex.Type type,
                                               IDBField[] fields)

      Overrides:
        `isPrimaryKeyShadow` in class `DBAdapter`

    - #### isDuplicateKeyException

          public boolean isDuplicateKeyException(java.sql.SQLException ex)

      Description copied from interface: `IDBAdapter`
      Check if an exception indicates a constraint violation (duplicate key)
      Specified by:
        `isDuplicateKeyException` in interface `IDBAdapter`
      Overrides:
        `isDuplicateKeyException` in class `DBAdapter`

    - #### sqlRenameField

          public java.lang.String sqlRenameField(IDBField field,
                                                 java.lang.String oldName)

      Specified by:
        `sqlRenameField` in interface `IDBAdapter`
      Overrides:
        `sqlRenameField` in class `DBAdapter`

    - #### createSchema

          public static void createSchema(javax.sql.DataSource dataSource,
                                          java.lang.String name,
                                          boolean dropIfExists)

      Since:
        4.2

    - #### shutdown

          public static void shutdown(javax.sql.DataSource dataSource)

      Since:
        4.3

Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html