public interface ConnectionProvider
An H2 server (internal) database will be provided, unless the user specifies an external database via system properties:
refapp.jdbc.external set this to true to use an external database
refapp.jdbc.driver.class.name Driver implementation to use
refapp.jdbc.app.url mandatory jdbc url
refapp.jdbc.app.schema optional jdbc schema - don't specify if you don't use a schema e.g. mysql, however must still be specified for all other databases; don't rely on the default schema
refapp.jdbc.app.user mandatory jdbc user
refapp.jdbc.app.pass mandatory jdbc password
refapp.jdbc.app.val.query optional validation query for drivers that don't support Connection.isValid(int)
| Modifier and Type | Method and Description |
|---|---|
Connection |
connection()
Provides a connection from a pool.
|
DataSource |
dataSource()
Provides the
DataSource used to source any database connections |
String |
driverClassName()
Returns the configured database driver class name
|
Optional<String> |
schema()
Returns the configured schema name (if any)
|
Connection connection() throws SQLException
Users may close the connection. Users may create transactions within the connection.
SQLException - on any failure to provide connectionDataSource dataSource()
DataSource used to source any database connectionsOptional<String> schema()
String driverClassName()
Copyright © 2018 Atlassian. All rights reserved.