public abstract static class JdbcIO.DataSourceConfiguration
extends java.lang.Object
implements java.io.Serializable
DataSource
, either providing directly a DataSource
or all
properties allowing to create a DataSource
.Constructor and Description |
---|
DataSourceConfiguration() |
Modifier and Type | Method and Description |
---|---|
static JdbcIO.DataSourceConfiguration |
create(javax.sql.DataSource dataSource) |
static JdbcIO.DataSourceConfiguration |
create(java.lang.String driverClassName,
java.lang.String url) |
static JdbcIO.DataSourceConfiguration |
create(ValueProvider<java.lang.String> driverClassName,
ValueProvider<java.lang.String> url) |
JdbcIO.DataSourceConfiguration |
withConnectionInitSqls(java.util.Collection<java.lang.String> connectionInitSqls)
Sets the connection init sql statements to driver.connect(...).
|
JdbcIO.DataSourceConfiguration |
withConnectionInitSqls(ValueProvider<java.util.Collection<java.lang.String>> connectionInitSqls)
Same as
withConnectionInitSqls(Collection) but accepting a ValueProvider. |
JdbcIO.DataSourceConfiguration |
withConnectionProperties(java.lang.String connectionProperties)
Sets the connection properties passed to driver.connect(...).
|
JdbcIO.DataSourceConfiguration |
withConnectionProperties(ValueProvider<java.lang.String> connectionProperties)
Same as
withConnectionProperties(String) but accepting a ValueProvider. |
JdbcIO.DataSourceConfiguration |
withPassword(java.lang.String password) |
JdbcIO.DataSourceConfiguration |
withPassword(ValueProvider<java.lang.String> password) |
JdbcIO.DataSourceConfiguration |
withUsername(java.lang.String username) |
JdbcIO.DataSourceConfiguration |
withUsername(ValueProvider<java.lang.String> username) |
public static JdbcIO.DataSourceConfiguration create(javax.sql.DataSource dataSource)
public static JdbcIO.DataSourceConfiguration create(java.lang.String driverClassName, java.lang.String url)
public static JdbcIO.DataSourceConfiguration create(ValueProvider<java.lang.String> driverClassName, ValueProvider<java.lang.String> url)
public JdbcIO.DataSourceConfiguration withUsername(java.lang.String username)
public JdbcIO.DataSourceConfiguration withUsername(ValueProvider<java.lang.String> username)
public JdbcIO.DataSourceConfiguration withPassword(java.lang.String password)
public JdbcIO.DataSourceConfiguration withPassword(ValueProvider<java.lang.String> password)
public JdbcIO.DataSourceConfiguration withConnectionProperties(java.lang.String connectionProperties)
NOTE - The "user" and "password" properties can be add via withUsername(String)
,
withPassword(String)
, so they do not need to be included here.
public JdbcIO.DataSourceConfiguration withConnectionProperties(ValueProvider<java.lang.String> connectionProperties)
withConnectionProperties(String)
but accepting a ValueProvider.public JdbcIO.DataSourceConfiguration withConnectionInitSqls(java.util.Collection<java.lang.String> connectionInitSqls)
NOTE - This property is not applicable across databases. Only MySQL and MariaDB support this. A Sql exception is thrown if your database does not support it.
public JdbcIO.DataSourceConfiguration withConnectionInitSqls(ValueProvider<java.util.Collection<java.lang.String>> connectionInitSqls)
withConnectionInitSqls(Collection)
but accepting a ValueProvider.