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
    • 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
      • matchProductName

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

        protected java.util.Collection<java.lang.String> getUrlPrefixes()
      • 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

        public static DatabaseDriver fromDataSource(javax.sql.DataSource dataSource)
        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