title: Using OraclePreparedStatement with DBCP Connection
body: <p>I'm trying to make a connection pool with the dbcp framework for my oracle server.
  I used this <a href="http://web.archive.org/web/20120615100115/http://www.freshblurbs.com:80/jakarta-commons-dbcp-tutorial" rel="nofollow noreferrer">tutorial</a> for the connection.
  The problem is to create a OraclePreparedStatement with this connection: </p>
  
  <pre><code>Connection oracleCon;
  OraclePreparedStatement o_stmt;
  String sql = "INSERT INTO T002_metadata (T002_datacitexml,T002_version, T002_active)       VALUES (?,?,?) RETURNING T002_id INTO ?";
  
  
  oracleCon = ConnectionManager.ds.getConnection();
  
  o_stmt = ((OraclePreparedStatement) oracleCon.prepareStatement(sql));
  </code></pre>
  
  <p>After executing this, an exception is thrown.</p>
  
  <pre><code>org.apache.commons.dbcp.DelegatingPreparedStatement cannot be cast to oracle.jdbc.OraclePreparedStatement
  </code></pre>
  
  <p>Is there any possibility to cast the statement?</p>