Package de.xima.fc.persistence
Enum Dbms
- java.lang.Object
-
- java.lang.Enum<Dbms>
-
- de.xima.fc.persistence.Dbms
-
- All Implemented Interfaces:
Serializable,Comparable<Dbms>
public enum Dbms extends Enum<Dbms>
Enumeration of known Database Management Systems (DBMS). No guarantee is given that all DBMS are covered.- Since:
- 8.5.0
- Author:
- Norman Lorenz
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptsUrl(String jdbcUrl)static DbmsfromDriverClass(Class<? extends Driver> driverClass)Try to detect the DBMS from a JDBC Driver class.static DbmsfromJdbcUrl(String jdbcUrl)Try to detect the DBMS from a JDBC URL prefix.StringgetDisplayName()StringgetDriverClassName()StringgetLogoContentType()InputStreamgetLogoInputStream()Gets an InputStream for the logo resource of the DBMS.StringgetShortName()static DbmsvalueOf(String name)Returns the enum constant of this type with the specified name.static Dbms[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Method Detail
-
values
public static Dbms[] 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 (Dbms c : Dbms.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Dbms 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
-
acceptsUrl
public boolean acceptsUrl(String jdbcUrl)
-
fromDriverClass
public static Dbms fromDriverClass(Class<? extends Driver> driverClass)
Try to detect the DBMS from a JDBC Driver class.- Parameters:
driverClass- JDBC Driver class- Returns:
- matching Dbms or null if unknown
- Throws:
IllegalArgumentException- if driverClass is null
-
fromJdbcUrl
public static Dbms fromJdbcUrl(String jdbcUrl)
Try to detect the DBMS from a JDBC URL prefix.- Parameters:
jdbcUrl- JDBC URL (e.g. "jdbc:postgresql://localhost/test")- Returns:
- matching Dbms or null if unknown
- Throws:
IllegalArgumentException- if jdbcUrl is invalid
-
getLogoInputStream
public InputStream getLogoInputStream()
Gets an InputStream for the logo resource of the DBMS.- Returns:
- InputStream of the logo resource
-
getShortName
public String getShortName()
-
getDisplayName
public String getDisplayName()
-
getDriverClassName
public String getDriverClassName()
-
getLogoContentType
public String getLogoContentType()
-
-