Enum DatabaseType
- java.lang.Object
-
- java.lang.Enum<DatabaseType>
-
- net.sf.jsqlparser.util.validation.feature.DatabaseType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<DatabaseType>
,FeatureSet
,FeatureSetValidation
,Version
,ValidationCapability
public enum DatabaseType extends java.lang.Enum<DatabaseType> implements FeatureSetValidation, Version
The DatabaseType is named like the identifier used within the jdbc-connection-url (upper case), this may change in future, therefore use
get(String)
to retrieve theDatabaseType
.
-
-
Field Summary
Fields Modifier and Type Field Description static DatabaseType[]
DATABASES
private java.lang.String
name
private Version[]
versions
-
Fields inherited from interface net.sf.jsqlparser.util.validation.feature.FeatureSetValidation
DEFAULT_NAME
-
-
Constructor Summary
Constructors Modifier Constructor Description private
DatabaseType(java.lang.String name, Version... versions)
private
DatabaseType(Version... versions)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DatabaseType
get(java.lang.String jdbcIdentifier)
java.util.Set<Feature>
getFeatures()
java.lang.String
getName()
java.lang.String
getVersionString()
static DatabaseType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static DatabaseType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface net.sf.jsqlparser.parser.feature.FeatureSet
contains, copy, getFeaturesClone, getNotContained, retainAll
-
Methods inherited from interface net.sf.jsqlparser.util.validation.feature.FeatureSetValidation
validate
-
Methods inherited from interface net.sf.jsqlparser.util.validation.ValidationCapability
toError, toError
-
Methods inherited from interface net.sf.jsqlparser.util.validation.feature.Version
getMessage
-
-
-
-
Enum Constant Detail
-
ANSI_SQL
public static final DatabaseType ANSI_SQL
-
ORACLE
public static final DatabaseType ORACLE
-
MYSQL
public static final DatabaseType MYSQL
-
SQLSERVER
public static final DatabaseType SQLSERVER
-
MARIADB
public static final DatabaseType MARIADB
-
POSTGRESQL
public static final DatabaseType POSTGRESQL
-
H2
public static final DatabaseType H2
-
-
Field Detail
-
DATABASES
public static final DatabaseType[] DATABASES
-
name
private java.lang.String name
-
versions
private Version[] versions
-
-
Constructor Detail
-
DatabaseType
private DatabaseType(Version... versions)
- Parameters:
versions
- - ordered ascending - the last version is the latest.
-
DatabaseType
private DatabaseType(java.lang.String name, Version... versions)
- Parameters:
versions
- - ordered ascending - the last version is the latest.
-
-
Method Detail
-
values
public static DatabaseType[] 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 (DatabaseType c : DatabaseType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DatabaseType 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 namejava.lang.NullPointerException
- if the argument is null
-
get
public static DatabaseType get(java.lang.String jdbcIdentifier)
- Parameters:
jdbcIdentifier
- - the database-identifier-part of jdbc-url- Returns:
- the
DatabaseType
- Throws:
java.lang.IllegalArgumentException
- - if the specified jdbcIdentifier cannot be mapped to aDatabaseType
java.lang.NullPointerException
- ifjdbcIdentifier
is null
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceFeatureSetValidation
- Specified by:
getName
in interfaceValidationCapability
- Returns:
- a name of this
ValidationCapability
-
getFeatures
public java.util.Set<Feature> getFeatures()
- Specified by:
getFeatures
in interfaceFeatureSet
- Specified by:
getFeatures
in interfaceFeatureSetValidation
- Returns:
- the features supported by the latest version.
-
getVersionString
public java.lang.String getVersionString()
- Specified by:
getVersionString
in interfaceVersion
- Returns:
- the latest version-string.
-
-