List of usage examples for org.apache.commons.dbcp BasicDataSource setLogWriter
public void setLogWriter(PrintWriter logWriter) throws SQLException
Sets the log writer being used by this data source.
Calls #createDataSource() , so has the side effect of initializing the connection pool.
From source file:org.tdmx.lib.control.datasource.DynamicDataSource.java
private synchronized void createDataSource(DatabaseConnectionInfo dci) throws SQLException { // race condition avoidance if (connectionDataSourceMap.get(dci) != null) { return;/* w ww .jav a 2s . com*/ } BasicDataSource bds = new BasicDataSource(); bds.setUrl(dci.getUrl()); bds.setDriverClassName(dci.getDriverClassname()); bds.setUsername(dci.getUsername()); bds.setPassword(dci.getPassword()); bds.setMaxActive(100); bds.setMinIdle(0); bds.setInitialSize(1); bds.setMinEvictableIdleTimeMillis(60000); bds.setLogWriter(logWriter); connectionDataSourceMap.put(dci, bds); }