use of org.jooq.impl.DataSourceConnectionProvider in project curiostack by curioswitch.
the class DatabaseModule method dbContext.
@Provides
@Singleton
static DSLContext dbContext(DataSource dataSource, @ForDatabase ListeningExecutorService dbExecutor) {
Configuration configuration = new DefaultConfiguration().set(dbExecutor).set(SQLDialect.MYSQL).set(new Settings().withRenderSchema(false)).set(new DataSourceConnectionProvider(dataSource)).set(DatabaseUtil.sfmRecordMapperProvider());
DSLContext ctx = DSL.using(configuration);
// Eagerly trigger JOOQ classinit for better startup performance.
ctx.select().from("curio_server_framework_init").getSQL();
return ctx;
}
use of org.jooq.impl.DataSourceConnectionProvider in project collect by openforis.
the class ApplicationInitializerServletContextListener method initDB.
private void initDB() {
LOG.info("========Open Foris Collect - Starting DB initialization ========");
DataSourceConnectionProvider connectionProvider = new DataSourceConnectionProvider(DbUtils.getDataSource());
new DbInitializer(connectionProvider).start();
LOG.info("========Open Foris Collect - DB Initialized ====================");
}
Aggregations