title: PoolingDataSource - How to use a driver-specific PreparedStatement implementation
body: <p>I've implemented the <a href="http://commons.apache.org/dbcp/" rel="nofollow">commons dbcp</a> <code>PoolingDataSource</code> and its working perfectly - right up until I ran into an issue of using a specific implementation of the <code>java.sql.PreparedStatement</code> interface.</p>
  
  <pre><code>((OraclePreparedStatement) getStatement()).registerReturnParameter(index, sqlType); 
  
  java.lang.ClassCastException: 
  org.apache.commons.dbcp.DelegatingPreparedStatement 
  cannot be cast to oracle.jdbc.OraclePreparedStatemen
  </code></pre>
  
  <p>I understand why this is happening.  <strong>Is there any way to use a vendor-specific implementation of PreparedStatement but still be able to use the connection pooling that is provided by Commons DBCP?</strong>  I'd like to use the registerReturnParameter() and getReturnResultSet() which are specific to Oracle's implementation.  I know I've violated cardinal rule #1 ...</p>
  
  <p>Also, the PoolingDataSource is wrapping a OracleXADataSource which makes me believe that it's somehow possible to do this...</p>