[jboss-user] [Datasource Configuration] - Wrapping to OracleConnection problem.

fordfarline do-not-reply at jboss.com
Fri Mar 20 09:06:26 EDT 2009


Hi all,

I using JBoss 4.2.3 and i need to get an OracleConnection to be able to pass an array as parameter to a PreparedStatement. I get an exception when i cast de connection:

java.lang.ClassCastException: $Proxy1 cannot be cast to org.jboss.resource.adapter.jdbc.WrappedConnection

I don??t know what i am doing wrong. This is my code:

DataSource ds = (DataSource) context.lookup("MLS/SRVC/AdministrationDataSource");

Connection con = ds.getConnection();

// The exception is thow here
WrappedConnection wrappedConn = (WrappedConnection)con;

OracleConnection ocon = (OracleConnection) wrappedConn.getUnderlyingConnection();

// This is what i need to do.
ArrayDescriptor af = ArrayDescriptor.createDescriptor("MDSYS.SDO_ORDINATE_ARRAY", con);


And this is the xml descriptor:

<no-tx-datasource>
      <jndi-name>MLS/SRVC/AdministrationDataSource</jndi-name>
      <use-java-context>false</use-java-context>
      <connection-url>jdbc:oracle:thin:@x.x.x.x:1521:xxx</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>xxx</user-name>
      xxx
      <min-pool-size>3</min-pool-size>
      <max-pool-size>10</max-pool-size>
      <idle-timeout-minutes>3</idle-timeout-minutes>
      <track-statements>true</track-statements>
      <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      
         <type-mapping>Oracle 9i</type-mapping>
      
</no-tx-datasource>

Thanks for any help or clue

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4219840#4219840

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4219840



More information about the jboss-user mailing list