public static interface DataSourceBuilder.Builder
DataSource instance builder.| Modifier and Type | Method and Description |
|---|---|
DataSourceBuilder.Builder |
autoCommit(boolean autoCommit)
Set the DataSource connection auto-commit mode.
|
DataSource |
build()
Build the
DataSource. |
DataSourceBuilder.Builder |
database(DatabasePlatform databasePlatform)
Set the database platform to which the DataSource is connected.
|
DataSourceBuilder.Builder |
driverClassName(String driverClassName)
Set the JDBC driver class name.
|
DataSourceBuilder.Builder |
maxPoolSize(int maxPoolSize)
For connection pooling DataSources, set the upper limit of the connections pool.
|
DataSourceBuilder.Builder |
minPoolSize(int minPoolSize)
For connection pooling DataSources, set the lower limit of the connections pool.
|
DataSourceBuilder.Builder |
name(String name)
Set the DataSource instance name, if supported by concrete DataSource implementation.
|
DataSourceBuilder.Builder |
password(String password)
Set the JDBC connection password.
|
DataSourceBuilder.Builder |
type(DataSourceType type)
Set the DataSource type.
|
DataSourceBuilder.Builder |
type(String typeName)
Set the DataSource type name.
|
DataSourceBuilder.Builder |
url(String url)
Set the JDBC connection URL.
|
DataSourceBuilder.Builder |
username(String username)
Set the JDBC connection username.
|
DataSourceBuilder.Builder |
validationQuery(String validationQuery)
For connection pooling DataSources, set the connection validation query.
|
DataSourceBuilder.Builder |
withInitScript(String sqlScript)
Add a SQL intitialization script.
|
DataSourceBuilder.Builder |
withInitScriptResource(String sqlScriptResourceName)
Add a SQL intitialization script read from given classpath resource name (for example a file name).
|
DataSourceBuilder.Builder type(String typeName)
typeName - the DataSource type name (not null)DataSourceBuilder.Builder type(DataSourceType type)
type - the DataSource type (not null)DataSourceBuilder.Builder name(String name)
name - the DataSource nameDataSourceBuilder.Builder driverClassName(String driverClassName)
driverClassName - the JDBC driver class nameDataSourceBuilder.Builder url(String url)
url - the JDBC connection URLDataSourceBuilder.Builder username(String username)
username - the JDBC connection usernameDataSourceBuilder.Builder password(String password)
password - the JDBC connection passwordDataSourceBuilder.Builder database(DatabasePlatform databasePlatform)
Can be used for example to auto-detect a suitable JDBC driver.
databasePlatform - the database platformDataSourceBuilder.Builder autoCommit(boolean autoCommit)
autoCommit - true to enable connection auto-commit, false to disableDataSourceBuilder.Builder minPoolSize(int minPoolSize)
minPoolSize - Minimum connection pool sizeDataSourceBuilder.Builder maxPoolSize(int maxPoolSize)
maxPoolSize - Maximum connection pool sizeDataSourceBuilder.Builder validationQuery(String validationQuery)
validationQuery - the connection validation queryDataSourceBuilder.Builder withInitScript(String sqlScript)
Supported SQL scripts format:
;) must be used as SQL statements separator--\* and */sqlScript - SQL intitialization script (not null)DataSourceBuilder.Builder withInitScriptResource(String sqlScriptResourceName)
ClassLoader.getResourceAsStream(String) is used to load the resource, using the same conventions to
locate the resource to load. UTF-8 is assumed as default encoding.
Supported SQL scripts format:
;) must be used as SQL statements separator--\* and */sqlScriptResourceName - SQL script resource nameDataSource build()
DataSource.DataSource instanceDataSourceInitializationException - If a DataSource initialization error occurs, for example an
error in SQL initialization scripts executionCopyright © 2019 The Holon Platform. All rights reserved.