Problem with OracleCallableStatement in WebSphere

Discussions

General J2EE: Problem with OracleCallableStatement in WebSphere

  1. Hi,
      I am using Websphere 5.0 App Server and Oracle 8i. When I try to get OracleCallableStatement I get class cast exception. Here is my code

    oracleCallableStmt = (OracleCallableStatement)conn.prepareCall(sqlCommand);

    I get the following exception

    java.lang.ClassCastException: com.ibm.ws.rsadapter.jdbc.WSJdbcCallableStatement

    All my code is Oracle specific.
    Is it not possible to cast to OracleCallableStatement?
    Is there any alternative to this problem?

    Thanks in advance,
    Prasanna

    Threaded Messages (1)

  2. Yep[ Go to top ]

    That won't work. You don't have a reference to a real oracle JDBC object, it's a WAS wrapper. We do this to handle XA enlisting and pooling.

    There may be an SPI to allow you to do things like this, contact support to find out.

    An alternative is to use an Oracle driver directly, i.e. not using a WAS DataSource. The downside of this is no managed pooling and no 2PC support, you'd manage transactions on the connection using connection.begin/commit.

    Billy