When using a JNDI datasource in Tomcat you specify something like this in the server.xml: <Resource name="jdbc/revireg" auth="Container" type="javax.sql.DataSource"/> <ResourceParams name="jdbc/revireg"> <parameter> <name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</valu e></parameter> <parameter><name>driverClassName</name><value>com.microsoft.jdbc.sqlserver.SQLS erverDriver</value></parameter> <parameter> <name>url</name><value>jdbc:microsoft:sqlserver://WS-WEBREG- QDL:1085</value></parameter> <parameter><name>username</name><value>qdl</value></parameter> etc ... </ResourceParams> Now the problem is that there is no way to specify driver specific properties. Fex. the MS SQL Server jdbc driver has a property called 'selectMethod' which can be set to either 'direct' or 'cursor'. The BasicDataSource class used in the above configuration supports driver specific properties via the 'addConnectionProperty(String name, String value)' method. The ResourceParams class however does not support nested properties, ie. something like: <ResourceParams name="jdbc/revireg"> .... <nestedparameter name="connectionProperty"> <parameter><name>selectMethod</name><value>cursor</value></parameter> </nestedparameter> .... </ResourceParams>
Upon closer inspection the wanted feature actually exists but is not documented. The way to do it: <ResourceParams name="jdbc/revireg"> .... <parameter><name>connectionProperties</name><value>selectMethod=cursor</value>< /parameter> .... </ResourceParams> Please add this to the 'Server Configuration Reference'
This is a dbcp feature, not a Tomcat feature, and is included in the currect dbcp documentation. Since it is already documented, I am resolving this as works for me.