users@glassfish.java.net

GF 3.1.1: how to get native JDBC connection from connection wrapper in GF programmatically

From: Yongqin Xu <yongqxu_at_hotmail.com>
Date: Mon, 26 Sep 2011 20:10:57 -0600

Hello,
I am looking for the way to get native JDBC connetion from the connection wrapper in GF 3.1.1.In tomcat, i know i can do something like:
          Class TCJdbcConnectionCls =
             cl.loadClass("org.apache.tomcat.dbcp.dbcp.DelegatingConnection");
          if (TCJdbcConnectionCls.isAssignableFrom(jdbcConnectionWrapper.getClass()))
          {
             Method getInnerMostConnection =
                TCJdbcConnectionCls.getMethod("getInnermostDelegate", null);
             return (Connection)getInnerMostConnection.invoke(jdbcConnectionWrapper, null);
          }
     jdbcConnectionWrapper is type of java.sql.Connection
How do i that in GF? What native connection type in GF? thanks