public class DBIFactory extends Object
| Constructor and Description |
|---|
DBIFactory() |
| Modifier and Type | Method and Description |
|---|---|
org.skife.jdbi.v2.DBI |
build(io.dropwizard.setup.Environment environment,
io.dropwizard.db.PooledDataSourceFactory configuration,
io.dropwizard.db.ManagedDataSource dataSource,
String name)
Build a fully configured DBI instance managed by the DropWizard lifecycle
with the configured health check; this method should not be overridden
(instead, override
configure(DBI, PooledDataSourceFactory) and/or
newInstance(ManagedDataSource)) |
org.skife.jdbi.v2.DBI |
build(io.dropwizard.setup.Environment environment,
io.dropwizard.db.PooledDataSourceFactory configuration,
String name)
Build a fully configured DBI instance managed by the DropWizard lifecycle
with the configured health check; this method should not be overridden
(instead, override
configure(DBI, PooledDataSourceFactory) and/or
newInstance(ManagedDataSource)) |
protected void |
configure(org.skife.jdbi.v2.DBI dbi,
io.dropwizard.db.PooledDataSourceFactory configuration)
This method sets the default column mapper and argument factories
|
protected Optional<TimeZone> |
databaseTimeZone()
Get a time zone of a database
|
protected org.skife.jdbi.v2.DBI |
newInstance(io.dropwizard.db.ManagedDataSource dataSource)
This creates a vanilla DBI instance based on the specified data source;
this can be overridden if required
|
protected Optional<TimeZone> databaseTimeZone()
Override this method to specify a time zone of a database
to use in JodaDateTimeMapper and
JodaDateTimeArgument
It's needed for cases when the database operates in a different time zone then the application and it doesn't use the SQL type `TIMESTAMP WITH TIME ZONE`. It such cases information about the time zone should explicitly passed to the JDBC driver
public org.skife.jdbi.v2.DBI build(io.dropwizard.setup.Environment environment,
io.dropwizard.db.PooledDataSourceFactory configuration,
String name)
configure(DBI, PooledDataSourceFactory) and/or
newInstance(ManagedDataSource))environment - configuration - name - DBI object using a managed data source
based on the specified environment and configurationbuild(Environment, PooledDataSourceFactory, ManagedDataSource,
String)public org.skife.jdbi.v2.DBI build(io.dropwizard.setup.Environment environment,
io.dropwizard.db.PooledDataSourceFactory configuration,
io.dropwizard.db.ManagedDataSource dataSource,
String name)
configure(DBI, PooledDataSourceFactory) and/or
newInstance(ManagedDataSource))environment - configuration - dataSource - name - DBI objectprotected org.skife.jdbi.v2.DBI newInstance(io.dropwizard.db.ManagedDataSource dataSource)
dataSource - protected void configure(org.skife.jdbi.v2.DBI dbi,
io.dropwizard.db.PooledDataSourceFactory configuration)
if this is overridden it is strongly recommend that
super.configure(dbi, configuration) is invoked before any other
changes are made if you intend to use the default as a base so that the
customized argument settings will supersede the defaults
dbi - configuration - Copyright © 2023. All rights reserved.