Package io.micronaut.jdbc
Class JdbcDatabaseManager
java.lang.Object
io.micronaut.jdbc.JdbcDatabaseManager
Stores information on popular JDBC drivers.
- Since:
- 1.0
- Author:
- James Kleeh
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
ExtendsJdbcDatabaseManager.JdbcDatabase
with additional defaults for the use of embedded databases such as H2.static class
Provides the required information in order to connect toa JDBC database, including the necessary driver and validation query. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfindDatabase
(String jdbcUrl) Searches defined database where the URL prefix matches one of the prefixes defined in aJdbcDatabaseManager.JdbcDatabase
.get
(ClassLoader classLoader) Searches the provided classloader for an embedded database driver.static boolean
isEmbedded
(String driverClassName) Searches embedded databases where the driver matches the argument.
-
Constructor Details
-
JdbcDatabaseManager
public JdbcDatabaseManager()
-
-
Method Details
-
findDatabase
Searches defined database where the URL prefix matches one of the prefixes defined in aJdbcDatabaseManager.JdbcDatabase
. The prefix is determined by:jdbc:prefix:...
- Parameters:
jdbcUrl
- The connection URL- Returns:
- An optional
JdbcDatabaseManager.JdbcDatabase
-
get
Searches the provided classloader for an embedded database driver.- Parameters:
classLoader
- The classloader to search- Returns:
- An optional
JdbcDatabaseManager.EmbeddedJdbcDatabase
-
isEmbedded
Searches embedded databases where the driver matches the argument.- Parameters:
driverClassName
- The driver class name to search on- Returns:
- True if the driver matches an embedded database type
-