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`

  - ### Field Summary

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

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

      `REGISTRY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MYSQLAdapter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addIndexField(java.lang.StringBuilder builder, IDBField field)`
    `protected void` | `dropPrimaryKey(IDBIndex index, java.lang.StringBuilder builder)`
    `int` | `getMaxFieldNameLength()`
    `int` | `getMaxTableNameLength()`
    `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)
    `boolean` | `isTypeIndexable(DBType type)`
    `java.sql.Connection` | `modifyConnection(java.sql.Connection connection)`
    `protected java.lang.String` | `sqlModifyField(java.lang.String tableName, java.lang.String fieldName, java.lang.String definition)`
    `java.lang.String` | `sqlRenameField(IDBField field, java.lang.String oldName)`

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

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

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

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

- - ### Field Detail

    - #### NAME

          public static final java.lang.String NAME

      See Also:
        Constant Field Values

    - #### VERSION

          public static final java.lang.String VERSION

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MYSQLAdapter

          public MYSQLAdapter()

  - ### Method Detail

    - #### 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 java.lang.String getTypeName(IDBField field)

      Overrides:
        `getTypeName` in class `DBAdapter`

    - #### dropPrimaryKey

          protected void dropPrimaryKey(IDBIndex index,
                                        java.lang.StringBuilder builder)

      Overrides:
        `dropPrimaryKey` in class `DBAdapter`

    - #### addIndexField

          protected void addIndexField(java.lang.StringBuilder builder,
                                       IDBField field)

      Overrides:
        `addIndexField` in class `DBAdapter`

    - #### getReservedWords

          public java.lang.String[] getReservedWords()

    - #### isTypeIndexable

          public boolean isTypeIndexable(DBType type)

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

    - #### sqlModifyField

          protected java.lang.String sqlModifyField(java.lang.String tableName,
                                                    java.lang.String fieldName,
                                                    java.lang.String definition)

      Overrides:
        `sqlModifyField` in class `DBAdapter`

    - #### modifyConnection

          public java.sql.Connection modifyConnection(java.sql.Connection connection)

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

Copyright (c) 2004-2019 Eike Stepper (Loehne, 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