Package org.eclipse.net4j.db.mysql

# Class MYSQLAdapter

java.lang.Object
org.eclipse.net4j.spi.db.DBAdapter
org.eclipse.net4j.db.mysql.MYSQLAdapter

All Implemented Interfaces:
  `IDBAdapter`

public class MYSQLAdapter extends DBAdapter
A `DB adapter` for MySQL 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`

## Field Summary

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

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

`REGISTRY`

## Constructor Summary

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

## Method Summary

Modifier and Type
Method
Description
`protected void`
`addIndexField(StringBuilder builder, IDBField field)`
`protected void`
`dropPrimaryKey(IDBIndex index, StringBuilder builder)`
`int`
`getMaxFieldNameLength()`
`int`
`getMaxTableNameLength()`
`String[]`
`getReservedWords()`
`protected String`
`getTypeName(IDBField field)`
`boolean`
`isDuplicateKeyException(SQLException ex)`
Check if an exception indicates a constraint violation (duplicate key)
`boolean`
`isTypeIndexable(DBType type)`
`Connection`
`modifyConnection(Connection connection)`
`protected String`
`sqlCharIndexFunction()`
`protected String`
`sqlModifyField(String tableName, String fieldName, String definition)`
`String`
`sqlRenameField(IDBField field, String oldName)`

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

`adaptType, addIndex, 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, dropTable, dropTable, dropTables, format, format, generateReservedWords, getDefaultDBLength, getDefaultSchemaName, getDropTableSQL, getFieldLength, getIndexInfos, getJDBCDriver, getName, getNullableConstraint, getSQL92ReservedWords, getVersion, isCaseSensitive, isColumnNotFoundException, isPrimaryKeyShadow, isReservedWord, isTableNotFoundException, isValidFirstChar, openSchemaTransaction, readFields, readIndices, readIndices, readSchema, readSchema, readTables, sqlCharIndex, sqlConcat, sqlModifyField, sqlSubstring, sqlSubstring, sqlSubstringFunction, toString, updateSchema, validateTable`

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

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

## Field Details

### NAME

public static final String NAME

See Also:
  - Constant Field Values

### VERSION

public static final String VERSION

See Also:
  - Constant Field Values

## Constructor Details

### MYSQLAdapter

public MYSQLAdapter()

### MYSQLAdapter

protected MYSQLAdapter(String name, String version)

Since:
  4.4

## Method Details

### getMaxTableNameLength

public int getMaxTableNameLength()

Specified by:
  `getMaxTableNameLength` in interface `IDBAdapter`
Overrides:
  `getMaxTableNameLength` in class `DBAdapter`
Since:
  2.0

### getMaxFieldNameLength

public int getMaxFieldNameLength()

Specified by:
  `getMaxFieldNameLength` in interface `IDBAdapter`
Overrides:
  `getMaxFieldNameLength` in class `DBAdapter`
Since:
  2.0

### getTypeName

protected String getTypeName(IDBField field)

Overrides:
  `getTypeName` in class `DBAdapter`

### dropPrimaryKey

protected void dropPrimaryKey(IDBIndex index, StringBuilder builder)

Overrides:
  `dropPrimaryKey` in class `DBAdapter`

### addIndexField

protected void addIndexField(StringBuilder builder, IDBField field)

Overrides:
  `addIndexField` in class `DBAdapter`

### getReservedWords

public String[] getReservedWords()

### isTypeIndexable

public boolean isTypeIndexable(DBType type)

Specified by:
  `isTypeIndexable` in interface `IDBAdapter`
Overrides:
  `isTypeIndexable` 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`

### sqlRenameField

public String sqlRenameField(IDBField field, String oldName)

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

### sqlModifyField

protected String sqlModifyField(String tableName, String fieldName, String definition)

Overrides:
  `sqlModifyField` in class `DBAdapter`

### sqlCharIndexFunction

protected String sqlCharIndexFunction()

Overrides:
  `sqlCharIndexFunction` in class `DBAdapter`

### modifyConnection

public Connection modifyConnection(Connection connection)

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