org.springframework.batch.support

## Enum DatabaseType

- java.lang.Object
- - java.lang.Enum<DatabaseType>
  - - org.springframework.batch.support.DatabaseType

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<DatabaseType>

      public enum DatabaseType
      extends java.lang.Enum<DatabaseType>

  Enum representing a database type, such as DB2 or oracle. The type also contains a product name, which is expected to be the same as the product name provided by the database driver's metadata.
  Since:
    2.0
  Author:
    Lucas Ward

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `DB2`
    `DB2ZOS`
    `DERBY`
    `H2`
    `HSQL`
    `MYSQL`
    `ORACLE`
    `POSTGRES`
    `SQLITE`
    `SQLSERVER`
    `SYBASE`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static DatabaseType` | `fromMetaData(javax.sql.DataSource dataSource)` Convenience method that pulls a database product name from the DataSource's metadata.
    `static DatabaseType` | `fromProductName(java.lang.String productName)` Static method to obtain a DatabaseType from the provided product name.
    `java.lang.String` | `getProductName()`
    `static DatabaseType` | `valueOf(java.lang.String name)` Returns the enum constant of this type with the specified name.
    `static DatabaseType[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

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

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### DERBY

          public static final DatabaseType DERBY

    - #### DB2

          public static final DatabaseType DB2

    - #### DB2ZOS

          public static final DatabaseType DB2ZOS

    - #### HSQL

          public static final DatabaseType HSQL

    - #### SQLSERVER

          public static final DatabaseType SQLSERVER

    - #### MYSQL

          public static final DatabaseType MYSQL

    - #### ORACLE

          public static final DatabaseType ORACLE

    - #### POSTGRES

          public static final DatabaseType POSTGRES

    - #### SYBASE

          public static final DatabaseType SYBASE

    - #### H2

          public static final DatabaseType H2

    - #### SQLITE

          public static final DatabaseType SQLITE

  - ### Method Detail

    - #### values

          public static DatabaseType[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (DatabaseType c : DatabaseType.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static DatabaseType valueOf(java.lang.String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
        `java.lang.NullPointerException` - if the argument is null

    - #### getProductName

          public java.lang.String getProductName()

    - #### fromProductName

          public static DatabaseType fromProductName(java.lang.String productName)

      Static method to obtain a DatabaseType from the provided product name.
      Parameters:
        `productName` -
      Returns:
        DatabaseType for given product name.
      Throws:
        `java.lang.IllegalArgumentException` - if none is found.

    - #### fromMetaData

          public static DatabaseType fromMetaData(javax.sql.DataSource dataSource)
                                           throws org.springframework.jdbc.support.MetaDataAccessException

      Convenience method that pulls a database product name from the DataSource's metadata.
      Parameters:
        `dataSource` -
      Returns:
        DatabaseType
      Throws:
        `org.springframework.jdbc.support.MetaDataAccessException`