Package org.springframework.boot.jdbc
Enum DatabaseDriver
- java.lang.Object
- java.lang.Enum<DatabaseDriver>
- org.springframework.boot.jdbc.DatabaseDriver
- All Implemented Interfaces:
Serializable
,Comparable<DatabaseDriver>
public enum DatabaseDriver extends Enum<DatabaseDriver>
Enumeration of common database drivers.- Since:
- 1.4.0
Enum Constant Summary
Enum Constants Enum Constant Description DB2
DB2 Server.DB2_AS400
DB2 AS400 Server.DERBY
Apache Derby.FIREBIRD
Firebird.GAE
Google App Engine.H2
H2.HANA
HANA - SAP HANA Database - HDB.HSQLDB
HyperSQL DataBase.INFORMIX
Informix.JTDS
jTDS.MARIADB
Maria DB.MYSQL
MySQL.ORACLE
Oracle.POSTGRESQL
Postgres.SQLITE
SQL Lite.SQLSERVER
SQL Server.TERADATA
Teradata.UNKNOWN
Unknown type.
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DatabaseDriver
fromJdbcUrl(String url)
Find aDatabaseDriver
for the given URL.static DatabaseDriver
fromProductName(String productName)
Find aDatabaseDriver
for the given product name.String
getDriverClassName()
Return the driver class name.String
getId()
Return the identifier of this driver.protected Collection<String>
getUrlPrefixes()
String
getValidationQuery()
Return the validation query.String
getXaDataSourceClassName()
Return the XA driver source class name.protected boolean
matchProductName(String productName)
static DatabaseDriver
valueOf(String name)
Returns the enum constant of this type with the specified name.static DatabaseDriver[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
Enum Constant Detail
UNKNOWN
public static final DatabaseDriver UNKNOWN
Unknown type.
DERBY
public static final DatabaseDriver DERBY
Apache Derby.
H2
public static final DatabaseDriver H2
H2.
HSQLDB
public static final DatabaseDriver HSQLDB
HyperSQL DataBase.
SQLITE
public static final DatabaseDriver SQLITE
SQL Lite.
MYSQL
public static final DatabaseDriver MYSQL
MySQL.
MARIADB
public static final DatabaseDriver MARIADB
Maria DB.
GAE
public static final DatabaseDriver GAE
Google App Engine.
ORACLE
public static final DatabaseDriver ORACLE
Oracle.
POSTGRESQL
public static final DatabaseDriver POSTGRESQL
Postgres.
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.
SQLSERVER
public static final DatabaseDriver SQLSERVER
SQL Server.
FIREBIRD
public static final DatabaseDriver FIREBIRD
Firebird.
DB2
public static final DatabaseDriver DB2
DB2 Server.
DB2_AS400
public static final DatabaseDriver DB2_AS400
DB2 AS400 Server.
TERADATA
public static final DatabaseDriver TERADATA
Teradata.
INFORMIX
public static final DatabaseDriver INFORMIX
Informix.
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(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 nameNullPointerException
- if the argument is null
matchProductName
protected boolean matchProductName(String productName)
getUrlPrefixes
protected Collection<String> getUrlPrefixes()
getDriverClassName
public String getDriverClassName()
Return the driver class name.- Returns:
- the class name or
null
getXaDataSourceClassName
public String getXaDataSourceClassName()
Return the XA driver source class name.- Returns:
- the class name or
null
getValidationQuery
public String getValidationQuery()
Return the validation query.- Returns:
- the validation query or
null
fromJdbcUrl
public static DatabaseDriver fromJdbcUrl(String url)
Find aDatabaseDriver
for the given URL.- Parameters:
url
- the JDBC URL- Returns:
- the database driver or
UNKNOWN
if not found
fromProductName
public static DatabaseDriver fromProductName(String productName)
Find aDatabaseDriver
for the given product name.- Parameters:
productName
- product name- Returns:
- the database driver or
UNKNOWN
if not found