@@ -15,88 +15,53 @@ public class DataSourceConfig {
1515 private static final String POSTGRES = "postgres" ;
1616
1717 private InitDatabase initDatabase ;
18-
1918 private String readOnlyUrl ;
20-
2119 private String url ;
22-
2320 private String username ;
24-
2521 private String password ;
26-
2722 private String schema ;
28-
2923 /**
3024 * The name of the database platform (for use with ownerUsername and InitDatabase).
3125 */
3226 private String platform ;
33-
3427 /**
3528 * The optional database owner username (for running InitDatabase).
3629 */
3730 private String ownerUsername ;
38-
3931 /**
4032 * The optional database owner password (for running InitDatabase).
4133 */
4234 private String ownerPassword ;
43-
4435 private String driver ;
45-
4636 private int minConnections = 2 ;
47-
4837 private int maxConnections = 200 ;
49-
5038 private int isolationLevel = Connection .TRANSACTION_READ_COMMITTED ;
51-
5239 private boolean autoCommit ;
53-
5440 private boolean readOnly ;
55-
5641 private String heartbeatSql ;
57-
5842 private int heartbeatFreqSecs = 30 ;
59-
6043 private int heartbeatTimeoutSeconds = 3 ;
61-
6244 private boolean captureStackTrace ;
63-
6445 private int maxStackTraceSize = 5 ;
65-
6646 private int leakTimeMinutes = 30 ;
67-
6847 private int maxInactiveTimeSecs = 300 ;
69-
7048 private int maxAgeMinutes = 0 ;
71-
7249 private int trimPoolFreqSecs = 59 ;
73-
7450 private int pstmtCacheSize = 50 ;
75-
7651 private int cstmtCacheSize = 20 ;
77-
7852 private int waitTimeoutMillis = 1000 ;
79-
8053 private String poolListener ;
81-
8254 private boolean offline ;
83-
8455 private boolean failOnStart = true ;
85-
8656 private Map <String , String > customProperties ;
87-
8857 private List <String > initSql ;
89-
90-
9158 private DataSourceAlert alert ;
92-
9359 private DataSourcePoolListener listener ;
9460
9561 /**
9662 * Return a copy of the DataSourceConfig.
9763 */
9864 public DataSourceConfig copy () {
99-
10065 DataSourceConfig copy = new DataSourceConfig ();
10166 copy .initDatabase = initDatabase ;
10267 copy .url = url ;
@@ -134,7 +99,6 @@ public DataSourceConfig copy() {
13499 copy .initSql = initSql ;
135100 copy .alert = alert ;
136101 copy .listener = listener ;
137-
138102 return copy ;
139103 }
140104
@@ -831,7 +795,6 @@ public DataSourceConfig loadSettings(Properties properties, String serverName) {
831795 * Load the settings from the PropertiesWrapper.
832796 */
833797 private void loadSettings (ConfigPropertiesHelper properties ) {
834-
835798 username = properties .get ("username" , username );
836799 password = properties .get ("password" , password );
837800 schema = properties .get ("schema" , schema );
@@ -841,7 +804,6 @@ private void loadSettings(ConfigPropertiesHelper properties) {
841804 if (initDatabase == null && platform != null ) {
842805 setInitDatabaseForPlatform (platform );
843806 }
844-
845807 driver = properties .get ("driver" , properties .get ("databaseDriver" , driver ));
846808 readOnlyUrl = properties .get ("readOnlyUrl" , readOnlyUrl );
847809 url = properties .get ("url" , properties .get ("databaseUrl" , url ));
@@ -853,22 +815,18 @@ private void loadSettings(ConfigPropertiesHelper properties) {
853815 maxInactiveTimeSecs = properties .getInt ("maxInactiveTimeSecs" , maxInactiveTimeSecs );
854816 trimPoolFreqSecs = properties .getInt ("trimPoolFreqSecs" , trimPoolFreqSecs );
855817 maxAgeMinutes = properties .getInt ("maxAgeMinutes" , maxAgeMinutes );
856-
857818 minConnections = properties .getInt ("minConnections" , minConnections );
858819 maxConnections = properties .getInt ("maxConnections" , maxConnections );
859820 pstmtCacheSize = properties .getInt ("pstmtCacheSize" , pstmtCacheSize );
860821 cstmtCacheSize = properties .getInt ("cstmtCacheSize" , cstmtCacheSize );
861-
862822 waitTimeoutMillis = properties .getInt ("waitTimeout" , waitTimeoutMillis );
863-
864823 heartbeatSql = properties .get ("heartbeatSql" , heartbeatSql );
865824 heartbeatTimeoutSeconds = properties .getInt ("heartbeatTimeoutSeconds" , heartbeatTimeoutSeconds );
866825 poolListener = properties .get ("poolListener" , poolListener );
867826 offline = properties .getBoolean ("offline" , offline );
868827
869828 String isoLevel = properties .get ("isolationLevel" , getTransactionIsolationLevel (isolationLevel ));
870829 this .isolationLevel = getTransactionIsolationLevel (isoLevel );
871-
872830 this .initSql = parseSql (properties .get ("initSql" , null ));
873831 this .failOnStart = properties .getBoolean ("failOnStart" , failOnStart );
874832
@@ -893,7 +851,6 @@ private List<String> parseSql(String sql) {
893851 }
894852
895853 Map <String , String > parseCustom (String customProperties ) {
896-
897854 Map <String , String > propertyMap = new LinkedHashMap <String , String >();
898855 String [] pairs = customProperties .split (";" );
899856 for (String pair : pairs ) {
0 commit comments