Enum Class PrometheusJDBCDriver
java.lang.Object
java.lang.Enum<PrometheusJDBCDriver>
io.github.tonywasher.joceanus.prometheus.database.PrometheusJDBCDriver
- All Implemented Interfaces:
Serializable,Comparable<PrometheusJDBCDriver>,Constable
Database Drivers. Also code that encapsulates differences between databases.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionH2.MariaDB.MySQL.PostgreSQL.SQLServer. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final StringDefaultInstance for SQLExpress.(package private) static final intDefaultPort for MariaDB/MySQL.(package private) static final intDefaultPort for PostgreSQL.(package private) static final intDefaultPort for SQLExpress. -
Method Summary
Modifier and TypeMethodDescriptionbooleanShould we define binary length?booleanShould we explicitly drop indexes?getConnectionString(String pServer, Integer pPort) Get connection string for database create.getConnectionString(String pDatabase, String pServer, Integer pPort) Get connection string.Obtain the database type for the field.Obtain default port.Obtain connection prefix.toString()booleanDetermine whether we use instance.booleanusePort()Determine whether we use port.booleanDetermine whether we use quotes.static PrometheusJDBCDriverReturns the enum constant of this class with the specified name.static PrometheusJDBCDriver[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SQLSERVER
SQLServer. -
POSTGRESQL
PostgreSQL. -
MYSQL
MySQL. -
MARIADB
MariaDB. -
H2
H2.
-
-
Field Details
-
PORT_MARIADB
static final int PORT_MARIADBDefaultPort for MariaDB/MySQL.- See Also:
-
PORT_POSTGRESQL
static final int PORT_POSTGRESQLDefaultPort for PostgreSQL.- See Also:
-
PORT_SQLEXPRESS
static final int PORT_SQLEXPRESSDefaultPort for SQLExpress.- See Also:
-
INSTANCE_SQLEXPRESS
DefaultInstance for SQLExpress.- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
toString
- Overrides:
toStringin classEnum<PrometheusJDBCDriver>
-
useInstance
public boolean useInstance()Determine whether we use instance.- Returns:
- true/false
-
useQuotes
public boolean useQuotes()Determine whether we use quotes.- Returns:
- true/false
-
usePort
public boolean usePort()Determine whether we use port.- Returns:
- true/false
-
getDefaultPort
Obtain default port.- Returns:
- the default port
-
getPrefix
Obtain connection prefix.- Returns:
- the connection prefix
-
getConnectionString
Get connection string.- Parameters:
pDatabase- the databasepServer- the serverpPort- the port- Returns:
- the connection string
-
getConnectionString
Get connection string for database create.- Parameters:
pServer- the serverpPort- the port- Returns:
- the connection string
-
getDatabaseType
Obtain the database type for the field.- Parameters:
pType- the data type- Returns:
- the database column type
-
defineBinaryLength
public boolean defineBinaryLength()Should we define binary length?- Returns:
- true/false
-
explicitDropIndex
public boolean explicitDropIndex()Should we explicitly drop indexes?- Returns:
- true/false
-