org.springframework.boot.r2dbc

Enum EmbeddedDatabaseConnection

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<EmbeddedDatabaseConnection>


    public enum EmbeddedDatabaseConnection
    extends java.lang.Enum<EmbeddedDatabaseConnection>
    Connection details for embedded databases compatible with R2DBC.
    Since:
    2.5.0
    • Enum Constant Summary

      Enum Constants 
      Enum Constant and Description
      H2
      H2 Database Connection.
      NONE
      No Connection.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static EmbeddedDatabaseConnection get(java.lang.ClassLoader classLoader)
      Returns the most suitable EmbeddedDatabaseConnection for the given class loader.
      java.lang.String getDriverClassName()
      Returns the driver class name.
      java.lang.String getUrl(java.lang.String databaseName)
      Returns the R2DBC URL for the connection using the specified databaseName.
      static boolean isEmbedded(io.r2dbc.spi.ConnectionFactory connectionFactory)
      Convenience method to determine if a given connection factory represents an embedded database type.
      static EmbeddedDatabaseConnection valueOf(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static EmbeddedDatabaseConnection[] 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 class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • values

        public static EmbeddedDatabaseConnection[] 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 (EmbeddedDatabaseConnection c : EmbeddedDatabaseConnection.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static EmbeddedDatabaseConnection 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 name
        java.lang.NullPointerException - if the argument is null
      • getDriverClassName

        public java.lang.String getDriverClassName()
        Returns the driver class name.
        Returns:
        the driver class name
      • getUrl

        public java.lang.String getUrl(java.lang.String databaseName)
        Returns the R2DBC URL for the connection using the specified databaseName.
        Parameters:
        databaseName - the name of the database
        Returns:
        the connection URL
      • isEmbedded

        public static boolean isEmbedded(io.r2dbc.spi.ConnectionFactory connectionFactory)
        Convenience method to determine if a given connection factory represents an embedded database type.
        Parameters:
        connectionFactory - the connection factory to interrogate
        Returns:
        true if the connection factory represents an embedded database
        Since:
        2.5.1