Java 类org.jooq.impl.DefaultExecuteListenerProvider 实例源码

项目:cattle    文件:Bootstrap.java   
private void setupDatabase() {
    System.setProperty("org.jooq.no-logo", "true");

    dataSource = dataSourceFactory.createDataSource("cattle");

    DataSourceConnectionProvider dscp = new DataSourceConnectionProvider(dataSource);
    ThreadLocalTransactionProvider tp = new ThreadLocalTransactionProvider(dscp, false);

    LoggerListener logger = new LoggerListener();
    logger.setMaxLength(1000);

    ExecuteListener[] listeners = new ExecuteListener[] { logger, new StopWatchListener() };
    Settings settings = dbSetting("cattle");
    jooqConfig = new DefaultConfiguration()
            .set(getSQLDialect("cattle"))
            .set(settings)
            .set(dscp)
            .set(tp)
            .set(DefaultExecuteListenerProvider.providers(listeners));
}
项目:jooq-flyway-typesafe-migration    文件:JooqMigration.java   
@Override
public final void migrate(Connection connection) throws Exception {
    didExecute = true;
    SQLDialect dialect = JDBCUtils.dialect(connection);
    if (SQLDialect.DEFAULT.equals(dialect))
        throw new IllegalStateException("Dialect couldn't be deducted from connection " + connection);

    Configuration configuration = new DefaultConfiguration().set(connection).set(dialect);
    DdlExecuteListener listener = new DdlExecuteListener();
    configuration.set(new DefaultExecuteListenerProvider(listener));
    DSLContext create = DSL.using(configuration);

    migrate(connection, create);
    ddlInstructionExecuted = listener.ddlInstructionExecuted();
}
项目:modules-main    文件:MySQLDatabase.java   
@Override
public DSLContext getDSL()
{
    Configuration conf = new DefaultConfiguration()
            .set(SQLDialect.MYSQL)
            .set(new DataSourceConnectionProvider(this.dataSource))
            .set(new DefaultExecuteListenerProvider(jooqLogger))
            .set(settings)
            .set(new DefaultVisitListenerProvider(new TablePrefixer(getTablePrefix())));
    return DSL.using(conf);
}
项目:cloud-cattle    文件:Configuration.java   
@PostConstruct
public void init() {
    String prop = "db." + name + ".database";
    String database = ArchaiusUtil.getString(prop).get();
    if ( database == null ) {
        throw new IllegalStateException("Failed to find config for [" + prop + "]");
    }

    try {
        SQLDialect dialect = SQLDialect.valueOf(database.trim().toUpperCase());
        set(dialect);
    } catch ( IllegalArgumentException e ) {
        throw new IllegalArgumentException("Invalid SQLDialect [" + database.toUpperCase() + "]", e);
    }

    if ( connectionProvider == null ) {
        set(new AutoCommitConnectionProvider(dataSource));
    } else {
        set(connectionProvider);
    }

    settings.setRenderSchema(false);

    String renderNameStyle = ArchaiusUtil.getString("db." + name + "." + database + ".render.name.style").get();
    if ( renderNameStyle != null ) {
        settings.setRenderNameStyle(RenderNameStyle.valueOf(renderNameStyle.trim().toUpperCase()));
    }

    set(settings);

    if ( listeners != null && listeners.size() > 0 ) {
        settings().setExecuteLogging(false);
        set(DefaultExecuteListenerProvider.providers(listeners.toArray(new ExecuteListener[listeners.size()])));
    }
}
项目:dstack    文件:Configuration.java   
@PostConstruct
public void init() {
    String prop = "db." + name + ".database";
    String database = ArchaiusUtil.getString(prop).get();
    if ( database == null ) {
        throw new IllegalStateException("Failed to find config for [" + prop + "]");
    }

    try {
        SQLDialect dialect = SQLDialect.valueOf(database.trim().toUpperCase());
        set(dialect);
    } catch ( IllegalArgumentException e ) {
        throw new IllegalArgumentException("Invalid SQLDialect [" + database.toUpperCase() + "]", e);
    }

    if ( connectionProvider == null ) {
        set(new AutoCommitConnectionProvider(dataSource));
    } else {
        set(connectionProvider);
    }

    Settings settings = new Settings();
    settings.setRenderSchema(false);

    String renderNameStyle = ArchaiusUtil.getString("db." + name + "." + database + ".render.name.style").get();
    if ( renderNameStyle != null ) {
        settings.setRenderNameStyle(RenderNameStyle.valueOf(renderNameStyle.trim().toUpperCase()));
    }

    set(settings);

    if ( listeners != null && listeners.size() > 0 ) {
        settings().setExecuteLogging(false);
        set(DefaultExecuteListenerProvider.providers(listeners.toArray(new ExecuteListener[listeners.size()])));
    }
}
项目:AdvancedDataProfilingSeminar    文件:Helper.java   
private static void setUpIntrospection(final DSLContext context) {
  context.configuration().set(new DefaultExecuteListenerProvider(new DebugExecuteListener()));
}
项目:zipkin    文件:TraceZipkinMySQLStorageAutoConfiguration.java   
@Bean ExecuteListenerProvider tracingExecuteListenerProvider() {
  return new DefaultExecuteListenerProvider(this);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:JooqAutoConfiguration.java   
@Bean
public DefaultExecuteListenerProvider jooqExceptionTranslatorExecuteListenerProvider() {
    return new DefaultExecuteListenerProvider(new JooqExceptionTranslator());
}
项目:spring-boot-concourse    文件:JooqAutoConfiguration.java   
@Bean
public DefaultExecuteListenerProvider jooqExceptionTranslatorExecuteListenerProvider() {
    return new DefaultExecuteListenerProvider(new JooqExceptionTranslator());
}
项目:contestparser    文件:JooqAutoConfiguration.java   
@Bean
public DefaultExecuteListenerProvider jooqExceptionTranslatorExecuteListenerProvider() {
    return new DefaultExecuteListenerProvider(new JooqExceptionTranslator());
}