title: Error casting T4CConnection to OracleConnection
body: <p>Spring application using JNDI lookup to get datasource as following:</p>
  
  <pre><code>   @Bean(name = "dataSource1", destroyMethod = StringUtils.EMPTY)
      public DataSource dataSource() {
          final JndiDataSourceLookup lookup = new JndiDataSourceLookup();
          lookup.setResourceRef(true);
  
          return lookup.getDataSource(this.environment.getProperty(Constants.DB_JNDI_NAME_ES));
      }
  </code></pre>
  
  <p>and getting a connection from the datasource as follows :</p>
  
  <pre><code>@Autowired
  @Qualifier("dataSource1")
  private DataSource ds;
  
  
  
   Connection conn = null;
   conn = this.ds.getConnection();
  </code></pre>
  
  <p>But when i pass that connection to StructDescriptor it throws classCastException as follows:</p>
  
  <blockquote>
    <p>StructDescriptor desc1 =
    StructDescriptor.createDescriptor("MSAF_DBA.AMOUNT_DUE_OBJ",conn);</p>
  </blockquote>
  
  <pre><code>java.lang.ClassCastException: weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection cannot be cast to oracle.jdbc.OracleConnection
      at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:101)
      at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:72)
      at com.ceiwc.es.policyholder.dao.PolicyHolderDaoImpl.getAmountDue(PolicyHolderDaoImpl.java:290)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
  </code></pre>
  
  <p>My understanding is the <code>getConnection()</code> returns a <code>T4CConnection</code> where as <code>OracleConnection</code> is required. Tried couple of ways to get the <code>oracleConnection</code> but cant seem to get it. Any help would be appreciated.</p>