Package org.springframework.boot.jdbc
Enum Class DatabaseDriver
- All Implemented Interfaces:
Serializable
,Comparable<DatabaseDriver>
,Constable
Enumeration of common database drivers.
- Since:
- 1.4.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionDB2 Server.DB2 AS400 Server.Apache Derby.Firebird.H2.HANA - SAP HANA Database - HDB.HyperSQL DataBase.Informix.jTDS.Maria DB.MySQL.Oracle.Apache Phoenix.Postgres.Amazon Redshift.SQLite.SQL Server.Teradata.Testcontainers.Unknown type. -
Method Summary
Modifier and TypeMethodDescriptionstatic DatabaseDriver
fromDataSource
(DataSource dataSource) Find aDatabaseDriver
for the givenDataSource
.static DatabaseDriver
fromJdbcUrl
(String url) Find aDatabaseDriver
for the given URL.static DatabaseDriver
fromProductName
(String productName) Find aDatabaseDriver
for the given product name.Return the driver class name.getId()
Return the identifier of this driver.protected Collection<String>
Return the url prefixes of this driver.Return the validation query.Return the XA driver source class name.protected boolean
matchProductName
(String productName) static DatabaseDriver
Returns the enum constant of this class with the specified name.static DatabaseDriver[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNKNOWN
Unknown type. -
DERBY
Apache Derby. -
H2
H2. -
HSQLDB
HyperSQL DataBase. -
SQLITE
SQLite. -
MYSQL
MySQL. -
MARIADB
Maria DB. -
ORACLE
Oracle. -
POSTGRESQL
Postgres. -
REDSHIFT
Amazon Redshift.- Since:
- 2.2.0
-
HANA
HANA - SAP HANA Database - HDB.- Since:
- 2.1.0
-
JTDS
jTDS. As it can be used for several databases, there isn't a single product name we could rely on. -
SQLSERVER
SQL Server. -
FIREBIRD
Firebird. -
DB2
DB2 Server. -
DB2_AS400
DB2 AS400 Server. -
TERADATA
Teradata. -
INFORMIX
Informix. -
PHOENIX
Apache Phoenix.- Since:
- 2.5.0
-
TESTCONTAINERS
Testcontainers.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
getId
Return the identifier of this driver.- Returns:
- the identifier
-
getUrlPrefixes
Return the url prefixes of this driver.- Returns:
- the url prefixes
-
matchProductName
-
getDriverClassName
Return the driver class name.- Returns:
- the class name or
null
-
getXaDataSourceClassName
Return the XA driver source class name.- Returns:
- the class name or
null
-
getValidationQuery
Return the validation query.- Returns:
- the validation query or
null
-
fromJdbcUrl
Find aDatabaseDriver
for the given URL.- Parameters:
url
- the JDBC URL- Returns:
- the database driver or
UNKNOWN
if not found
-
fromProductName
Find aDatabaseDriver
for the given product name.- Parameters:
productName
- product name- Returns:
- the database driver or
UNKNOWN
if not found
-
fromDataSource
Find aDatabaseDriver
for the givenDataSource
.- Parameters:
dataSource
- data source to inspect- Returns:
- the database driver of
UNKNOWN
if not found - Since:
- 2.6.0
-