org.jooq.tools.jdbc.JDBCUtils Java Examples

The following examples show how to use org.jooq.tools.jdbc.JDBCUtils. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JooqConfigurationProperties.java    From micronaut-sql with Apache License 2.0 5 votes vote down vote up
/**
 * Resolve {@link SQLDialect} to be used for the data source.
 * If SQL dialect is not set explicitly, automatic detection will be done.
 *
 * @param dataSource data source for automatic detection
 * @return Effective SQL dialect
 */
public SQLDialect determineSqlDialect(DataSource dataSource) {
    if (this.sqlDialect != null) {
        return this.sqlDialect;
    }
    if (dataSource == null) {
        return SQLDialect.DEFAULT;
    }
    try (Connection connection = dataSource.getConnection()) {
        return JDBCUtils.dialect(connection);
    } catch (SQLException e) {
        throw new RuntimeException(e);
    }
}
 
Example #2
Source File: JooqFactory.java    From droptools with Apache License 2.0 5 votes vote down vote up
private SQLDialect determineDialect(PooledDataSourceFactory dataSourceFactory, ManagedDataSource dataSource) {
    // If a dialect was specified, great!
    if (getDialect().isPresent()) {
        return dialect.get();
    }

    return JDBCUtils.dialect(dataSourceFactory.getUrl());
}
 
Example #3
Source File: AbstractJdbcPollInputOperator.java    From attic-apex-malhar with Apache License 2.0 4 votes vote down vote up
protected DSLContext createDSLContext()
{
  return DSL.using(store.getConnection(), JDBCUtils.dialect(store.getDatabaseUrl()));
}