2
2
3
3
import java .util .Properties ;
4
4
5
- import lombok .experimental .Builder ;
6
5
import lombok .Getter ;
6
+ import lombok .experimental .Builder ;
7
7
8
8
import org .springframework .beans .factory .annotation .Autowired ;
9
9
import org .springframework .beans .factory .annotation .Qualifier ;
@@ -29,12 +29,13 @@ public class JdbcConfig {
29
29
private final Properties properties ;
30
30
private final String name ;
31
31
private final String generateDdl ;
32
+ private final int maxPoolSize ;
32
33
33
34
public JdbcConfig (@ Value ("${db.connection.driver:}" ) String driverClassName , @ Value ("${db.connection.url:}" ) String url ,
34
35
@ Value ("${db.connection.username:}" ) String username , @ Value ("${db.connection.password:}" ) String password ,
35
36
@ Value ("${db.connection.hibernate.showsql:false}" ) String showSql , @ Value ("${db.connection.dialect:}" ) String dialect ,
36
37
@ Value ("${db.connection.ddl.auto:#{null}}" ) String ddlAuto ) {
37
- this (driverClassName , url , username , password , showSql , dialect , ddlAuto , new Properties (), "db" , "false" );
38
+ this (driverClassName , url , username , password , showSql , dialect , ddlAuto , new Properties (), "db" , "false" , 100 );
38
39
39
40
}
40
41
@@ -43,7 +44,8 @@ public JdbcConfig(@Value("${db.connection.driver:}") String driverClassName, @Va
43
44
@ Value ("${db.connection.username:}" ) String username , @ Value ("${db.connection.password:}" ) String password ,
44
45
@ Value ("${db.connection.hibernate.showsql:false}" ) String showSql , @ Value ("${db.connection.dialect:}" ) String dialect ,
45
46
@ Value ("${db.connection.ddl.auto:#{null}}" ) String ddlAuto , @ Qualifier ("propertyFactory" ) Properties properties ,
46
- @ Value ("${internal.not.use.microserver:#{null}}" ) String name , @ Value ("${db.connection.generate.ddl:false}" ) String generateDdl ) {
47
+ @ Value ("${internal.not.use.microserver:#{null}}" ) String name , @ Value ("${db.connection.generate.ddl:false}" ) String generateDdl ,
48
+ @ Value ("${db.connection.max.pool.size:100}" ) int maxPoolSize ) {
47
49
this .properties = properties ;
48
50
this .name = UsefulStaticMethods .either (name , new ConfigAccessor ().get ().getDefaultDataSourceName ());
49
51
this .driverClassName = UsefulStaticMethods .either (driverClassName , extract ("connection.driver" ));
@@ -54,6 +56,7 @@ public JdbcConfig(@Value("${db.connection.driver:}") String driverClassName, @Va
54
56
this .dialect = UsefulStaticMethods .either (dialect , extract ("connection.dialect" ));
55
57
this .ddlAuto = UsefulStaticMethods .either (ddlAuto , extract ("connection.ddl.auto" ));
56
58
this .generateDdl = UsefulStaticMethods .either (generateDdl , extract ("connection.generate.ddl" ));
59
+ this .maxPoolSize = maxPoolSize ;
57
60
58
61
}
59
62
0 commit comments