Enum DatabaseName
- java.lang.Object
-
- java.lang.Enum<DatabaseName>
-
- de.aristaflow.adept2.base.dbaccess.DatabaseName
-
- All Implemented Interfaces:
Serializable
,Comparable<DatabaseName>
public enum DatabaseName extends Enum<DatabaseName>
The names of the database management systems supported by DBAccess. Note that not all of these are supported by every service.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AZURE
Microsoft Azure - needs special handling since the product name provided by JDBC cannot be distinguished from SQL Server.CACHE
Deprecated, for removal: This API element is subject to removal in a future version.UseIRIS
instead.DB2
IBM DB2DERBY
Apache DerbyH2
H2HSQL
HSQLDBIRIS
InterSystems IRISMY_SQL
MySQLORACLE
Oracle DatabasePOSTGRES
PostgreSQLSQL_SERVER
Microsoft SQL Server
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static DatabaseName
getDatabaseName(Connection con)
Detects the database type based on the designated connection.static DatabaseName
getDatabaseNameForProductName(String productName)
Deprecated.UsegetDatabaseName(Connection)
instead to properly detect Azure.String
getProductName()
Gets (part of) the product name returned by the metadata of the database.String
getProviderClass()
Gets the name of the provider class for the database.static DatabaseName
valueOf(String name)
Returns the enum constant of this type with the specified name.static DatabaseName[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DERBY
public static final DatabaseName DERBY
Apache Derby
-
DB2
public static final DatabaseName DB2
IBM DB2
-
ORACLE
public static final DatabaseName ORACLE
Oracle Database
-
SQL_SERVER
public static final DatabaseName SQL_SERVER
Microsoft SQL Server
-
AZURE
public static final DatabaseName AZURE
Microsoft Azure - needs special handling since the product name provided by JDBC cannot be distinguished from SQL Server.
-
POSTGRES
public static final DatabaseName POSTGRES
PostgreSQL
-
HSQL
public static final DatabaseName HSQL
HSQLDB
-
H2
public static final DatabaseName H2
H2
-
MY_SQL
public static final DatabaseName MY_SQL
MySQL
-
CACHE
@Deprecated(since="14.5.0", forRemoval=true) public static final DatabaseName CACHE
Deprecated, for removal: This API element is subject to removal in a future version.UseIRIS
instead.InterSystems Cache
-
IRIS
public static final DatabaseName IRIS
InterSystems IRIS
-
-
Method Detail
-
values
public static DatabaseName[] 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 (DatabaseName c : DatabaseName.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DatabaseName 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
-
getProductName
public String getProductName()
Gets (part of) the product name returned by the metadata of the database.- Returns:
- (Part of) the product name returned by the metadata of the database.
-
getProviderClass
public String getProviderClass()
Gets the name of the provider class for the database.- Returns:
- The name of the provider class for the database.
-
getDatabaseNameForProductName
@Deprecated public static DatabaseName getDatabaseNameForProductName(String productName)
Deprecated.UsegetDatabaseName(Connection)
instead to properly detect Azure.Finds the database name for the given database product name.- Parameters:
productName
- The product name of the database as provided by theDatabaseMetaData
.- Returns:
- The database name for the given database product name or
null
if no database is found for the designated product name.
-
getDatabaseName
public static DatabaseName getDatabaseName(Connection con) throws SQLException
Detects the database type based on the designated connection.- Parameters:
con
- The JDBC connection to be examined.- Returns:
- The detected database name or
null
if the database is not recognised. - Throws:
SQLException
- if a database access error occurs
-
-