Created
February 16, 2016 07:30
-
-
Save erangaeb/7e09f6334d62ed7f7023 to your computer and use it in GitHub Desktop.
ComboPooledDataSource configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val ds = new ComboPooledDataSource | |
| ds.setDriverClass(driverName) | |
| ds.setJdbcUrl(dbConfig.getString("url")) | |
| ds.setUser(dbConfig.getString("username")) | |
| ds.setPassword(dbConfig.getString("password")) | |
| // most reliable way, but have visible peformance drop | |
| ds.setTestConnectionOnCheckout(true) | |
| // have better peformacne | |
| ds.setTestConnectionOnCheckin(true) | |
| ds.setIdleConnectionTestPeriod(30) | |
| // this could work as well | |
| ds.setPreferredTestQuery("SELECT 1") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment