-
1. Re: Getting the Underlying Connection
ykoer Nov 21, 2002 10:06 AM (in response to rbnb)Hi Rob,
I have currently the same problem. Did you find any solution?
Thank you
Yusuf -
2. Re: Getting the Underlying Connection
jmiller Dec 12, 2002 1:32 PM (in response to rbnb)LocalConnection actually exposes a getUnderlyingConnection() method that returns the specific connection. I missed this the first time I was looking through the source code, it's way at the bottom.
It was a little tricky finding the JAR that contains the LocalConnection class (located within the jboss-local-jdbc.rar file in the default deploy directory).
// must import org.jboss.resource.adapter.jdbc.local.LocalConnection
Connection conn = ds.getConnection();
// to be safe, check its type before casting
if (conn instanceof LocalConnection) {
Connection underlying = ((LocalConnection) conn).getUnderlyingConnection();
// Work with the underlying connection
} -
3. Re: Getting the Underlying Connection
jmiller Dec 12, 2002 2:09 PM (in response to rbnb)For some reason, my last reply is not showing up... Anyway, to re-iterate it:
LocalConnection exposes a getUnderlyingConnection() method just like ConnectionInPool used to. The JAR containing the org.jboss.resource.adapter.jdbc.local package is located within the jboss-local-jdbc.rar file in the default server deploy directory (you will need it to compile anything that will be casting to LocalConnection).
// be sure to import org.jboss.resource.adapter.jdbc.local.LocalConnection
Connection conn = ((LocalConnection) ds.getConnection()).getUnderlyingConnection();