Enum Class DatabaseType

java.lang.Object
java.lang.Enum<DatabaseType>
com.atlassian.bamboo.utils.db.DatabaseType
All Implemented Interfaces:
Serializable, Comparable<DatabaseType>, Constable

public enum DatabaseType extends Enum<DatabaseType>
Inspired by BitbucketServer's DbType class
  • Enum Constant Details

  • Method Details

    • values

      public static DatabaseType[] 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

      public static DatabaseType valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • fromDialect

      public static DatabaseType fromDialect(@NotNull @NotNull String hibernateDialect)
    • getKey

      public String getKey()
    • getI18nKey

      public String getI18nKey()
      Since:
      6.3
    • getProtocol

      public String getProtocol()
    • getDriverClassName

      public String 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 running
      database - 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 running
      database - the name of the database, or alternatively its service identifier
      port - the port on which the database can be accessed at the hostName
      Returns:
      a new string that can be used as a JDBC URL when accessing databases of this type