Package org.springframework.boot.r2dbc
Enum Class EmbeddedDatabaseConnection
java.lang.Object
java.lang.Enum<EmbeddedDatabaseConnection>
org.springframework.boot.r2dbc.EmbeddedDatabaseConnection
- All Implemented Interfaces:
Serializable
,Comparable<EmbeddedDatabaseConnection>
,Constable
Connection details for embedded databases compatible with R2DBC.
- Since:
- 2.5.0
- Author:
- Mark Paluch, Stephane Nicoll
-
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 EmbeddedDatabaseConnection
get
(ClassLoader classLoader) Returns the most suitableEmbeddedDatabaseConnection
for the given class loader.Returns the driver class name.Returns the R2DBC URL for the connection using the specifieddatabaseName
.static boolean
isEmbedded
(io.r2dbc.spi.ConnectionFactory connectionFactory) Convenience method to determine if a given connection factory represents an embedded database type.static EmbeddedDatabaseConnection
Returns the enum constant of this class with the specified name.static EmbeddedDatabaseConnection[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
No Connection. -
H2
H2 Database Connection.
-
-
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
-
getDriverClassName
Returns the driver class name.- Returns:
- the driver class name
-
getUrl
Returns the R2DBC URL for the connection using the specifieddatabaseName
.- Parameters:
databaseName
- the name of the database- Returns:
- the connection URL
-
get
Returns the most suitableEmbeddedDatabaseConnection
for the given class loader.- Parameters:
classLoader
- the class loader used to check for classes- Returns:
- an
EmbeddedDatabaseConnection
orNONE
.
-
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
-