2 Replies Latest reply on Oct 15, 2001 6:37 AM by Marcus Brito

    Casting PreparedStatement into DB-specific class

    Marcus Brito Novice

      There is any way to get the DB-specific PreparedStatement class in JBoss?

      Let me explain the situation: I'm using PostgreSQL, and I need to use a method specific to the org.postgresql.Statement class (getInsertedOID()). However, the PreparedStatement obtained in my bean seems to be of type org.jboss.pool.jdbc.PreparedStatementInPool.

      However, as my DB _is_ PostgreSQL, this class should have org.postgresql.Statement somewhere on its inheritance tree.

      Anyway, my final question is: how can I obtain the org.postgresql.Statement object from my PreparedStatement object?

      A simple cast won't work:
      [ClienteEJB] java.lang.ClassCastException: org.jboss.pool.jdbc.PreparedStatementInPool
      [ClienteEJB] at com.tld.erp.cliente.dao.ClienteDAO_PostgreSQL.create(ClienteDAO_PostgreSQL.java:144)