Package 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`, `IDBAdapterID`

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, DBAdapter.IndexInfo`

## Nested classes/interfaces inherited from interface org.eclipse.net4j.db.IDBAdapter

`IDBAdapter.Registry`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`VERSION`

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

`REGISTRY`

## Constructor Summary

Constructors
Modifier
Constructor
Description
``
`H2Adapter()`
`protected`
`H2Adapter(String name, String version)`

## Method Summary

Modifier and Type
Method
Description
`static void`
`createSchema(DataSource dataSource, String name, boolean dropIfExists)`
`String`
`getDefaultSchemaName(Connection connection)`
`String[]`
`getReservedWords()`
`protected String`
`getTypeName(IDBField field)`
`boolean`
`isDuplicateKeyException(SQLException ex)`
Check if an exception indicates a constraint violation (duplicate key)
`protected boolean`
`isPrimaryKeyShadow(Connection connection, IDBTable table, String name, IDBIndex.Type type, IDBField[] fields)`
`boolean`
`isTableNotFoundException(SQLException ex)`
`static void`
`shutdown(DataSource dataSource)`
`protected String`
`sqlCharIndexFunction()`
`String`
`sqlRenameField(IDBField field, String oldName)`

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

`adaptType, addIndex, addIndexField, alterTable, appendFieldDefs, appendFieldNames, convertString, convertString, convertString, convertToSQL, createConnectionProvider, createConstraints, createField, createField, createFieldDefinition, createFieldDefinitions, createIndex, createIndex, createIndex, createIndexFields, createJDBCDataSource, createPrimaryKey, createSchema, createTable, createTable, createTables, doCreateTable, dropField, dropField, dropIndex, dropIndex, dropPrimaryKey, dropTable, dropTable, dropTables, equals, forEachTable, format, format, generateReservedWords, getDefaultDBLength, getDropTableSQL, getFieldLength, getIndexInfos, getJDBCDriver, getJDBCTypeForNull, getMaxFieldNameLength, getMaxTableNameLength, getName, getNullableConstraint, getSQL92ReservedWords, getVersion, hashCode, isCaseSensitive, isColumnNotFoundException, isDuplicateKeyTransactionAbort, isReservedWord, isTypeIndexable, isValidFirstChar, modifyConnection, openSchemaTransaction, readFields, readIndices, readIndices, readSchema, readSchema, readTables, sqlCharIndex, sqlConcat, sqlModifyField, sqlModifyField, sqlSubstring, sqlSubstring, sqlSubstringFunction, toString, updateSchema, validateTable`

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

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

## Field Details

### VERSION

public static final String VERSION

## Constructor Details

### H2Adapter

public H2Adapter()

### H2Adapter

protected H2Adapter(String name, String version)

Since:
  4.5

## Method Details

### getTypeName

protected String getTypeName(IDBField field)

Overrides:
  `getTypeName` in class `DBAdapter`

### getDefaultSchemaName

public String getDefaultSchemaName(Connection connection)

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

### getReservedWords

public String[] getReservedWords()

### isPrimaryKeyShadow

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

Overrides:
  `isPrimaryKeyShadow` in class `DBAdapter`

### isDuplicateKeyException

public boolean isDuplicateKeyException(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`

### isTableNotFoundException

public boolean isTableNotFoundException(SQLException ex)

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

### sqlRenameField

public String sqlRenameField(IDBField field, String oldName)

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

### sqlCharIndexFunction

protected String sqlCharIndexFunction()

Overrides:
  `sqlCharIndexFunction` in class `DBAdapter`

### createSchema

public static void createSchema(DataSource dataSource, String name, boolean dropIfExists)

Since:
  4.2

### shutdown

public static void shutdown(DataSource dataSource)

Since:
  4.3