|
|
|
@ -33,77 +33,77 @@ public enum DatabaseDriver {
|
|
|
|
|
/**
|
|
|
|
|
* Unknown type.
|
|
|
|
|
*/
|
|
|
|
|
UNKNOWN(null, null),
|
|
|
|
|
UNKNOWN("unknown", null, null),
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Apache Derby.
|
|
|
|
|
*/
|
|
|
|
|
DERBY("Apache Derby", "org.apache.derby.jdbc.EmbeddedDriver",
|
|
|
|
|
DERBY("derby", "Apache Derby", "org.apache.derby.jdbc.EmbeddedDriver",
|
|
|
|
|
"org.apache.derby.jdbc.EmbeddedXADataSource",
|
|
|
|
|
"SELECT 1 FROM SYSIBM.SYSDUMMY1"),
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* H2.
|
|
|
|
|
*/
|
|
|
|
|
H2("H2", "org.h2.Driver", "org.h2.jdbcx.JdbcDataSource", "SELECT 1"),
|
|
|
|
|
H2("h2", "H2", "org.h2.Driver", "org.h2.jdbcx.JdbcDataSource", "SELECT 1"),
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* HyperSQL DataBase.
|
|
|
|
|
*/
|
|
|
|
|
HSQLDB("HSQL Database Engine", "org.hsqldb.jdbc.JDBCDriver",
|
|
|
|
|
HSQLDB("hsqldb", "HSQL Database Engine", "org.hsqldb.jdbc.JDBCDriver",
|
|
|
|
|
"org.hsqldb.jdbc.pool.JDBCXADataSource",
|
|
|
|
|
"SELECT COUNT(*) FROM INFORMATION_SCHEMA.SYSTEM_USERS"),
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SQL Lite.
|
|
|
|
|
*/
|
|
|
|
|
SQLITE("SQLite", "org.sqlite.JDBC"),
|
|
|
|
|
SQLITE("sqlite", "SQLite", "org.sqlite.JDBC"),
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* MySQL.
|
|
|
|
|
*/
|
|
|
|
|
MYSQL("MySQL", "com.mysql.jdbc.Driver",
|
|
|
|
|
MYSQL("mysql", "MySQL", "com.mysql.jdbc.Driver",
|
|
|
|
|
"com.mysql.jdbc.jdbc2.optional.MysqlXADataSource", "SELECT 1"),
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Maria DB.
|
|
|
|
|
*/
|
|
|
|
|
MARIADB("MySQL", "org.mariadb.jdbc.Driver", "org.mariadb.jdbc.MariaDbDataSource",
|
|
|
|
|
"SELECT 1"),
|
|
|
|
|
MARIADB("maridb", "MySQL", "org.mariadb.jdbc.Driver",
|
|
|
|
|
"org.mariadb.jdbc.MariaDbDataSource", "SELECT 1"),
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Google App Engine.
|
|
|
|
|
*/
|
|
|
|
|
GAE(null, "com.google.appengine.api.rdbms.AppEngineDriver"),
|
|
|
|
|
GAE("gae", null, "com.google.appengine.api.rdbms.AppEngineDriver"),
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Oracle.
|
|
|
|
|
*/
|
|
|
|
|
ORACLE("Oracle", "oracle.jdbc.OracleDriver",
|
|
|
|
|
ORACLE("oracle", "Oracle", "oracle.jdbc.OracleDriver",
|
|
|
|
|
"oracle.jdbc.xa.client.OracleXADataSource", "SELECT 'Hello' from DUAL"),
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Postgres.
|
|
|
|
|
*/
|
|
|
|
|
POSTGRESQL("PostgreSQL", "org.postgresql.Driver", "org.postgresql.xa.PGXADataSource",
|
|
|
|
|
"SELECT 1"),
|
|
|
|
|
POSTGRESQL("postgresql", "PostgreSQL", "org.postgresql.Driver",
|
|
|
|
|
"org.postgresql.xa.PGXADataSource", "SELECT 1"),
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* jTDS. As it can be used for several databases, there isn't a single product name we
|
|
|
|
|
* could rely on.
|
|
|
|
|
*/
|
|
|
|
|
JTDS(null, "net.sourceforge.jtds.jdbc.Driver"),
|
|
|
|
|
JTDS("jtds", null, "net.sourceforge.jtds.jdbc.Driver"),
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SQL Server.
|
|
|
|
|
*/
|
|
|
|
|
SQLSERVER("SQL SERVER", "com.microsoft.sqlserver.jdbc.SQLServerDriver",
|
|
|
|
|
SQLSERVER("sqlserver", "SQL SERVER", "com.microsoft.sqlserver.jdbc.SQLServerDriver",
|
|
|
|
|
"com.microsoft.sqlserver.jdbc.SQLServerXADataSource", "SELECT 1"),
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Firebird.
|
|
|
|
|
*/
|
|
|
|
|
FIREBIRD("Firebird", "org.firebirdsql.jdbc.FBDriver",
|
|
|
|
|
FIREBIRD("firebird", "Firebird", "org.firebirdsql.jdbc.FBDriver",
|
|
|
|
|
"org.firebirdsql.pool.FBConnectionPoolDataSource",
|
|
|
|
|
"SELECT 1 FROM RDB$DATABASE") {
|
|
|
|
|
|
|
|
|
@ -117,7 +117,7 @@ public enum DatabaseDriver {
|
|
|
|
|
/**
|
|
|
|
|
* DB2 Server.
|
|
|
|
|
*/
|
|
|
|
|
DB2("DB2", "com.ibm.db2.jcc.DB2Driver", "com.ibm.db2.jcc.DB2XADataSource",
|
|
|
|
|
DB2("db2", "DB2", "com.ibm.db2.jcc.DB2Driver", "com.ibm.db2.jcc.DB2XADataSource",
|
|
|
|
|
"SELECT 1 FROM SYSIBM.SYSDUMMY1") {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -130,7 +130,7 @@ public enum DatabaseDriver {
|
|
|
|
|
/**
|
|
|
|
|
* DB2 AS400 Server.
|
|
|
|
|
*/
|
|
|
|
|
DB2_AS400("DB2 UDB for AS/400", "com.ibm.as400.access.AS400JDBCDriver",
|
|
|
|
|
DB2_AS400("db2", "DB2 UDB for AS/400", "com.ibm.as400.access.AS400JDBCDriver",
|
|
|
|
|
"com.ibm.as400.access.AS400JDBCXADataSource",
|
|
|
|
|
"SELECT 1 FROM SYSIBM.SYSDUMMY1") {
|
|
|
|
|
|
|
|
|
@ -144,14 +144,16 @@ public enum DatabaseDriver {
|
|
|
|
|
/**
|
|
|
|
|
* Teradata.
|
|
|
|
|
*/
|
|
|
|
|
TERADATA("Teradata", "com.teradata.jdbc.TeraDriver"),
|
|
|
|
|
TERADATA("teradata", "Teradata", "com.teradata.jdbc.TeraDriver"),
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Informix.
|
|
|
|
|
*/
|
|
|
|
|
INFORMIX("Informix Dynamic Server", "com.informix.jdbc.IfxDriver", null,
|
|
|
|
|
INFORMIX("informix", "Informix Dynamic Server", "com.informix.jdbc.IfxDriver", null,
|
|
|
|
|
"select count(*) from systables");
|
|
|
|
|
|
|
|
|
|
private final String id;
|
|
|
|
|
|
|
|
|
|
private final String productName;
|
|
|
|
|
|
|
|
|
|
private final String driverClassName;
|
|
|
|
@ -160,22 +162,32 @@ public enum DatabaseDriver {
|
|
|
|
|
|
|
|
|
|
private final String validationQuery;
|
|
|
|
|
|
|
|
|
|
DatabaseDriver(String name, String driverClassName) {
|
|
|
|
|
this(name, driverClassName, null);
|
|
|
|
|
DatabaseDriver(String id, String name, String driverClassName) {
|
|
|
|
|
this(id, name, driverClassName, null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DatabaseDriver(String name, String driverClassName, String xaDataSourceClassName) {
|
|
|
|
|
this(name, driverClassName, xaDataSourceClassName, null);
|
|
|
|
|
DatabaseDriver(String id, String name, String driverClassName,
|
|
|
|
|
String xaDataSourceClassName) {
|
|
|
|
|
this(id, name, driverClassName, xaDataSourceClassName, null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DatabaseDriver(String productName, String driverClassName,
|
|
|
|
|
DatabaseDriver(String id, String productName, String driverClassName,
|
|
|
|
|
String xaDataSourceClassName, String validationQuery) {
|
|
|
|
|
this.id = id;
|
|
|
|
|
this.productName = productName;
|
|
|
|
|
this.driverClassName = driverClassName;
|
|
|
|
|
this.xaDataSourceClassName = xaDataSourceClassName;
|
|
|
|
|
this.validationQuery = validationQuery;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return the identifier of this driver.
|
|
|
|
|
* @return the identifier
|
|
|
|
|
*/
|
|
|
|
|
public String getId() {
|
|
|
|
|
return this.id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected boolean matchProductName(String productName) {
|
|
|
|
|
return this.productName != null && this.productName.equalsIgnoreCase(productName);
|
|
|
|
|
}
|
|
|
|
|