public interface DataSourceProvider
Modifier and Type | Method and Description |
---|---|
void |
close(DataSource dataSource) |
static DataSourceProvider |
create(DataSource dataSource,
JsonObject config)
Init provider with specific
DataSource and config. |
static DataSourceProvider |
create(JsonObject config) |
DataSource |
getDataSource(JsonObject config) |
default JsonObject |
getInitialConfig()
Get the SQL initial configuration
|
default DataSourceProvider |
init(JsonObject sqlConfig)
Init provider with specific configuration
|
int |
maximumPoolSize(DataSource dataSource,
JsonObject config) |
default DataSourceProvider init(JsonObject sqlConfig)
sqlConfig
- SQL connection configurationdefault JsonObject getInitialConfig()
int maximumPoolSize(DataSource dataSource, JsonObject config) throws SQLException
SQLException
DataSource getDataSource(JsonObject config) throws SQLException
SQLException
void close(DataSource dataSource) throws SQLException
SQLException
static DataSourceProvider create(JsonObject config)
static DataSourceProvider create(DataSource dataSource, JsonObject config)
DataSource
and config. The config expects that several properties are set:
url
- the connection stringuser
- the connection user namedatabase
- the database namemaxPoolSize
- the max allowed number of connections in the pooldataSource
- a pre initialized data sourceconfig
- the configuration for the datasourceCopyright © 2024 Eclipse. All rights reserved.