Package org.springframework.cloud.task.repository.support

# Enum DatabaseType

java.lang.Object
java.lang.Enum<DatabaseType>
org.springframework.cloud.task.repository.support.DatabaseType

All Implemented Interfaces:
  `Serializable`, `Comparable<DatabaseType>`, `java.lang.constant.Constable`

public enum DatabaseType extends 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.

Author:
  Glenn Renfro

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class java.lang.Enum

  `Enum.EnumDesc<E extends Enum<E>>`

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `DB2`
  DB2 DB.
  `DB2AS400`
  DB2AS400 DB.
  `DB2VSE`
  DB2VSE DB.
  `DB2ZOS`
  DB2ZOS DB.
  `H2`
  H2 DB.
  `HSQL`
  HSQL DB.
  `MYSQL`
  MySQL DB.
  `ORACLE`
  Oracle DB.
  `POSTGRES`
  PostgreSQL DB.
  `SQLSERVER`
  Microsoft SQL Server DB.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static DatabaseType`
  `fromMetaData(DataSource dataSource)`
  Convenience method that pulls a database product name from the DataSource's metadata.
  `static DatabaseType`
  `fromProductName(String productName)`
  Static method to obtain a DatabaseType from the provided product name.
  `static DatabaseType`
  `valueOf(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, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

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

- ## Enum Constant Details

  - ### HSQL

    public static final DatabaseType HSQL
    HSQL DB.

  - ### H2

    public static final DatabaseType H2
    H2 DB.

  - ### ORACLE

    public static final DatabaseType ORACLE
    Oracle DB.

  - ### MYSQL

    public static final DatabaseType MYSQL
    MySQL DB.

  - ### POSTGRES

    public static final DatabaseType POSTGRES
    PostgreSQL DB.

  - ### SQLSERVER

    public static final DatabaseType SQLSERVER
    Microsoft SQL Server DB.

  - ### DB2

    public static final DatabaseType DB2
    DB2 DB.

  - ### DB2VSE

    public static final DatabaseType DB2VSE
    DB2VSE DB.

  - ### DB2ZOS

    public static final DatabaseType DB2ZOS
    DB2ZOS DB.

  - ### DB2AS400

    public static final DatabaseType DB2AS400
    DB2AS400 DB.

- ## Method Details

  - ### values

    public static DatabaseType[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.
    Returns:
      an array containing the constants of this enum type, in the order they are declared

  - ### valueOf

    public static DatabaseType valueOf(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:
      `IllegalArgumentException` - if this enum type has no constant with the specified name
      `NullPointerException` - if the argument is null

  - ### fromMetaData

    public static DatabaseType fromMetaData(DataSource dataSource) throws SQLException, org.springframework.jdbc.support.MetaDataAccessException
    Convenience method that pulls a database product name from the DataSource's metadata.
    Parameters:
      `dataSource` - the datasource used to extact metadata.
    Returns:
      DatabaseType The database type associated with the datasource.
    Throws:
      `org.springframework.jdbc.support.MetaDataAccessException` - thrown if failure occurs on metadata lookup.
      `SQLException`

  - ### fromProductName

    public static DatabaseType fromProductName(String productName)
    Static method to obtain a DatabaseType from the provided product name.
    Parameters:
      `productName` - the name of the database.
    Returns:
      DatabaseType for given product name.
    Throws:
      `IllegalArgumentException` - if none is found.