public DefaultDSLContext(Connection connection, SQLDialect dialect, Settings settings) { this(new DefaultConfiguration(new DefaultConnectionProvider(connection), null, null, null, null, dialect, settings, null)); }
public DefaultDSLContext(Connection connection, SQLDialect dialect, Settings settings) { this(new DefaultConfiguration(new DefaultConnectionProvider(connection), null, null, null, null, null, null, null, null, null, null, null, null, dialect, settings, null)); }
/** * Convenience method for {@link #derive(ConnectionProvider)}, using a * {@link DefaultConnectionProvider}. */ public final Configuration derive(Connection newConnection) { return derive(new DefaultConnectionProvider(newConnection)); }
/** * Convenience method for {@link #set(ConnectionProvider)}, using a * {@link DefaultConnectionProvider}. */ public final Configuration set(Connection newConnection) { return set(new DefaultConnectionProvider(newConnection)); }
@Override public final Configuration set(Connection newConnection) { return set(new DefaultConnectionProvider(newConnection)); }
public ConnectionOwnerDslContext(Connection connection, SQLDialect dialect) { this.connection = connection; this.delegate = DSL.using(new DefaultConnectionProvider(connection), dialect); }
@Override public final Configuration derive(Connection newConnection) { return derive(new DefaultConnectionProvider(newConnection)); }
public ConnectionOwnerDslContext(DataSource datasource, SQLDialect dialect) { try { this.connection = datasource.getConnection(); this.delegate = DSL.using(new DefaultConnectionProvider(connection), dialect); } catch (SQLException ex) { throw new UncheckedException(ex); } }
private final DefaultConnectionProvider connection(Configuration configuration) { DefaultConnectionProvider connectionWrapper = (DefaultConnectionProvider) configuration.data(DATA_DEFAULT_TRANSACTION_PROVIDER_CONNECTION); if (connectionWrapper == null) { connectionWrapper = new DefaultConnectionProvider(connectionProvider.acquire()); configuration.data(DATA_DEFAULT_TRANSACTION_PROVIDER_CONNECTION, connectionWrapper); } return connectionWrapper; }
/** * Create an executor from a JDBC connection URL. * <p> * Clients must ensure connections are closed properly by calling * {@link DSLContext#close()} on the resulting {@link DSLContext}. For * example: * <p> * <code><pre> * // Auto-closing DSLContext instance to free resources * try (DSLContext ctx = DSL.using("jdbc:h2:~/test")) { * * // ... * } * </pre></code> * * @param url The connection URL. * @see DefaultConnectionProvider * @see JDBCUtils#dialect(String) */ public static DSLContext using(String url) { try { Connection connection = DriverManager.getConnection(url); return using(new DefaultConnectionProvider(connection, true), JDBCUtils.dialect(connection)); } catch (SQLException e) { throw Tools.translate("Error when initialising Connection", e); } }
/** * Create an executor from a JDBC connection URL. * <p> * Clients must ensure connections are closed properly by calling * {@link DSLContext#close()} on the resulting {@link DSLContext}. For * example: * <p> * <code><pre> * // Auto-closing DSLContext instance to free resources * try (DSLContext ctx = DSL.using("jdbc:h2:~/test", "sa", "")) { * * // ... * } * </pre></code> * * @param url The connection URL. * @param username The connection user name. * @param password The connection password. * @see DefaultConnectionProvider * @see JDBCUtils#dialect(String) */ public static DSLContext using(String url, String username, String password) { try { Connection connection = DriverManager.getConnection(url, username, password); return using(new DefaultConnectionProvider(connection, true), JDBCUtils.dialect(connection)); } catch (SQLException e) { throw Tools.translate("Error when initialising Connection", e); } }
/** * Create an executor from a JDBC connection URL. * <p> * Clients must ensure connections are closed properly by calling * {@link DSLContext#close()} on the resulting {@link DSLContext}. For * example: * <p> * <code><pre> * // Auto-closing DSLContext instance to free resources * try (DSLContext ctx = DSL.using("jdbc:h2:~/test", properties)) { * * // ... * } * </pre></code> * * @param url The connection URL. * @param properties The connection properties. * @see DefaultConnectionProvider * @see JDBCUtils#dialect(String) */ public static DSLContext using(String url, Properties properties) { try { Connection connection = DriverManager.getConnection(url, properties); return using(new DefaultConnectionProvider(connection, true), JDBCUtils.dialect(connection)); } catch (SQLException e) { throw Tools.translate("Error when initialising Connection", e); } }
final ConnectionProvider connectionProvider = new DefaultConnectionProvider(connection); final SQLDialect sqlDialect = SQLDialect.valueOf(context.getString(CONF_SQL_DIALECT).toUpperCase(Locale.ENGLISH));
private static void initInternal(final Vertx vertx, final String name) { vertxRef = vertx; Fn.pool(CONFIGS, name, () -> Infix.init(Plugins.Infix.JOOQ, (config) -> { // Initialized client final Configuration configuration = new DefaultConfiguration(); configuration.set(SQLDialect.MYSQL_5_7); final ConnectionProvider provider = new DefaultConnectionProvider(HikariCpPool.getConnection( config.getJsonObject("provider") )); // Initialized default configuration configuration.set(provider); return configuration; }, JooqInfix.class)); }