JBoss Data Source Setup

Check Unclosed Connection
Uncomment the following settings in two xmls to allow auto connection close:  In {JBoss Directory}\server\default\deploy\jbossweb-tomcat55.sar\server.xml



In {JBoss Directory}\server\default\deploy\jbossweb-tomcat55.sar\META-INF\jboss-service.xml jboss.jca:service=CachedConnectionManager 

Check Unclosed Statement and ResultSet
To check for unclosed statement and resultset, add the following statement inside the datasource xml true under element 

Check Valid Connection
To check for validity of connection object before retrieval from pool, add the following statement inside datasource xml

For MSSQL
select 1

For Oracle
org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker