org.springframework.boot.jdbc

Enum DatabaseDriver

  • java.lang.Object
    • java.lang.Enum<DatabaseDriver>
      • org.springframework.boot.jdbc.DatabaseDriver
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<DatabaseDriver>


    public enum DatabaseDriver
    extends java.lang.Enum<DatabaseDriver>
    Enumeration of common database drivers.
    Since:
    1.4.0
    • Enum Constant Detail

      • HSQLDB

        public static final DatabaseDriver HSQLDB
        HyperSQL DataBase.
      • GAE

        @Deprecated
        public static final DatabaseDriver GAE
        Deprecated. since 2.7.0 for removal in 3.0.0 without replacement following the removal of AppEngineDriver from version 2.0 of the AppEngine API SDK.
        Google App Engine.
      • REDSHIFT

        public static final DatabaseDriver REDSHIFT
        Amazon Redshift.
        Since:
        2.2.0
      • HANA

        public static final DatabaseDriver HANA
        HANA - SAP HANA Database - HDB.
        Since:
        2.1.0
      • JTDS

        public static final DatabaseDriver JTDS
        jTDS. As it can be used for several databases, there isn't a single product name we could rely on.
      • DB2_AS400

        public static final DatabaseDriver DB2_AS400
        DB2 AS400 Server.
      • PHOENIX

        public static final DatabaseDriver PHOENIX
        Apache Phoenix.
        Since:
        2.5.0
      • TESTCONTAINERS

        public static final DatabaseDriver TESTCONTAINERS
        Testcontainers.
    • Method Detail

      • values

        public static DatabaseDriver[] 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 (DatabaseDriver c : DatabaseDriver.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DatabaseDriver 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
      • getId

        public java.lang.String getId()
        Return the identifier of this driver.
        Returns:
        the identifier
      • getUrlPrefixes

        protected java.util.Collection<java.lang.String> getUrlPrefixes()
        Return the url prefixes of this driver.
        Returns:
        the url prefixes
      • matchProductName

        protected boolean matchProductName(java.lang.String productName)
      • getDriverClassName

        public java.lang.String getDriverClassName()
        Return the driver class name.
        Returns:
        the class name or null
      • getXaDataSourceClassName

        public java.lang.String getXaDataSourceClassName()
        Return the XA driver source class name.
        Returns:
        the class name or null
      • getValidationQuery

        public java.lang.String getValidationQuery()
        Return the validation query.
        Returns:
        the validation query or null
      • fromJdbcUrl

        public static DatabaseDriver fromJdbcUrl(java.lang.String url)
        Find a DatabaseDriver for the given URL.
        Parameters:
        url - the JDBC URL
        Returns:
        the database driver or UNKNOWN if not found
      • fromProductName

        public static DatabaseDriver fromProductName(java.lang.String productName)
        Find a DatabaseDriver for the given product name.
        Parameters:
        productName - product name
        Returns:
        the database driver or UNKNOWN if not found
      • fromDataSource

        @Deprecated
        public static DatabaseDriver fromDataSource(javax.sql.DataSource dataSource)
        Deprecated. since 2.7.15 for removal in 3.3.0 with no replacement
        Find a DatabaseDriver for the given DataSource.
        Parameters:
        dataSource - data source to inspect
        Returns:
        the database driver of UNKNOWN if not found
        Since:
        2.6.0