Skip to content

Commit 1026ec6

Browse files
committed
Adding File
1 parent a2e77eb commit 1026ec6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.exp.tracker.utils;
2+
3+
import java.sql.Connection;
4+
import java.sql.SQLException;
5+
6+
import org.apache.commons.dbcp.BasicDataSource;
7+
import org.apache.commons.logging.Log;
8+
import org.apache.commons.logging.LogFactory;
9+
10+
public class TrackingBasicDataSource extends BasicDataSource
11+
{
12+
private static final Log logger = LogFactory
13+
.getLog(TrackingBasicDataSource.class);
14+
15+
public Connection getConnection() throws SQLException {
16+
if (logger.isDebugEnabled()) {
17+
logger.debug("Active database connections count = " + getNumActive());
18+
}
19+
return super.getConnection();
20+
}
21+
}

0 commit comments

Comments
 (0)