3 Replies Latest reply on Jan 7, 2002 6:13 PM by Emery Lapinski

    mysql & database pooling

    neil mcclements Newbie

      Hi all,

      I have an application which uses the MM mysql drivers to connect via jboss connection pool to mysql 3.23. I'm using the driver's capability to extract the value from an auto increment field with getLastInsertId like this :

      long thisID = ((org.gjt.mm.mysql.PreparedStatement) statement).getLastInsertID();

      This works fine un-pooled. But as soon as the pool is enabled I get a class cast exception on this line -

      java.lang.ClassCastException: org.jboss.pool.jdbc.PreparedStatementInPool

      It looks like the PreparedStatementInPool class wraps the MM driver.

      How can I extract the last inserted id using the MM driver & jBoss' pools?