| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Common module for SQL database plugin
| Actframework version | act-sql-common version |
|---|---|
| 1.1.0 | 1.0.0 |
| 1.1.1 | 1.0.1 |
Specifies the jdbc url of the datasource.
Default value: jdbc:h2:./test if h2 jdbc driver is provided, otherwise it will break the application from bootstrap.
Optionally. Specifies the jdbc driver class. If not specified the framework will infer the driver class from the url
Specifies the jdbc connection username
Default value: sa
Specifies the jdbc connection password
Default value: empty string
Specifies the DataSourceProvider implementation.
About value and default value:
Specify should datasource auto commit transaction
Default value: false
Specify the minimum connections should be created by data source
Default value: 2
Specify the maximum connections can be created by data source
Default value: 10
Specifies the default transaction isolation level, could be one of the following:
Default value: READ_COMMITTED
Specify the naming convention to map Entity class name to table name and the property name to column name
Supported values:
Default value: matching
The ddl configuration tells the framework whether or not to generate and run DDL scripts
Specify should framework to generate and run create table DDL
Default value: false unless h2 is used as database
Note about h2: if using h2 anbd the database file exists then ddl.create will always be treated as false unless ddl.drop is specified as true
Specify should framework to generate and run drop table DDL
Default value: false
String s = miscConf.get("idleTimeout");
if (null != s) {
int n = Integer.parseInt(s);
hc.setIdleTimeout(n);
} else {
hc.setIdleTimeout(conf.maxInactiveTimeSecs * 1000);
}s = miscConf.get("connectionInitSql");
if (null != s) {
hc.setConnectionInitSql(s);
}s = miscConf.get("maxLifetime");
if (null != s) {
long n = Long.parseLong(s);
hc.setMaxLifetime(n);
} else {
hc.setMaxLifetime(conf.maxAgeMinutes * 60 * 1000L);
}s = miscConf.get("poolName");
if (null != s) {
hc.setPoolName(s);
}DruidDataSource source = new DruidDataSource();
String s = miscConf.get("initialSize");
if (null != s) {
source.setInitialSize(Integer.parseInt(s));
} else {
source.setInitialSize(source.getMinIdle());
}s = miscConf.get("timeBetweenEvictionRunsMillis");
if (null != s) {
source.setTimeBetweenEvictionRunsMillis(Long.parseLong(s));
}s = miscConf.get("minEvictableIdleTimeMillis");
if (null != s) {
source.setMinEvictableIdleTimeMillis(Long.parseLong(s));
}s = miscConf.get("testWhileIdle");
if (null != s) {
source.setTestWhileIdle(Boolean.parseBoolean(s));
}s = miscConf.get("testOnBorrow");
if (null != s) {
source.setTestOnBorrow(Boolean.parseBoolean(s));
}s = miscConf.get("testOnReturn");
if (null != s) {
source.setTestOnReturn(Boolean.parseBoolean(s));
}s = miscConf.get("filters");
if (null != s) {
try {
source.setFilters(s);
} catch (SQLException e) {
throw E.unexpected(e);
}
}s = miscConf.get("poolPreparedStatements");
if (null != s) {
source.setPoolPreparedStatements(Boolean.parseBoolean(s));
}| Back | FazBrowse Home | New Git URL |