Package com.atlassian.bamboo.utils.db
Enum Class DatabaseType
- All Implemented Interfaces:
Serializable
,Comparable<DatabaseType>
,Constable
Inspired by BitbucketServer's DbType class
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic DatabaseType
fromDialect
(@NotNull String hibernateDialect) @NotNull String
generateUrl
(@NotNull String hostName, @NotNull String database) Produces a JDBC URL incorporating the given host name, database name and default port.abstract @NotNull String
generateUrl
(@NotNull String hostName, @NotNull String database, int port) Produces a JDBC URL incorporating the given host name, database name and port.int
getKey()
boolean
static DatabaseType
Returns the enum constant of this class with the specified name.static DatabaseType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
HSQL
Deprecated.since 6.3 HSQL database is no longer supported (H2 is the new in-memory database) -
MSSQL
-
MYSQL
-
ORACLE
-
POSTGRESQL
-
H2
-
-
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
-
fromDialect
-
getKey
-
getI18nKey
- Since:
- 6.3
-
getProtocol
-
getDriverClassName
-
getDefaultPort
public int getDefaultPort() -
isEmbedded
public boolean isEmbedded()- Since:
- 6.3
-
generateUrl
@NotNull public @NotNull String generateUrl(@NotNull @NotNull String hostName, @NotNull @NotNull String database) Produces a JDBC URL incorporating the given host name, database name and default port.- Parameters:
hostName
- the host name of the machine on which the database is runningdatabase
- the name of the database, or alternatively its service identifier- Returns:
- a new string that can be used as a JDBC URL when accessing databases of this type
-
generateUrl
@NotNull public abstract @NotNull String generateUrl(@NotNull @NotNull String hostName, @NotNull @NotNull String database, int port) Produces a JDBC URL incorporating the given host name, database name and port.- Parameters:
hostName
- the host name of the machine on which the database is runningdatabase
- the name of the database, or alternatively its service identifierport
- the port on which the database can be accessed at thehostName
- Returns:
- a new string that can be used as a JDBC URL when accessing databases of this type
-