Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/WrappedResultSetJDBC4.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/WrappedResultSetJDBC4.java	(revision 0)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/WrappedResultSetJDBC4.java	(working copy)
@@ -19,8 +19,11 @@
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
-package org.jboss.resource.adapter.jdbc.jdk6;
+package org.jboss.resource.adapter.jdbc.jdbc4;
 
+import org.jboss.resource.adapter.jdbc.WrappedResultSet;
+import org.jboss.resource.adapter.jdbc.WrappedStatement;
+
 import java.io.InputStream;
 import java.io.Reader;
 import java.sql.NClob;
@@ -29,18 +32,15 @@
 import java.sql.SQLException;
 import java.sql.SQLXML;
 
-import org.jboss.resource.adapter.jdbc.WrappedResultSet;
-import org.jboss.resource.adapter.jdbc.WrappedStatement;
-
 /**
  * WrappedResultSetJDK6.
  * 
  * @author <a href="adrian@jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
-public class WrappedResultSetJDK6 extends WrappedResultSet
+public abstract class WrappedResultSetJDBC4 extends WrappedResultSet
 {
-   public WrappedResultSetJDK6(WrappedStatement statement, ResultSet resultSet)
+   public WrappedResultSetJDBC4(WrappedStatement statement, ResultSet resultSet)
    {
       super(statement, resultSet);
    }

Property changes on: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/WrappedResultSetJDBC4.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/CachedPreparedStatementJDBC4.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/CachedPreparedStatementJDBC4.java	(revision 0)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/CachedPreparedStatementJDBC4.java	(working copy)
@@ -19,8 +19,10 @@
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
-package org.jboss.resource.adapter.jdbc.jdk6;
+package org.jboss.resource.adapter.jdbc.jdbc4;
 
+import org.jboss.resource.adapter.jdbc.CachedPreparedStatement;
+
 import java.io.InputStream;
 import java.io.Reader;
 import java.sql.NClob;
@@ -29,17 +31,15 @@
 import java.sql.SQLException;
 import java.sql.SQLXML;
 
-import org.jboss.resource.adapter.jdbc.CachedPreparedStatement;
-
 /**
- * CachedPreparedStatementJDK5.
+ * CachedPreparedStatementJDBC4.
  * 
  * @author <a href="adrian@jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
-public class CachedPreparedStatementJDK6 extends CachedPreparedStatement
+public abstract class CachedPreparedStatementJDBC4 extends CachedPreparedStatement
 {
-   public CachedPreparedStatementJDK6(PreparedStatement ps) throws SQLException
+   public CachedPreparedStatementJDBC4(PreparedStatement ps) throws SQLException
    {
       super(ps);
    }

Property changes on: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/CachedPreparedStatementJDBC4.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/WrappedConnectionJDBC4.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/WrappedConnectionJDBC4.java	(revision 0)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/WrappedConnectionJDBC4.java	(working copy)
@@ -19,62 +19,41 @@
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
-package org.jboss.resource.adapter.jdbc.jdk6;
+package org.jboss.resource.adapter.jdbc.jdbc4;
 
+import org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection;
+import org.jboss.resource.adapter.jdbc.WrappedConnection;
+
 import java.sql.Array;
 import java.sql.Blob;
-import java.sql.CallableStatement;
 import java.sql.Clob;
 import java.sql.Connection;
 import java.sql.NClob;
-import java.sql.PreparedStatement;
 import java.sql.SQLClientInfoException;
 import java.sql.SQLException;
 import java.sql.SQLXML;
-import java.sql.Statement;
 import java.sql.Struct;
 import java.util.Properties;
 
-import org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection;
-import org.jboss.resource.adapter.jdbc.WrappedCallableStatement;
-import org.jboss.resource.adapter.jdbc.WrappedConnection;
-import org.jboss.resource.adapter.jdbc.WrappedPreparedStatement;
-import org.jboss.resource.adapter.jdbc.WrappedStatement;
-
 /**
- * WrappedConnectionJDK6.
+ * WrappedConnectionJDBC4.
  * 
  * @author <a href="adrian@jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
 @SuppressWarnings("unchecked")
-public class WrappedConnectionJDK6 extends WrappedConnection
+public abstract class WrappedConnectionJDBC4 extends WrappedConnection
 {
    /**
-    * Create a new WrappedConnectionJDK6.
+    * Create a new WrappedConnectionJDBC4.
     * 
     * @param mc the managed connection
     */
-   public WrappedConnectionJDK6(BaseWrapperManagedConnection mc)
+   public WrappedConnectionJDBC4(BaseWrapperManagedConnection mc)
    {
       super(mc);
    }
 
-   protected WrappedStatement wrapStatement(Statement statement)
-   {
-      return new WrappedStatementJDK6(this, statement);
-   }
-
-   protected WrappedPreparedStatement wrapPreparedStatement(PreparedStatement statement)
-   {
-      return new WrappedPreparedStatementJDK6(this, statement);
-   }
-
-   protected WrappedCallableStatement wrapCallableStatement(CallableStatement statement)
-   {
-      return new WrappedCallableStatementJDK6(this, statement);
-   }
-
    public Array createArrayOf(String typeName, Object[] elements) throws SQLException
    {
       lock();

Property changes on: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/WrappedConnectionJDBC4.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/WrappedCallableStatementJDBC4.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/WrappedCallableStatementJDBC4.java	(revision 0)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/WrappedCallableStatementJDBC4.java	(working copy)
@@ -19,8 +19,10 @@
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
-package org.jboss.resource.adapter.jdbc.jdk6;
+package org.jboss.resource.adapter.jdbc.jdbc4;
 
+import org.jboss.resource.adapter.jdbc.WrappedCallableStatement;
+
 import java.io.InputStream;
 import java.io.Reader;
 import java.sql.Blob;
@@ -28,32 +30,23 @@
 import java.sql.Clob;
 import java.sql.NClob;
 import java.sql.PreparedStatement;
-import java.sql.ResultSet;
 import java.sql.RowId;
 import java.sql.SQLException;
 import java.sql.SQLXML;
 
-import org.jboss.resource.adapter.jdbc.WrappedCallableStatement;
-import org.jboss.resource.adapter.jdbc.WrappedResultSet;
-
 /**
- * WrappedCallableStatementJDK6.
+ * WrappedCallableStatementJDBC4.
  * 
  * @author <a href="adrian@jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
-public class WrappedCallableStatementJDK6 extends WrappedCallableStatement
+public abstract class WrappedCallableStatementJDBC4 extends WrappedCallableStatement
 {
-   public WrappedCallableStatementJDK6(WrappedConnectionJDK6 lc, CallableStatement s)
+   public WrappedCallableStatementJDBC4(WrappedConnectionJDBC4 lc, CallableStatement s)
    {
       super(lc, s);
    }
    
-   protected WrappedResultSet wrapResultSet(ResultSet resultSet)
-   {
-      return new WrappedResultSetJDK6(this, resultSet);
-   }
-
    public boolean isClosed() throws SQLException
    {
       try

Property changes on: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/WrappedCallableStatementJDBC4.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/WrappedStatementJDBC4.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/WrappedStatementJDBC4.java	(revision 0)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/WrappedStatementJDBC4.java	(working copy)
@@ -19,33 +19,26 @@
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
-package org.jboss.resource.adapter.jdbc.jdk6;
+package org.jboss.resource.adapter.jdbc.jdbc4;
 
-import java.sql.ResultSet;
+import org.jboss.resource.adapter.jdbc.WrappedStatement;
+
 import java.sql.SQLException;
 import java.sql.Statement;
 
-import org.jboss.resource.adapter.jdbc.WrappedResultSet;
-import org.jboss.resource.adapter.jdbc.WrappedStatement;
-
 /**
  * WrappedStatementJDK6.
  * 
  * @author <a href="adrian@jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
-public class WrappedStatementJDK6 extends WrappedStatement
+public abstract class WrappedStatementJDBC4 extends WrappedStatement
 {
-   public WrappedStatementJDK6(WrappedConnectionJDK6 lc, Statement s)
+   public WrappedStatementJDBC4(WrappedConnectionJDBC4 lc, Statement s)
    {
       super(lc, s);
    }
 
-   protected WrappedResultSet wrapResultSet(ResultSet resultSet)
-   {
-      return new WrappedResultSetJDK6(this, resultSet);
-   }
-
    public boolean isClosed() throws SQLException
    {
       lock();

Property changes on: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/WrappedStatementJDBC4.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/WrappedPreparedStatementJDBC4.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/WrappedPreparedStatementJDBC4.java	(revision 0)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/WrappedPreparedStatementJDBC4.java	(working copy)
@@ -19,38 +19,31 @@
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
-package org.jboss.resource.adapter.jdbc.jdk6;
+package org.jboss.resource.adapter.jdbc.jdbc4;
 
+import org.jboss.resource.adapter.jdbc.WrappedPreparedStatement;
+
 import java.io.InputStream;
 import java.io.Reader;
 import java.sql.NClob;
 import java.sql.PreparedStatement;
-import java.sql.ResultSet;
 import java.sql.RowId;
 import java.sql.SQLException;
 import java.sql.SQLXML;
 
-import org.jboss.resource.adapter.jdbc.WrappedPreparedStatement;
-import org.jboss.resource.adapter.jdbc.WrappedResultSet;
-
 /**
  * WrappedPreparedStatementJDK6.
  * 
  * @author <a href="adrian@jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
-public class WrappedPreparedStatementJDK6 extends WrappedPreparedStatement
+public abstract class WrappedPreparedStatementJDBC4 extends WrappedPreparedStatement
 {
-   public WrappedPreparedStatementJDK6(WrappedConnectionJDK6 lc, PreparedStatement s)
+   public WrappedPreparedStatementJDBC4(WrappedConnectionJDBC4 lc, PreparedStatement s)
    {
       super(lc, s);
    }
    
-   protected WrappedResultSet wrapResultSet(ResultSet resultSet)
-   {
-      return new WrappedResultSetJDK6(this, resultSet);
-   }
-
    public boolean isClosed() throws SQLException
    {
       lock();

Property changes on: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/WrappedPreparedStatementJDBC4.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/CachedCallableStatementJDBC4.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/CachedCallableStatementJDBC4.java	(revision 0)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/CachedCallableStatementJDBC4.java	(working copy)
@@ -19,8 +19,10 @@
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
-package org.jboss.resource.adapter.jdbc.jdk6;
+package org.jboss.resource.adapter.jdbc.jdbc4;
 
+import org.jboss.resource.adapter.jdbc.CachedCallableStatement;
+
 import java.io.InputStream;
 import java.io.Reader;
 import java.sql.Blob;
@@ -31,18 +33,16 @@
 import java.sql.SQLException;
 import java.sql.SQLXML;
 
-import org.jboss.resource.adapter.jdbc.CachedCallableStatement;
-
 /**
- * CachedCallableStatementJDK6.
+ * CachedCallableStatementJDBC4.
  * 
  * @author <a href="adrian@jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
 @SuppressWarnings("deprecation")
-public class CachedCallableStatementJDK6 extends CachedCallableStatement
+public abstract class CachedCallableStatementJDBC4 extends CachedCallableStatement
 {
-   public CachedCallableStatementJDK6(CallableStatement cs) throws SQLException
+   public CachedCallableStatementJDBC4(CallableStatement cs) throws SQLException
    {
       super(cs);
    }

Property changes on: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4/CachedCallableStatementJDBC4.java
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Index: connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnection.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnection.java	(revision 112935)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnection.java	(working copy)
@@ -21,6 +21,18 @@
  */
 package org.jboss.resource.adapter.jdbc;
 
+import org.jboss.logging.Logger;
+import org.jboss.resource.JBossResourceException;
+import org.jboss.resource.statistic.JBossConnectionStatistics;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionEvent;
+import javax.resource.spi.ConnectionEventListener;
+import javax.resource.spi.ConnectionRequestInfo;
+import javax.resource.spi.ManagedConnection;
+import javax.resource.spi.ManagedConnectionMetaData;
+import javax.resource.spi.ResourceAdapterInternalException;
+import javax.security.auth.Subject;
 import java.io.PrintWriter;
 import java.sql.CallableStatement;
 import java.sql.Connection;
@@ -37,20 +49,6 @@
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import javax.resource.ResourceException;
-import javax.resource.spi.ConnectionEvent;
-import javax.resource.spi.ConnectionEventListener;
-import javax.resource.spi.ConnectionRequestInfo;
-import javax.resource.spi.ManagedConnection;
-import javax.resource.spi.ManagedConnectionMetaData;
-import javax.resource.spi.ResourceAdapterInternalException;
-import javax.security.auth.Subject;
-
-import org.jboss.logging.Logger;
-import org.jboss.resource.JBossResourceException;
-
-import org.jboss.resource.statistic.JBossConnectionStatistics;
-
 /**
  * BaseWrapperManagedConnection
  *
@@ -103,21 +101,25 @@
    static
    {
       Class connectionFactory = null;
-      try
+      ClassNotFoundException ex = null;
+      for (String impl : WrappedConnectionFactory.IMPLEMENTATIONS)
       {
-         connectionFactory = BaseWrapperManagedConnection.class.forName("org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionFactoryJDK6");
-      }
-      catch (ClassNotFoundException e)
-      {
          try
          {
-            connectionFactory = BaseWrapperManagedConnection.class.forName("org.jboss.resource.adapter.jdbc.jdk5.WrappedConnectionFactoryJDK5");
+            connectionFactory = WrappedConnectionFactory.class.forName(impl);
+            break;
          }
-         catch (ClassNotFoundException ex)
+         catch (ClassNotFoundException e)
          {
-            throw new RuntimeException("Unabled to load wrapped connection factory", ex);
+            // ignore
+            ex = e;
+            e.printStackTrace();
          }
       }
+      if (connectionFactory == null)
+      {
+         throw new RuntimeException("Unabled to load wrapped connection factory", ex);
+      }
       try
       {
          wrappedConnectionFactory = (WrappedConnectionFactory) connectionFactory.newInstance();
Index: connector/src/main/org/jboss/resource/adapter/jdbc/WrappedConnectionFactory.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/WrappedConnectionFactory.java	(revision 112935)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/WrappedConnectionFactory.java	(working copy)
@@ -33,6 +33,10 @@
  */
 public interface WrappedConnectionFactory
 {
+   String[] IMPLEMENTATIONS = { "org.jboss.resource.adapter.jdbc.jdk7.WrappedConnectionFactoryJDK7",
+           "org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionFactoryJDK6",
+           "org.jboss.resource.adapter.jdbc.jdk5.WrappedConnectionFactoryJDK5" };
+
    WrappedConnection createWrappedConnection(BaseWrapperManagedConnection mc);
 
    CachedPreparedStatement createCachedPreparedStatement(PreparedStatement ps) throws SQLException;
Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedPreparedStatementJDK6.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedPreparedStatementJDK6.java	(revision 112935)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedPreparedStatementJDK6.java	(working copy)
@@ -32,6 +32,7 @@
 
 import org.jboss.resource.adapter.jdbc.WrappedPreparedStatement;
 import org.jboss.resource.adapter.jdbc.WrappedResultSet;
+import org.jboss.resource.adapter.jdbc.jdbc4.WrappedPreparedStatementJDBC4;
 
 /**
  * WrappedPreparedStatementJDK6.
@@ -39,7 +40,7 @@
  * @author <a href="adrian@jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
-public class WrappedPreparedStatementJDK6 extends WrappedPreparedStatement
+public class WrappedPreparedStatementJDK6 extends WrappedPreparedStatementJDBC4
 {
    public WrappedPreparedStatementJDK6(WrappedConnectionJDK6 lc, PreparedStatement s)
    {
@@ -50,444 +51,4 @@
    {
       return new WrappedResultSetJDK6(this, resultSet);
    }
-
-   public boolean isClosed() throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement wrapped = getWrappedObject();
-         if (wrapped == null)
-            return true;
-         return wrapped.isClosed();
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public boolean isPoolable() throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            return statement.isPoolable();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setPoolable(boolean poolable) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setPoolable(poolable);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setAsciiStream(parameterIndex, x, length);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setAsciiStream(parameterIndex, x);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setBinaryStream(parameterIndex, x, length);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setBinaryStream(parameterIndex, x);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setBlob(parameterIndex, inputStream, length);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setBlob(parameterIndex, inputStream);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setCharacterStream(parameterIndex, reader, length);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setCharacterStream(parameterIndex, reader);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setClob(int parameterIndex, Reader reader, long length) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setClob(parameterIndex, reader, length);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setClob(int parameterIndex, Reader reader) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setClob(parameterIndex, reader);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setNCharacterStream(parameterIndex, value, length);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setNCharacterStream(parameterIndex, value);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setNClob(int parameterIndex, NClob value) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setNClob(parameterIndex, value);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setNClob(parameterIndex, reader, length);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setNClob(int parameterIndex, Reader reader) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setNClob(parameterIndex, reader);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setNString(int parameterIndex, String value) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setNString(parameterIndex, value);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setRowId(int parameterIndex, RowId x) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setRowId(parameterIndex, x);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setSQLXML(parameterIndex, xmlObject);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
 }
Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/CachedCallableStatementJDK6.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/CachedCallableStatementJDK6.java	(revision 112935)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/CachedCallableStatementJDK6.java	(working copy)
@@ -32,6 +32,7 @@
 import java.sql.SQLXML;
 
 import org.jboss.resource.adapter.jdbc.CachedCallableStatement;
+import org.jboss.resource.adapter.jdbc.jdbc4.CachedCallableStatementJDBC4;
 
 /**
  * CachedCallableStatementJDK6.
@@ -40,275 +41,10 @@
  * @version $Revision$
  */
 @SuppressWarnings("deprecation")
-public class CachedCallableStatementJDK6 extends CachedCallableStatement
+public class CachedCallableStatementJDK6 extends CachedCallableStatementJDBC4
 {
    public CachedCallableStatementJDK6(CallableStatement cs) throws SQLException
    {
       super(cs);
    }
-
-   public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException
-   {
-      getWrappedObject().setAsciiStream(parameterIndex, x, length);
-   }
-
-   public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException
-   {
-      getWrappedObject().setAsciiStream(parameterIndex, x);
-   }
-
-   public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException
-   {
-      getWrappedObject().setBinaryStream(parameterIndex, x, length);
-   }
-
-   public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException
-   {
-      getWrappedObject().setBinaryStream(parameterIndex, x);
-   }
-
-   public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException
-   {
-      getWrappedObject().setBlob(parameterIndex, inputStream, length);
-   }
-
-   public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException
-   {
-      getWrappedObject().setBlob(parameterIndex, inputStream);
-   }
-
-   public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException
-   {
-      getWrappedObject().setCharacterStream(parameterIndex, reader, length);
-   }
-
-   public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException
-   {
-      getWrappedObject().setCharacterStream(parameterIndex, reader);
-   }
-
-   public void setClob(int parameterIndex, Reader reader, long length) throws SQLException
-   {
-      getWrappedObject().setClob(parameterIndex, reader, length);
-   }
-
-   public void setClob(int parameterIndex, Reader reader) throws SQLException
-   {
-      getWrappedObject().setClob(parameterIndex, reader);
-   }
-
-   public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException
-   {
-      getWrappedObject().setNCharacterStream(parameterIndex, value, length);
-   }
-
-   public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException
-   {
-      getWrappedObject().setNCharacterStream(parameterIndex, value);
-   }
-
-   public void setNClob(int parameterIndex, NClob value) throws SQLException
-   {
-      getWrappedObject().setNClob(parameterIndex, value);
-   }
-
-   public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException
-   {
-      getWrappedObject().setNClob(parameterIndex, reader, length);
-   }
-
-   public void setNClob(int parameterIndex, Reader reader) throws SQLException
-   {
-      getWrappedObject().setNClob(parameterIndex, reader);
-   }
-
-   public void setNString(int parameterIndex, String value) throws SQLException
-   {
-      getWrappedObject().setNString(parameterIndex, value);
-   }
-
-   public void setRowId(int parameterIndex, RowId x) throws SQLException
-   {
-      getWrappedObject().setRowId(parameterIndex, x);
-   }
-
-   public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
-   {
-      getWrappedObject().setSQLXML(parameterIndex, xmlObject);
-   }
-
-   public boolean isClosed() throws SQLException
-   {
-      return getWrappedObject().isClosed();
-   }
-
-   public boolean isPoolable() throws SQLException
-   {
-      return getWrappedObject().isPoolable();
-   }
-
-   public void setPoolable(boolean poolable) throws SQLException
-   {
-      getWrappedObject().setPoolable(poolable);
-   }
-
-   public Reader getCharacterStream(int parameterIndex) throws SQLException
-   {
-      return getWrappedObject().getCharacterStream(parameterIndex);
-   }
-
-   public Reader getCharacterStream(String parameterName) throws SQLException
-   {
-      return getWrappedObject().getCharacterStream(parameterName);
-   }
-
-   public Reader getNCharacterStream(int parameterIndex) throws SQLException
-   {
-      return getWrappedObject().getNCharacterStream(parameterIndex);
-   }
-
-   public Reader getNCharacterStream(String parameterName) throws SQLException
-   {
-      return getWrappedObject().getNCharacterStream(parameterName);
-   }
-
-   public NClob getNClob(int parameterIndex) throws SQLException
-   {
-      return getWrappedObject().getNClob(parameterIndex);
-   }
-
-   public NClob getNClob(String parameterName) throws SQLException
-   {
-      return getWrappedObject().getNClob(parameterName);
-   }
-
-   public String getNString(int parameterIndex) throws SQLException
-   {
-      return getWrappedObject().getNString(parameterIndex);
-   }
-
-   public String getNString(String parameterName) throws SQLException
-   {
-      return getWrappedObject().getNString(parameterName);
-   }
-
-   public RowId getRowId(int parameterIndex) throws SQLException
-   {
-      return getWrappedObject().getRowId(parameterIndex);
-   }
-
-   public RowId getRowId(String parameterName) throws SQLException
-   {
-      return getWrappedObject().getRowId(parameterName);
-   }
-
-   public SQLXML getSQLXML(int parameterIndex) throws SQLException
-   {
-      return getWrappedObject().getSQLXML(parameterIndex);
-   }
-
-   public SQLXML getSQLXML(String parameterName) throws SQLException
-   {
-      return getWrappedObject().getSQLXML(parameterName);
-   }
-
-   public void setAsciiStream(String parameterName, InputStream x, long length) throws SQLException
-   {
-      getWrappedObject().setAsciiStream(parameterName, x, length);
-   }
-
-   public void setAsciiStream(String parameterName, InputStream x) throws SQLException
-   {
-      getWrappedObject().setAsciiStream(parameterName, x);
-   }
-
-   public void setBinaryStream(String parameterName, InputStream x, long length) throws SQLException
-   {
-      getWrappedObject().setBinaryStream(parameterName, x, length);
-   }
-
-   public void setBinaryStream(String parameterName, InputStream x) throws SQLException
-   {
-      getWrappedObject().setBinaryStream(parameterName, x);
-   }
-
-   public void setBlob(String parameterName, Blob x) throws SQLException
-   {
-      getWrappedObject().setBlob(parameterName, x);
-   }
-
-   public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException
-   {
-      getWrappedObject().setBlob(parameterName, inputStream, length);
-   }
-
-   public void setBlob(String parameterName, InputStream inputStream) throws SQLException
-   {
-      getWrappedObject().setBlob(parameterName, inputStream);
-   }
-
-   public void setCharacterStream(String parameterName, Reader reader, long length) throws SQLException
-   {
-      getWrappedObject().setCharacterStream(parameterName, reader, length);
-   }
-
-   public void setCharacterStream(String parameterName, Reader reader) throws SQLException
-   {
-      getWrappedObject().setCharacterStream(parameterName, reader);
-   }
-
-   public void setClob(String parameterName, Clob x) throws SQLException
-   {
-      getWrappedObject().setClob(parameterName, x);
-   }
-
-   public void setClob(String parameterName, Reader reader, long length) throws SQLException
-   {
-      getWrappedObject().setClob(parameterName, reader, length);
-   }
-
-   public void setClob(String parameterName, Reader reader) throws SQLException
-   {
-      getWrappedObject().setClob(parameterName, reader);
-   }
-
-   public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException
-   {
-      getWrappedObject().setNCharacterStream(parameterName, value, length);
-   }
-
-   public void setNCharacterStream(String parameterName, Reader value) throws SQLException
-   {
-      getWrappedObject().setNCharacterStream(parameterName, value);
-   }
-
-   public void setNClob(String parameterName, NClob value) throws SQLException
-   {
-      getWrappedObject().setNClob(parameterName, value);
-   }
-
-   public void setNClob(String parameterName, Reader reader, long length) throws SQLException
-   {
-      getWrappedObject().setNClob(parameterName, reader, length);
-   }
-
-   public void setNClob(String parameterName, Reader reader) throws SQLException
-   {
-      getWrappedObject().setNClob(parameterName, reader);
-   }
-
-   public void setNString(String parameterName, String value) throws SQLException
-   {
-      getWrappedObject().setNString(parameterName, value);
-   }
-
-   public void setRowId(String parameterName, RowId x) throws SQLException
-   {
-      getWrappedObject().setRowId(parameterName, x);
-   }
-
-   public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException
-   {
-      getWrappedObject().setSQLXML(parameterName, xmlObject);
-   }
 }
Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedResultSetJDK6.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedResultSetJDK6.java	(revision 112935)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedResultSetJDK6.java	(working copy)
@@ -31,6 +31,7 @@
 
 import org.jboss.resource.adapter.jdbc.WrappedResultSet;
 import org.jboss.resource.adapter.jdbc.WrappedStatement;
+import org.jboss.resource.adapter.jdbc.jdbc4.WrappedResultSetJDBC4;
 
 /**
  * WrappedResultSetJDK6.
@@ -38,636 +39,10 @@
  * @author <a href="adrian@jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
-public class WrappedResultSetJDK6 extends WrappedResultSet
+public class WrappedResultSetJDK6 extends WrappedResultSetJDBC4
 {
    public WrappedResultSetJDK6(WrappedStatement statement, ResultSet resultSet)
    {
       super(statement, resultSet);
    }
-
-   public int getHoldability() throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getHoldability();
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public Reader getNCharacterStream(int columnIndex) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getNCharacterStream(columnIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public Reader getNCharacterStream(String columnLabel) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getNCharacterStream(columnLabel);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public NClob getNClob(int columnIndex) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getNClob(columnIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public NClob getNClob(String columnLabel) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getNClob(columnLabel);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public String getNString(int columnIndex) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getNString(columnIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public String getNString(String columnLabel) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getNString(columnLabel);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public RowId getRowId(int columnIndex) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getRowId(columnIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public RowId getRowId(String columnLabel) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getRowId(columnLabel);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public SQLXML getSQLXML(int columnIndex) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getSQLXML(columnIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public SQLXML getSQLXML(String columnLabel) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getSQLXML(columnLabel);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public boolean isClosed() throws SQLException
-   {
-      ResultSet resultSet = getWrappedObject();
-      if (resultSet == null)
-         return true;
-      try
-      {
-         return resultSet.isClosed();
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateAsciiStream(columnIndex, x, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateAsciiStream(columnIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateAsciiStream(columnLabel, x, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateAsciiStream(columnLabel, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateBinaryStream(columnIndex, x, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateBinaryStream(columnIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateBinaryStream(columnLabel, x, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateBinaryStream(columnLabel, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateBlob(columnIndex, inputStream, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateBlob(columnIndex, inputStream);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateBlob(columnLabel, inputStream, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateBlob(columnLabel, inputStream);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateCharacterStream(columnIndex, x, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateCharacterStream(int columnIndex, Reader x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateCharacterStream(columnIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateCharacterStream(columnLabel, reader, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateCharacterStream(columnLabel, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateClob(int columnIndex, Reader reader, long length) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateClob(columnIndex, reader, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateClob(int columnIndex, Reader reader) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateClob(columnIndex, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateClob(String columnLabel, Reader reader, long length) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateClob(columnLabel, reader, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateClob(String columnLabel, Reader reader) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateClob(columnLabel, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNCharacterStream(columnIndex, x, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNCharacterStream(columnIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNCharacterStream(columnLabel, reader, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNCharacterStream(columnLabel, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateNClob(int columnIndex, NClob clob) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNClob(columnIndex, clob);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNClob(columnIndex, reader, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateNClob(int columnIndex, Reader reader) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNClob(columnIndex, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateNClob(String columnLabel, NClob clob) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNClob(columnLabel, clob);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNClob(columnLabel, reader, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateNClob(String columnLabel, Reader reader) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNClob(columnLabel, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateNString(int columnIndex, String string) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNString(columnIndex, string);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateNString(String columnLabel, String string) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNString(columnLabel, string);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateRowId(int columnIndex, RowId x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateRowId(columnIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateRowId(String columnLabel, RowId x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateRowId(columnLabel, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateSQLXML(columnIndex, xmlObject);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateSQLXML(columnLabel, xmlObject);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
 }
Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/CachedPreparedStatementJDK6.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/CachedPreparedStatementJDK6.java	(revision 112935)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/CachedPreparedStatementJDK6.java	(working copy)
@@ -30,6 +30,7 @@
 import java.sql.SQLXML;
 
 import org.jboss.resource.adapter.jdbc.CachedPreparedStatement;
+import org.jboss.resource.adapter.jdbc.jdbc4.CachedPreparedStatementJDBC4;
 
 /**
  * CachedPreparedStatementJDK5.
@@ -37,115 +38,10 @@
  * @author <a href="adrian@jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
-public class CachedPreparedStatementJDK6 extends CachedPreparedStatement
+public class CachedPreparedStatementJDK6 extends CachedPreparedStatementJDBC4
 {
    public CachedPreparedStatementJDK6(PreparedStatement ps) throws SQLException
    {
       super(ps);
    }
-
-   public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException
-   {
-      getWrappedObject().setAsciiStream(parameterIndex, x, length);
-   }
-
-   public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException
-   {
-      getWrappedObject().setAsciiStream(parameterIndex, x);
-   }
-
-   public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException
-   {
-      getWrappedObject().setBinaryStream(parameterIndex, x, length);
-   }
-
-   public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException
-   {
-      getWrappedObject().setBinaryStream(parameterIndex, x);
-   }
-
-   public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException
-   {
-      getWrappedObject().setBlob(parameterIndex, inputStream, length);
-   }
-
-   public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException
-   {
-      getWrappedObject().setBlob(parameterIndex, inputStream);
-   }
-
-   public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException
-   {
-      getWrappedObject().setCharacterStream(parameterIndex, reader, length);
-   }
-
-   public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException
-   {
-      getWrappedObject().setCharacterStream(parameterIndex, reader);
-   }
-
-   public void setClob(int parameterIndex, Reader reader, long length) throws SQLException
-   {
-      getWrappedObject().setClob(parameterIndex, reader, length);
-   }
-
-   public void setClob(int parameterIndex, Reader reader) throws SQLException
-   {
-      getWrappedObject().setClob(parameterIndex, reader);
-   }
-
-   public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException
-   {
-      getWrappedObject().setNCharacterStream(parameterIndex, value, length);
-   }
-
-   public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException
-   {
-      getWrappedObject().setNCharacterStream(parameterIndex, value);
-   }
-
-   public void setNClob(int parameterIndex, NClob value) throws SQLException
-   {
-      getWrappedObject().setNClob(parameterIndex, value);
-   }
-
-   public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException
-   {
-      getWrappedObject().setNClob(parameterIndex, reader, length);
-   }
-
-   public void setNClob(int parameterIndex, Reader reader) throws SQLException
-   {
-      getWrappedObject().setNClob(parameterIndex, reader);
-   }
-
-   public void setNString(int parameterIndex, String value) throws SQLException
-   {
-      getWrappedObject().setNString(parameterIndex, value);
-   }
-
-   public void setRowId(int parameterIndex, RowId x) throws SQLException
-   {
-      getWrappedObject().setRowId(parameterIndex, x);
-   }
-
-   public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
-   {
-      getWrappedObject().setSQLXML(parameterIndex, xmlObject);
-   }
-
-   public boolean isClosed() throws SQLException
-   {
-      return getWrappedObject().isClosed();
-   }
-
-   public boolean isPoolable() throws SQLException
-   {
-      return getWrappedObject().isPoolable();
-   }
-
-   public void setPoolable(boolean poolable) throws SQLException
-   {
-      getWrappedObject().setPoolable(poolable);
-   }
 }
Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedConnectionJDK6.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedConnectionJDK6.java	(revision 112935)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedConnectionJDK6.java	(working copy)
@@ -40,6 +40,7 @@
 import org.jboss.resource.adapter.jdbc.WrappedConnection;
 import org.jboss.resource.adapter.jdbc.WrappedPreparedStatement;
 import org.jboss.resource.adapter.jdbc.WrappedStatement;
+import org.jboss.resource.adapter.jdbc.jdbc4.WrappedConnectionJDBC4;
 
 /**
  * WrappedConnectionJDK6.
@@ -48,7 +49,7 @@
  * @version $Revision$
  */
 @SuppressWarnings("unchecked")
-public class WrappedConnectionJDK6 extends WrappedConnection
+public class WrappedConnectionJDK6 extends WrappedConnectionJDBC4
 {
    /**
     * Create a new WrappedConnectionJDK6.
@@ -74,273 +75,4 @@
    {
       return new WrappedCallableStatementJDK6(this, statement);
    }
-
-   public Array createArrayOf(String typeName, Object[] elements) throws SQLException
-   {
-      lock();
-      try
-      {
-         Connection c = getUnderlyingConnection();
-         try
-         {
-            return c.createArrayOf(typeName, elements);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public Blob createBlob() throws SQLException
-   {
-      lock();
-      try
-      {
-         Connection c = getUnderlyingConnection();
-         try
-         {
-            return c.createBlob();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public Clob createClob() throws SQLException
-   {
-      lock();
-      try
-      {
-         Connection c = getUnderlyingConnection();
-         try
-         {
-            return c.createClob();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public NClob createNClob() throws SQLException
-   {
-      lock();
-      try
-      {
-         Connection c = getUnderlyingConnection();
-         try
-         {
-            return c.createNClob();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public SQLXML createSQLXML() throws SQLException
-   {
-      lock();
-      try
-      {
-         Connection c = getUnderlyingConnection();
-         try
-         {
-            return c.createSQLXML();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public Struct createStruct(String typeName, Object[] attributes) throws SQLException
-   {
-      lock();
-      try
-      {
-         Connection c = getUnderlyingConnection();
-         try
-         {
-            return c.createStruct(typeName, attributes);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public Properties getClientInfo() throws SQLException
-   {
-      lock();
-      try
-      {
-         Connection c = getUnderlyingConnection();
-         try
-         {
-            return c.getClientInfo();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public String getClientInfo(String name) throws SQLException
-   {
-      lock();
-      try
-      {
-         Connection c = getUnderlyingConnection();
-         try
-         {
-            return c.getClientInfo(name);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public boolean isValid(int timeout) throws SQLException
-   {
-      lock();
-      try
-      {
-         Connection c = getUnderlyingConnection();
-         try
-         {
-            return c.isValid(timeout);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setClientInfo(Properties properties) throws SQLClientInfoException
-   {
-      try
-      {
-         lock();
-         try
-         {
-            Connection c = getUnderlyingConnection();
-            try
-            {
-               c.setClientInfo(properties);
-            }
-            catch (Throwable t)
-            {
-               throw checkException(t);
-            }
-         }
-         catch (SQLClientInfoException e)
-         {
-            throw e;
-         }
-         catch (SQLException e)
-         {
-            SQLClientInfoException t = new SQLClientInfoException();
-            t.initCause(e);
-            throw t;
-         }
-      }
-      catch (SQLException e)
-      {
-         SQLClientInfoException t = new SQLClientInfoException();
-         t.initCause(e);
-         throw t;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setClientInfo(String name, String value) throws SQLClientInfoException
-   {
-      try
-      {
-         lock();
-         try
-         {
-            Connection c = getUnderlyingConnection();
-            try
-            {
-               c.setClientInfo(name, value);
-            }
-            catch (Throwable t)
-            {
-               throw checkException(t);
-            }
-         }
-         catch (SQLClientInfoException e)
-         {
-            throw e;
-         }
-         catch (SQLException e)
-         {
-            SQLClientInfoException t = new SQLClientInfoException();
-            t.initCause(e);
-            throw t;
-         }
-      }
-      catch (SQLException e)
-      {
-         SQLClientInfoException t = new SQLClientInfoException();
-         t.initCause(e);
-         throw t;
-      }
-      finally
-      {
-         unlock();
-      }
-   }
 }
Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedCallableStatementJDK6.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedCallableStatementJDK6.java	(revision 112935)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedCallableStatementJDK6.java	(working copy)
@@ -35,6 +35,7 @@
 
 import org.jboss.resource.adapter.jdbc.WrappedCallableStatement;
 import org.jboss.resource.adapter.jdbc.WrappedResultSet;
+import org.jboss.resource.adapter.jdbc.jdbc4.WrappedCallableStatementJDBC4;
 
 /**
  * WrappedCallableStatementJDK6.
@@ -42,7 +43,7 @@
  * @author <a href="adrian@jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
-public class WrappedCallableStatementJDK6 extends WrappedCallableStatement
+public class WrappedCallableStatementJDK6 extends WrappedCallableStatementJDBC4
 {
    public WrappedCallableStatementJDK6(WrappedConnectionJDK6 lc, CallableStatement s)
    {
@@ -53,696 +54,4 @@
    {
       return new WrappedResultSetJDK6(this, resultSet);
    }
-
-   public boolean isClosed() throws SQLException
-   {
-      try
-      {
-         PreparedStatement wrapped = getWrappedObject();
-         if (wrapped == null)
-            return true;
-         return wrapped.isClosed();
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public boolean isPoolable() throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.isPoolable();
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setPoolable(boolean poolable) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setPoolable(poolable);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setAsciiStream(parameterIndex, x, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setAsciiStream(parameterIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setBinaryStream(parameterIndex, x, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setBinaryStream(parameterIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setBlob(parameterIndex, inputStream, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setBlob(parameterIndex, inputStream);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setCharacterStream(parameterIndex, reader, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setCharacterStream(parameterIndex, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setClob(int parameterIndex, Reader reader, long length) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setClob(parameterIndex, reader, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setClob(int parameterIndex, Reader reader) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setClob(parameterIndex, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNCharacterStream(parameterIndex, value, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNCharacterStream(parameterIndex, value);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setNClob(int parameterIndex, NClob value) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNClob(parameterIndex, value);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNClob(parameterIndex, reader, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setNClob(int parameterIndex, Reader reader) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNClob(parameterIndex, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setNString(int parameterIndex, String value) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNString(parameterIndex, value);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setRowId(int parameterIndex, RowId x) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setRowId(parameterIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setSQLXML(parameterIndex, xmlObject);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public Reader getCharacterStream(int parameterIndex) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getCharacterStream(parameterIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public Reader getCharacterStream(String parameterName) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getCharacterStream(parameterName);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public Reader getNCharacterStream(int parameterIndex) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getNCharacterStream(parameterIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public Reader getNCharacterStream(String parameterName) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getCharacterStream(parameterName);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public NClob getNClob(int parameterIndex) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getNClob(parameterIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public NClob getNClob(String parameterName) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getNClob(parameterName);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public String getNString(int parameterIndex) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getNString(parameterIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public String getNString(String parameterName) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getNString(parameterName);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public RowId getRowId(int parameterIndex) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getRowId(parameterIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public RowId getRowId(String parameterName) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getRowId(parameterName);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public SQLXML getSQLXML(int parameterIndex) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getSQLXML(parameterIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public SQLXML getSQLXML(String parameterName) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getSQLXML(parameterName);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setAsciiStream(String parameterName, InputStream x, long length) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setAsciiStream(parameterName, x, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setAsciiStream(String parameterName, InputStream x) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setAsciiStream(parameterName, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setBinaryStream(String parameterName, InputStream x, long length) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setBinaryStream(parameterName, x, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setBinaryStream(String parameterName, InputStream x) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setBinaryStream(parameterName, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setBlob(String parameterName, Blob x) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setBlob(parameterName, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setBlob(parameterName, inputStream, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setBlob(String parameterName, InputStream inputStream) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setBlob(parameterName, inputStream);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setCharacterStream(String parameterName, Reader reader, long length) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setCharacterStream(parameterName, reader, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setCharacterStream(String parameterName, Reader reader) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setCharacterStream(parameterName, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setClob(String parameterName, Clob x) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setClob(parameterName, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setClob(String parameterName, Reader reader, long length) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setClob(parameterName, reader, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setClob(String parameterName, Reader reader) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setClob(parameterName, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNCharacterStream(parameterName, value, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setNCharacterStream(String parameterName, Reader value) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNCharacterStream(parameterName, value);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setNClob(String parameterName, NClob value) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNClob(parameterName, value);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setNClob(String parameterName, Reader reader, long length) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNClob(parameterName, reader, length);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setNClob(String parameterName, Reader reader) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNClob(parameterName, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setNString(String parameterName, String value) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNString(parameterName, value);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setRowId(String parameterName, RowId x) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setRowId(parameterName, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setSQLXML(parameterName, xmlObject);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
 }
Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedStatementJDK6.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedStatementJDK6.java	(revision 112935)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedStatementJDK6.java	(working copy)
@@ -27,6 +27,7 @@
 
 import org.jboss.resource.adapter.jdbc.WrappedResultSet;
 import org.jboss.resource.adapter.jdbc.WrappedStatement;
+import org.jboss.resource.adapter.jdbc.jdbc4.WrappedStatementJDBC4;
 
 /**
  * WrappedStatementJDK6.
@@ -34,7 +35,7 @@
  * @author <a href="adrian@jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
-public class WrappedStatementJDK6 extends WrappedStatement
+public class WrappedStatementJDK6 extends WrappedStatementJDBC4
 {
    public WrappedStatementJDK6(WrappedConnectionJDK6 lc, Statement s)
    {
@@ -45,66 +46,4 @@
    {
       return new WrappedResultSetJDK6(this, resultSet);
    }
-
-   public boolean isClosed() throws SQLException
-   {
-      lock();
-      try
-      {
-         Statement wrapped = getWrappedObject();
-         if (wrapped == null)
-            return true;
-         return wrapped.isClosed();
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public boolean isPoolable() throws SQLException
-   {
-      lock();
-      try
-      {
-         Statement statement = getUnderlyingStatement();
-         try
-         {
-            return statement.isPoolable();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   public void setPoolable(boolean poolable) throws SQLException
-   {
-      lock();
-      try
-      {
-         Statement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setPoolable(poolable);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
 }
Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdk7/WrappedConnectionFactoryJDK7.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdk7/WrappedConnectionFactoryJDK7.java	(revision 0)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdk7/WrappedConnectionFactoryJDK7.java	(revision 0)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright (c) 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.resource.adapter.jdbc.jdk7;
+
+import org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection;
+import org.jboss.resource.adapter.jdbc.CachedCallableStatement;
+import org.jboss.resource.adapter.jdbc.CachedPreparedStatement;
+import org.jboss.resource.adapter.jdbc.WrappedCallableStatement;
+import org.jboss.resource.adapter.jdbc.WrappedConnection;
+import org.jboss.resource.adapter.jdbc.WrappedConnectionFactory;
+import org.jboss.resource.adapter.jdbc.WrappedPreparedStatement;
+import org.jboss.resource.adapter.jdbc.WrappedResultSet;
+import org.jboss.resource.adapter.jdbc.WrappedStatement;
+import org.jboss.resource.adapter.jdbc.jdbc4_1.CachedCallableStatementJDBC4_1;
+import org.jboss.resource.adapter.jdbc.jdbc4_1.CachedPreparedStatementJDBC4_1;
+import org.jboss.resource.adapter.jdbc.jdbc4_1.WrappedCallableStatementJDBC4_1;
+import org.jboss.resource.adapter.jdbc.jdbc4_1.WrappedConnectionJDBC4_1;
+import org.jboss.resource.adapter.jdbc.jdbc4_1.WrappedPreparedStatementJDBC4_1;
+import org.jboss.resource.adapter.jdbc.jdbc4_1.WrappedResultSetJDBC4_1;
+import org.jboss.resource.adapter.jdbc.jdbc4_1.WrappedStatementJDBC4_1;
+
+import java.sql.CallableStatement;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+/**
+ * @author <a href="mailto:cdewolf@redhat.com">Carlo de Wolf</a>
+ */
+public class WrappedConnectionFactoryJDK7 implements WrappedConnectionFactory
+{
+   @Override
+   public WrappedConnection createWrappedConnection(BaseWrapperManagedConnection mc)
+   {
+      return new WrappedConnectionJDBC4_1(mc)
+      {
+         @Override
+         protected WrappedStatement wrapStatement(Statement statement)
+         {
+            return new WrappedStatementJDBC4_1(this, statement)
+            {
+               @Override
+               protected WrappedResultSet wrapResultSet(ResultSet resultSet)
+               {
+                  return new WrappedResultSetJDBC4_1(this, resultSet) {};
+               }
+            };
+         }
+
+         @Override
+         protected WrappedPreparedStatement wrapPreparedStatement(PreparedStatement statement)
+         {
+            return new WrappedPreparedStatementJDBC4_1(this, statement)
+            {
+               @Override
+               protected WrappedResultSet wrapResultSet(ResultSet resultSet)
+               {
+                  return new WrappedResultSetJDBC4_1(this, resultSet) {};
+               }
+            };
+         }
+
+         @Override
+         protected WrappedCallableStatement wrapCallableStatement(CallableStatement statement)
+         {
+            return new WrappedCallableStatementJDBC4_1(this, statement)
+            {
+               @Override
+               protected WrappedResultSet wrapResultSet(ResultSet resultSet)
+               {
+                  return new WrappedResultSetJDBC4_1(this, resultSet) {};
+               }
+            };
+         }
+      };
+   }
+
+   @Override
+   public CachedPreparedStatement createCachedPreparedStatement(PreparedStatement ps) throws SQLException
+   {
+      return new CachedPreparedStatementJDBC4_1(ps) {};
+   }
+
+   @Override
+   public CachedCallableStatement createCachedCallableStatement(CallableStatement cs) throws SQLException
+   {
+      return new CachedCallableStatementJDBC4_1(cs) {};
+   }
+}
Index: connector/src/main/org/jboss/resource/adapter/jdbc/WrapperDataSource.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/WrapperDataSource.java	(revision 112935)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/WrapperDataSource.java	(working copy)
@@ -21,10 +21,9 @@
  */
 package org.jboss.resource.adapter.jdbc;
 
-import java.io.PrintWriter;
-import java.io.Serializable;
-import java.sql.Connection;
-import java.sql.SQLException;
+import org.jboss.resource.connectionmanager.JTATransactionChecker;
+import org.jboss.tm.TransactionTimeoutConfiguration;
+import org.jboss.util.NestedSQLException;
 
 import javax.naming.Reference;
 import javax.resource.Referenceable;
@@ -33,11 +32,13 @@
 import javax.resource.spi.ConnectionRequestInfo;
 import javax.sql.DataSource;
 import javax.transaction.RollbackException;
+import java.io.PrintWriter;
+import java.io.Serializable;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.util.logging.Logger;
 
-import org.jboss.resource.connectionmanager.JTATransactionChecker;
-import org.jboss.tm.TransactionTimeoutConfiguration;
-import org.jboss.util.NestedSQLException;
-
 /**
  * WrapperDataSource
  *
@@ -77,6 +78,12 @@
       return 0;
    }
 
+   public Logger getParentLogger() throws SQLFeatureNotSupportedException
+   {
+      // SQLFeatureNotSupportedException is not available in JDK 5
+      throw new SQLFeatureNotSupportedException("NYI: org.jboss.resource.adapter.jdbc.WrapperDataSource.getParentLogger");
+   }
+
    public void setLoginTimeout(int param1) throws SQLException
    {
       // TODO: implement this javax.sql.DataSource method
Index: connector/src/main/org/jboss/resource/adapter/jdbc/CachedCallableStatement.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/CachedCallableStatement.java	(revision 112935)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/CachedCallableStatement.java	(working copy)
@@ -48,7 +48,7 @@
 public abstract class CachedCallableStatement extends CachedPreparedStatement
    implements CallableStatement
 {
-   private final CallableStatement cs;
+   protected final CallableStatement cs;
 
    public CachedCallableStatement(CallableStatement ps) throws SQLException
    {
@@ -453,6 +453,7 @@
       cs.setTimestamp(parameterName, x, cal);
    }
 
+   @Deprecated
    protected CallableStatement getWrappedObject() throws SQLException
    {
       return cs;
Index: connector/src/main/org/jboss/resource/adapter/jdbc/CachedPreparedStatement.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/CachedPreparedStatement.java	(revision 112935)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/CachedPreparedStatement.java	(working copy)
@@ -49,7 +49,7 @@
 {
    private static final long serialVersionUID = 2085461257386274373L;
    
-   private PreparedStatement ps;
+   protected final PreparedStatement ps;
    private AtomicBoolean cached = new AtomicBoolean(true);
    private AtomicInteger inUse = new AtomicInteger(1);
 
@@ -526,6 +526,7 @@
       return ps.getResultSetHoldability();
    }
 
+   @Deprecated
    protected PreparedStatement getWrappedObject() throws SQLException
    {
       return ps;
Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/WrappedResultSetJDBC4_1.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/WrappedResultSetJDBC4_1.java	(revision 0)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/WrappedResultSetJDBC4_1.java	(revision 0)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright (c) 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.resource.adapter.jdbc.jdbc4_1;
+
+import org.jboss.resource.adapter.jdbc.WrappedStatement;
+import org.jboss.resource.adapter.jdbc.jdbc4.WrappedResultSetJDBC4;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+/**
+ * @author <a href="mailto:cdewolf@redhat.com">Carlo de Wolf</a>
+ */
+public abstract class WrappedResultSetJDBC4_1 extends WrappedResultSetJDBC4
+{
+   protected WrappedResultSetJDBC4_1(WrappedStatement statement, ResultSet resultSet)
+   {
+      super(statement, resultSet);
+   }
+
+   @Override
+   public <T> T getObject(int columnIndex, Class<T> type) throws SQLException
+   {
+      try
+      {
+         return getUnderlyingResultSet().getObject(columnIndex, type);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   @Override
+   public <T> T getObject(String columnLabel, Class<T> type) throws SQLException
+   {
+      try
+      {
+         return getUnderlyingResultSet().getObject(columnLabel, type);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+}
Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/CachedPreparedStatementJDBC4_1.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/CachedPreparedStatementJDBC4_1.java	(revision 0)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/CachedPreparedStatementJDBC4_1.java	(revision 0)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright (c) 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.resource.adapter.jdbc.jdbc4_1;
+
+import org.jboss.resource.adapter.jdbc.jdbc4.CachedPreparedStatementJDBC4;
+
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+
+/**
+ * @author <a href="mailto:cdewolf@redhat.com">Carlo de Wolf</a>
+ */
+public abstract class CachedPreparedStatementJDBC4_1 extends CachedPreparedStatementJDBC4
+{
+   protected CachedPreparedStatementJDBC4_1(PreparedStatement ps) throws SQLException
+   {
+      super(ps);
+   }
+
+   @Override
+   public void closeOnCompletion() throws SQLException
+   {
+      ps.closeOnCompletion();
+   }
+
+   @Override
+   public boolean isCloseOnCompletion() throws SQLException
+   {
+      return ps.isCloseOnCompletion();
+   }
+}
Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/WrappedConnectionJDBC4_1.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/WrappedConnectionJDBC4_1.java	(revision 0)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/WrappedConnectionJDBC4_1.java	(revision 0)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright (c) 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.resource.adapter.jdbc.jdbc4_1;
+
+import org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection;
+import org.jboss.resource.adapter.jdbc.jdbc4.WrappedConnectionJDBC4;
+
+import java.sql.SQLException;
+import java.util.concurrent.Executor;
+
+/**
+ * @author <a href="mailto:cdewolf@redhat.com">Carlo de Wolf</a>
+ */
+public abstract class WrappedConnectionJDBC4_1 extends WrappedConnectionJDBC4
+{
+   protected WrappedConnectionJDBC4_1(BaseWrapperManagedConnection mc)
+   {
+      super(mc);
+   }
+
+   @Override
+   public void setSchema(String schema) throws SQLException
+   {
+      lock();
+      try
+      {
+         getUnderlyingConnection().setSchema(schema);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   @Override
+   public String getSchema() throws SQLException
+   {
+      lock();
+      try
+      {
+         return getUnderlyingConnection().getSchema();
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   @Override
+   public void abort(Executor executor) throws SQLException
+   {
+      lock();
+      try
+      {
+         getUnderlyingConnection().abort(executor);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   @Override
+   public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException
+   {
+      lock();
+      try
+      {
+         getUnderlyingConnection().setNetworkTimeout(executor, milliseconds);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   @Override
+   public int getNetworkTimeout() throws SQLException
+   {
+      lock();
+      try
+      {
+         return getUnderlyingConnection().getNetworkTimeout();
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+}
Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/WrappedCallableStatementJDBC4_1.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/WrappedCallableStatementJDBC4_1.java	(revision 0)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/WrappedCallableStatementJDBC4_1.java	(revision 0)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright (c) 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.resource.adapter.jdbc.jdbc4_1;
+
+import org.jboss.resource.adapter.jdbc.jdbc4.WrappedCallableStatementJDBC4;
+import org.jboss.resource.adapter.jdbc.jdbc4.WrappedConnectionJDBC4;
+
+import java.sql.CallableStatement;
+import java.sql.SQLException;
+
+/**
+ * @author <a href="mailto:cdewolf@redhat.com">Carlo de Wolf</a>
+ */
+public abstract class WrappedCallableStatementJDBC4_1 extends WrappedCallableStatementJDBC4
+{
+   protected WrappedCallableStatementJDBC4_1(WrappedConnectionJDBC4 lc, CallableStatement s)
+   {
+      super(lc, s);
+   }
+
+   @Override
+   public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException
+   {
+      final CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         return statement.getObject(parameterIndex, type);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   @Override
+   public <T> T getObject(String parameterName, Class<T> type) throws SQLException
+   {
+      final CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         return statement.getObject(parameterName, type);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   @Override
+   public void closeOnCompletion() throws SQLException
+   {
+      final CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         statement.closeOnCompletion();
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   @Override
+   public boolean isCloseOnCompletion() throws SQLException
+   {
+      final CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         return statement.isCloseOnCompletion();
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+}
Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/WrappedStatementJDBC4_1.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/WrappedStatementJDBC4_1.java	(revision 0)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/WrappedStatementJDBC4_1.java	(revision 0)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright (c) 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.resource.adapter.jdbc.jdbc4_1;
+
+import org.jboss.resource.adapter.jdbc.jdbc4.WrappedConnectionJDBC4;
+import org.jboss.resource.adapter.jdbc.jdbc4.WrappedStatementJDBC4;
+
+import java.sql.SQLException;
+import java.sql.Statement;
+
+/**
+ * @author <a href="mailto:cdewolf@redhat.com">Carlo de Wolf</a>
+ */
+public abstract class WrappedStatementJDBC4_1 extends WrappedStatementJDBC4
+{
+   protected WrappedStatementJDBC4_1(WrappedConnectionJDBC4 lc, Statement s)
+   {
+      super(lc, s);
+   }
+
+   @Override
+   public void closeOnCompletion() throws SQLException
+   {
+      final Statement statement = getUnderlyingStatement();
+      try
+      {
+         statement.closeOnCompletion();
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   @Override
+   public boolean isCloseOnCompletion() throws SQLException
+   {
+      final Statement statement = getUnderlyingStatement();
+      try
+      {
+         return statement.isCloseOnCompletion();
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+}
Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/WrappedPreparedStatementJDBC4_1.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/WrappedPreparedStatementJDBC4_1.java	(revision 0)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/WrappedPreparedStatementJDBC4_1.java	(revision 0)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright (c) 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.resource.adapter.jdbc.jdbc4_1;
+
+import org.jboss.resource.adapter.jdbc.jdbc4.WrappedConnectionJDBC4;
+import org.jboss.resource.adapter.jdbc.jdbc4.WrappedPreparedStatementJDBC4;
+
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+
+/**
+ * @author <a href="mailto:cdewolf@redhat.com">Carlo de Wolf</a>
+ */
+public abstract class WrappedPreparedStatementJDBC4_1 extends WrappedPreparedStatementJDBC4
+{
+   protected WrappedPreparedStatementJDBC4_1(WrappedConnectionJDBC4 lc, PreparedStatement s)
+   {
+      super(lc, s);
+   }
+
+   @Override
+   public void closeOnCompletion() throws SQLException
+   {
+      lock();
+      try
+      {
+         getUnderlyingStatement().closeOnCompletion();
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   @Override
+   public boolean isCloseOnCompletion() throws SQLException
+   {
+      lock();
+      try
+      {
+         return getUnderlyingStatement().isCloseOnCompletion();
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+}
Index: connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/CachedCallableStatementJDBC4_1.java
===================================================================
--- connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/CachedCallableStatementJDBC4_1.java	(revision 0)
+++ connector/src/main/org/jboss/resource/adapter/jdbc/jdbc4_1/CachedCallableStatementJDBC4_1.java	(revision 0)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright (c) 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.resource.adapter.jdbc.jdbc4_1;
+
+import org.jboss.resource.adapter.jdbc.jdbc4.CachedCallableStatementJDBC4;
+
+import java.sql.CallableStatement;
+import java.sql.SQLException;
+
+/**
+ * @author <a href="mailto:cdewolf@redhat.com">Carlo de Wolf</a>
+ */
+public abstract class CachedCallableStatementJDBC4_1 extends CachedCallableStatementJDBC4
+{
+   protected CachedCallableStatementJDBC4_1(CallableStatement cs) throws SQLException
+   {
+      super(cs);
+   }
+
+   @Override
+   public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException
+   {
+      return cs.getObject(parameterIndex, type);
+   }
+
+   @Override
+   public <T> T getObject(String parameterName, Class<T> type) throws SQLException
+   {
+      return cs.getObject(parameterName, type);
+   }
+
+   @Override
+   public void closeOnCompletion() throws SQLException
+   {
+      cs.closeOnCompletion();
+   }
+
+   @Override
+   public boolean isCloseOnCompletion() throws SQLException
+   {
+      return cs.isCloseOnCompletion();
+   }
+}
Index: connector/build.xml
===================================================================
--- connector/build.xml	(revision 112935)
+++ connector/build.xml	(working copy)
@@ -216,8 +216,7 @@
     description="Compile all source files."/>
 
   <!-- Compile all class files -->
-  <target name="compile-classes" depends="compile-classes-jdk5, compile-classes-jdk6"/>
-  <target name="compile-classes-jdk5" depends="init" unless="HAVE_JDK_1.6">
+  <target name="compile-classes" depends="init">
     <mkdir dir="${build.classes}"/>
 
     <javac destdir="${build.classes}"
@@ -232,30 +231,15 @@
       includeJavaRuntime="${javac.include.java.runtime}"
       failonerror="${javac.fail.onerror}">
       <src path="${source.java}"/>
-      <exclude name="org/jboss/resource/adapter/jdbc/jdk6/**"/>
+      <exclude name="org/jboss/resource/adapter/jdbc/jdbc4/**" unless="HAVE_JDK_1.6"/>
+      <exclude name="org/jboss/resource/adapter/jdbc/jdbc4_1/**" unless="HAVE_JDK_1.7"/>
+      <exclude name="org/jboss/resource/adapter/jdbc/jdk5/**" unless="IS_JDK_1.5"/>
+      <exclude name="org/jboss/resource/adapter/jdbc/jdk6/**" unless="IS_JDK_1.6"/>
+      <exclude name="org/jboss/resource/adapter/jdbc/jdk7/**" unless="IS_JDK_1.7"/>
       <classpath refid="javac.classpath"/>
     </javac>
   </target>
-  <target name="compile-classes-jdk6" depends="init" if="HAVE_JDK_1.6">
-    <mkdir dir="${build.classes}"/>
 
-    <javac destdir="${build.classes}"
-      optimize="${javac.optimize}"
-      target="1.6"
-      source="1.6"
-      debug="${javac.debug}"
-      depend="${javac.depend}"
-      verbose="${javac.verbose}"
-      deprecation="${javac.deprecation}"
-      includeAntRuntime="${javac.include.ant.runtime}"
-      includeJavaRuntime="${javac.include.java.runtime}"
-      failonerror="${javac.fail.onerror}">
-      <src path="${source.java}"/>
-      <exclude name="org/jboss/resource/adapter/jdbc/jdk5/**"/>
-      <classpath refid="javac.classpath"/>
-    </javac>
-  </target>
- 
   <!-- Compile resource files -->
   <target name="compile-resources" depends="init">
     <mkdir dir="${build.resources}"/>
@@ -355,8 +339,11 @@
         <include name="org/jboss/resource/adapter/jdbc/PreparedStatementCache*.class"/>
         <include name="org/jboss/resource/adapter/jdbc/StatementAccess.class"/>
         <include name="org/jboss/resource/adapter/jdbc/ReentrantLock.class"/>
+        <include name="org/jboss/resource/adapter/jdbc/jdbc4/*.class"/>
+        <include name="org/jboss/resource/adapter/jdbc/jdbc4_1/*.class"/>
         <include name="org/jboss/resource/adapter/jdbc/jdk5/*.class"/>
         <include name="org/jboss/resource/adapter/jdbc/jdk6/*.class"/>
+        <include name="org/jboss/resource/adapter/jdbc/jdk7/*.class"/>
         <include name="org/jboss/resource/adapter/jdbc/URLSelectorStrategy.class"/>
         <include name="org/jboss/resource/adapter/jdbc/remote/*"/>
         <!-- JBAS-2250 hack -->
Index: tools/etc/buildmagic/buildmagic.ent
===================================================================
--- tools/etc/buildmagic/buildmagic.ent	(revision 112935)
+++ tools/etc/buildmagic/buildmagic.ent	(working copy)
@@ -32,11 +32,30 @@
   <available classname="java.lang.StackTraceElement" property="HAVE_JDK_1.4"/>
   <available classname="java.lang.Enum" property="HAVE_JDK_1.5"/>
   <available classname="java.lang.management.LockInfo" property="HAVE_JDK_1.6"/>  
-  
+  <available classname="java.util.concurrent.ForkJoinPool" property="HAVE_JDK_1.7"/>
+
   <fail unless="HAVE_JDK_1.5">
   Unsupported Java version: You need at least JDK5 to build JBoss5
   </fail>
 
+  <echo message="ant.java.version = ${ant.java.version}"/>
+  <condition property="IS_JDK_1.5">
+    <and><equals arg1="${ant.java.version}" arg2="1.5"/></and>
+  </condition>
+  <condition property="IS_JDK_1.6">
+    <and>
+      <equals arg1="${ant.java.version}" arg2="1.6"/>
+      <!-- current Ant version in buildmagic does not detect JDK 7 -->
+      <not><isset property="HAVE_JDK_1.7"/></not>
+    </and>
+  </condition>
+  <condition property="IS_JDK_1.7">
+    <!-- current Ant version in buildmagic does not detect JDK 7
+    <and><equals arg1="${ant.java.version}" arg2="1.7"/></and>
+    -->
+    <isset property="HAVE_JDK_1.7"/>
+  </condition>
+
   <!-- Setup the project environment. -->
   <dirname property="project.root" file="${basedir}"/>
   <property name="project.build" value="${project.root}/build"/>
Index: tools/etc/buildmagic/common.xml
===================================================================
--- tools/etc/buildmagic/common.xml	(revision 112935)
+++ tools/etc/buildmagic/common.xml	(working copy)
@@ -23,8 +23,19 @@
   <available classname="java.lang.StrictMath" property="HAVE_JDK_1.3"/>
   <available classname="java.lang.StackTraceElement" property="HAVE_JDK_1.4"/>
   <available classname="java.lang.Enum" property="HAVE_JDK_1.5"/>
-  <available classname="java.lang.management.LockInfo" property="HAVE_JDK_1.6"/>  
+  <available classname="java.lang.management.LockInfo" property="HAVE_JDK_1.6"/>
+  <available classname="java.util.concurrent.ForkJoinPool" property="HAVE_JDK_1.7"/>
   
+  <condition property="IS_JDK_1.5">
+    <and><equals arg1="${ant.java.version}" arg2="1.5"/></and>
+  </condition>
+  <condition property="IS_JDK_1.6">
+    <and><equals arg1="${ant.java.version}" arg2="1.6"/></and>
+  </condition>
+  <condition property="IS_JDK_1.7">
+    <and><equals arg1="${ant.java.version}" arg2="1.7"/></and>
+  </condition>
+
   <!-- Setup the basic project roots. -->
   <property name="_project.root" value=".."/>
   <path id="project.root"><pathelement location="${_project.root}"/></path>
Index: varia/build.xml
===================================================================
--- varia/build.xml	(revision 112935)
+++ varia/build.xml	(working copy)
@@ -199,8 +199,10 @@
     description="Compile all source files."/>
 
   <!-- Compile all class files -->
-  <target name="compile-classes" depends="compile-classes-jdk5, compile-classes-jdk6"/>
-  <target name="compile-classes-jdk5" depends="init" unless="HAVE_JDK_1.6">
+  <target name="compile-classes" depends="init">
+    <echo message="${IS_JDK_1.6}"/>
+    <echo message="${IS_JDK_1.7}"/>
+    <echo message="${HAVE_JDK_1.7}"/>
     <mkdir dir="${build.classes}"/>
     <javac destdir="${build.classes}"
       optimize="${javac.optimize}"
@@ -217,33 +219,15 @@
       failonerror="${javac.fail.onerror}">
       <src path="${source.java}"/>
       <classpath refid="javac.classpath"/>
-      <exclude name="org/jboss/varia/stats/*JDK6.java"/>
+      <exclude name="org/jboss/varia/stats/*JDBC4.java" unless="HAVE_JDK_1.6"/>
+      <exclude name="org/jboss/varia/stats/*JDBC4_1.java" unless="HAVE_JDK_1.7"/>
+      <exclude name="org/jboss/varia/stats/*JDK5.java" unless="IS_JDK_1.5"/>
+      <exclude name="org/jboss/varia/stats/*JDK6.java" unless="IS_JDK_1.6"/>
+      <exclude name="org/jboss/varia/stats/*JDK7.java" unless="IS_JDK_1.7"/>
       <exclude name="org/jboss/tm/plugins/tyrex/*.java"/>
       <exclude name="org/jboss/jdo/castor/*.java"/>
     </javac>
   </target>
-  <target name="compile-classes-jdk6" depends="init" if="HAVE_JDK_1.6">
-    <mkdir dir="${build.classes}"/>
-    <javac destdir="${build.classes}"
-      optimize="${javac.optimize}"
-      target="${javac.target}"
-      source="${javac.source}"
-      debug="${javac.debug}"
-      depend="${javac.depend}"
-      verbose="${javac.verbose}"
-      deprecation="${javac.deprecation}"
-      includeAntRuntime="${javac.include.ant.runtime}"
-      includeJavaRuntime="${javac.include.java.runtime}"
-      includes="${javac.includes}"
-      excludes="${javac.excludes}"
-      failonerror="${javac.fail.onerror}">
-      <src path="${source.java}"/>
-      <classpath refid="javac.classpath"/>
-      <exclude name="org/jboss/varia/stats/*JDK5.java"/>
-      <exclude name="org/jboss/tm/plugins/tyrex/*.java"/>
-      <exclude name="org/jboss/jdo/castor/*.java"/>
-    </javac>
-  </target>
 
   <!-- Compile manifests -->
   <target name="compile-etc" depends="init">
Index: varia/src/main/org/jboss/varia/stats/AbstractDataSourceInterceptorJDBC4_1.java
===================================================================
--- varia/src/main/org/jboss/varia/stats/AbstractDataSourceInterceptorJDBC4_1.java	(revision 0)
+++ varia/src/main/org/jboss/varia/stats/AbstractDataSourceInterceptorJDBC4_1.java	(revision 0)
@@ -0,0 +1,113 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright (c) 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.varia.stats;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.sql.Statement;
+import java.util.concurrent.Executor;
+import java.util.logging.Logger;
+
+/**
+ * @author <a href="mailto:cdewolf@redhat.com">Carlo de Wolf</a>
+ */
+abstract class AbstractDataSourceInterceptorJDBC4_1 extends AbstractDataSourceInterceptorJDBC4
+{
+   public Logger getParentLogger() throws SQLFeatureNotSupportedException
+   {
+      return target.getParentLogger();
+   }
+
+   // Inner
+
+   protected abstract class ConnectionInterceptor extends AbstractDataSourceInterceptorJDBC4.ConnectionInterceptor
+   {
+      protected ConnectionInterceptor(Connection target)
+      {
+         super(target);
+      }
+
+      public void setSchema(String schema) throws SQLException
+      {
+         target.setSchema(schema);
+      }
+
+      public String getSchema() throws SQLException
+      {
+         return target.getSchema();
+      }
+
+      public void abort(Executor executor) throws SQLException
+      {
+         target.abort(executor);
+      }
+
+      public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException
+      {
+         target.setNetworkTimeout(executor, milliseconds);
+      }
+
+      public int getNetworkTimeout() throws SQLException
+      {
+         return target.getNetworkTimeout();
+      }
+   }
+
+   protected abstract class StatementInterceptor extends AbstractDataSourceInterceptorJDBC4.StatementInterceptor
+   {
+      protected StatementInterceptor(Connection con, Statement target)
+      {
+         super(con, target);
+      }
+
+      public void closeOnCompletion() throws SQLException
+      {
+         target.closeOnCompletion();
+      }
+
+      public boolean isCloseOnCompletion() throws SQLException
+      {
+         return target.isCloseOnCompletion();
+      }
+   }
+
+   protected abstract class PreparedStatementInterceptor extends AbstractDataSourceInterceptorJDBC4.PreparedStatementInterceptor
+           implements PreparedStatement
+   {
+      public PreparedStatementInterceptor(Connection con, PreparedStatement target)
+      {
+         super(con, target);
+      }
+
+      public void closeOnCompletion() throws SQLException
+      {
+         target.closeOnCompletion();
+      }
+
+      public boolean isCloseOnCompletion() throws SQLException
+      {
+         return target.isCloseOnCompletion();
+      }
+   }
+}
Index: varia/src/main/org/jboss/varia/stats/DataSourceInterceptorJDK7.java
===================================================================
--- varia/src/main/org/jboss/varia/stats/DataSourceInterceptorJDK7.java	(revision 112923)
+++ varia/src/main/org/jboss/varia/stats/DataSourceInterceptorJDK7.java	(working copy)
@@ -21,908 +21,30 @@
  */
 package org.jboss.varia.stats;
 
-import java.sql.SQLException;
 import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.SQLWarning;
-import java.sql.Statement;
-import java.sql.CallableStatement;
-import java.sql.SQLClientInfoException;
 import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.Array;
-import java.sql.Blob;
-import java.sql.Clob;
-import java.sql.NClob;
-import java.sql.Date;
-import java.sql.Ref;
-import java.sql.ResultSetMetaData;
-import java.sql.RowId;
-import java.sql.Struct;
-import java.sql.SQLXML;
-import java.sql.Time;
-import java.sql.Timestamp;
+import java.sql.Statement;
 
-import java.sql.Savepoint;
-import java.sql.ParameterMetaData;
-
-import java.io.PrintWriter;
-import java.io.InputStream;
-import java.io.Reader;
-import java.util.Map;
-import java.util.Calendar;
-import java.util.Properties;
-import java.math.BigDecimal;
-import java.net.URL;
-
 /**
- * @author <a href="mailto:alex@jboss.org">Alexey Loubyansky</a>
- * @version <tt>$Revision$</tt>
- * @@jmx:mbean name="jboss.stats:name=DataSourceInterceptor"
- * extends="org.jboss.system.ServiceMBean"
+ * @author <a href="mailto:cdewolf@redhat.com">Carlo de Wolf</a>
  */
-public class DataSourceInterceptorJDK6 extends DataSourceInterceptor
+public class DataSourceInterceptorJDK7 extends AbstractDataSourceInterceptorJDBC4_1
 {
-
-   public <T>T unwrap(Class<T> iface) throws SQLException
+   @Override
+   protected AbstractDataSourceInterceptorJDBC4_1.ConnectionInterceptor createConnectionInterceptor(Connection conn)
    {
-      return target.unwrap(iface);
+      return new ConnectionInterceptor(conn){};
    }
-   
-   public boolean isWrapperFor(Class<?> iface) throws SQLException
-   {
-      return target.isWrapperFor(iface);
-   }
 
-   public Connection getConnection() throws SQLException
+   @Override
+   protected AbstractDataSourceInterceptorJDBC4_1.PreparedStatementInterceptor createPreparedStatementInterceptor(AbstractDataSourceInterceptorJDBC4.ConnectionInterceptor conn, PreparedStatement pstmt)
    {
-      return new ConnectionInterceptor(target.getConnection());
+      return new PreparedStatementInterceptor(conn, pstmt){};
    }
 
-   public Connection getConnection(String username, String password) throws SQLException
+   @Override
+   protected AbstractDataSourceInterceptorJDBC4_1.StatementInterceptor createStatementInterceptor(AbstractDataSourceInterceptorJDBC4.ConnectionInterceptor conn, Statement stmt)
    {
-      return new ConnectionInterceptor(target.getConnection());
+      return new StatementInterceptor(conn, stmt){};
    }
-
-   // Inner
-
-   public class ConnectionInterceptor
-      implements Connection
-   {
-      private final Connection target;
-
-      public ConnectionInterceptor(Connection target)
-      {
-         this.target = target;
-      }
-
-      
-      public int getHoldability() throws SQLException
-      {
-         return target.getHoldability();
-      }
-      
-
-      public int getTransactionIsolation() throws SQLException
-      {
-         return target.getTransactionIsolation();
-      }
-
-      public void clearWarnings() throws SQLException
-      {
-         target.clearWarnings();
-      }
-
-      public void close() throws SQLException
-      {
-         target.close();
-      }
-
-      public void commit() throws SQLException
-      {
-         target.commit();
-      }
-
-      public void rollback() throws SQLException
-      {
-         target.rollback();
-      }
-
-      public boolean getAutoCommit() throws SQLException
-      {
-         return target.getAutoCommit();
-      }
-
-      public boolean isClosed() throws SQLException
-      {
-         return target.isClosed();
-      }
-
-      public boolean isReadOnly() throws SQLException
-      {
-         return target.isReadOnly();
-      }
-
-      
-      public void setHoldability(int holdability) throws SQLException
-      {
-         target.setHoldability(holdability);
-      }
-      
-
-      public void setTransactionIsolation(int level) throws SQLException
-      {
-         target.setTransactionIsolation(level);
-      }
-
-      public void setAutoCommit(boolean autoCommit) throws SQLException
-      {
-         target.setAutoCommit(autoCommit);
-      }
-
-      public void setReadOnly(boolean readOnly) throws SQLException
-      {
-         target.setReadOnly(readOnly);
-      }
-
-      public String getCatalog() throws SQLException
-      {
-         return target.getCatalog();
-      }
-
-      public void setCatalog(String catalog) throws SQLException
-      {
-         target.setCatalog(catalog);
-      }
-
-      public DatabaseMetaData getMetaData() throws SQLException
-      {
-         return target.getMetaData();
-      }
-
-      public SQLWarning getWarnings() throws SQLException
-      {
-         return target.getWarnings();
-      }
-
-      
-      public Savepoint setSavepoint() throws SQLException
-      {
-         return target.setSavepoint();
-      }
-      
-
-      
-      public void releaseSavepoint(Savepoint savepoint) throws SQLException
-      {
-         target.releaseSavepoint(savepoint);
-      }
-      
-
-      
-      public void rollback(Savepoint savepoint) throws SQLException
-      {
-         target.rollback(savepoint);
-      }
-      
-
-      public Statement createStatement() throws SQLException
-      {
-         return new StatementInterceptor(this, target.createStatement());
-      }
-
-      public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
-      {
-         return new StatementInterceptor(this, target.createStatement(resultSetType, resultSetConcurrency));
-      }
-
-      
-      public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
-         throws SQLException
-      {
-         return new StatementInterceptor(this,
-            target.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability));
-      }
-      
-
-      public Map getTypeMap() throws SQLException
-      {
-         return target.getTypeMap();
-      }
-
-      public void setTypeMap(Map map) throws SQLException
-      {
-         target.setTypeMap(map);
-      }
-
-      public String nativeSQL(String sql) throws SQLException
-      {
-         return target.nativeSQL(sql);
-      }
-
-      public CallableStatement prepareCall(String sql) throws SQLException
-      {
-         return target.prepareCall(sql);
-      }
-
-      public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency)
-         throws SQLException
-      {
-         return target.prepareCall(sql, resultSetType, resultSetConcurrency);
-      }
-
-      
-      public CallableStatement prepareCall(String sql,
-                                           int resultSetType,
-                                           int resultSetConcurrency,
-                                           int resultSetHoldability) throws SQLException
-      {
-         return target.prepareCall(sql, resultSetType, resultSetConcurrency, resultSetHoldability);
-      }
-      
-
-      public PreparedStatement prepareStatement(String sql) throws SQLException
-      {
-         logSql(sql);
-         return new PreparedStatementInterceptor(this, target.prepareStatement(sql));
-      }
-
-      
-      public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
-      {
-         logSql(sql);
-         return new PreparedStatementInterceptor(this, target.prepareStatement(sql, autoGeneratedKeys));
-      }
-      
-
-      public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency)
-         throws SQLException
-      {
-         logSql(sql);
-         return new PreparedStatementInterceptor(this,
-            target.prepareStatement(sql, resultSetType, resultSetConcurrency));
-      }
-
-      
-      public PreparedStatement prepareStatement(String sql,
-                                                int resultSetType,
-                                                int resultSetConcurrency,
-                                                int resultSetHoldability) throws SQLException
-      {
-         logSql(sql);
-         return new PreparedStatementInterceptor(this,
-            target.prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability));
-      }
-      
-
-      
-      public PreparedStatement prepareStatement(String sql, int columnIndexes[]) throws SQLException
-      {
-         logSql(sql);
-         return new PreparedStatementInterceptor(this, target.prepareStatement(sql, columnIndexes));
-      }
-      
-
-      
-      public Savepoint setSavepoint(String name) throws SQLException
-      {
-         return target.setSavepoint(name);
-      }
-      
-
-      
-      public PreparedStatement prepareStatement(String sql, String columnNames[]) throws SQLException
-      {
-         logSql(sql);
-         return new PreparedStatementInterceptor(this, target.prepareStatement(sql, columnNames));
-      }
-
-      public <T>T unwrap(Class<T> iface) throws SQLException
-      {
-         return target.unwrap(iface);
-      }
-
-      public boolean isWrapperFor(Class<?> iface) throws SQLException
-      {
-         return target.isWrapperFor(iface);
-      }
-
-      public Clob createClob() throws SQLException
-      {
-         return target.createClob();
-      }
-
-      public Blob createBlob() throws SQLException
-      {
-         return target.createBlob();
-      }
-
-      public NClob createNClob() throws SQLException
-      {
-         return target.createNClob();
-      }
-
-      public SQLXML createSQLXML() throws SQLException
-      {
-         return target.createSQLXML();
-      }
-
-      public boolean isValid(int timeout) throws SQLException
-      {
-         return target.isValid(timeout);
-      }
-
-      public void setClientInfo(String name, String value) throws SQLClientInfoException
-      {
-         target.setClientInfo(name, value);
-      }
-
-      public void setClientInfo(Properties properties) throws SQLClientInfoException
-      {
-         target.setClientInfo(properties);
-      }
-
-      public String getClientInfo(String name) throws SQLException
-      {
-         return target.getClientInfo(name);
-      }
-
-      public Properties getClientInfo() throws SQLException
-      {
-         return target.getClientInfo();
-      }
-
-      public Array createArrayOf(String typeName, Object[] elements) throws SQLException
-      {
-         return target.createArrayOf(typeName, elements);
-      }
-
-      public Struct createStruct(String typeName, Object[] attributes) throws SQLException
-      {
-         return target.createStruct(typeName, attributes);
-      }
-   }
-
-   public class StatementInterceptor
-      implements Statement
-   {
-      private final Connection con;
-      private final Statement target;
-
-      public StatementInterceptor(Connection con, Statement target)
-      {
-         this.con = con;
-         this.target = target;
-      }
-
-      public int getFetchDirection() throws SQLException
-      {
-         return target.getFetchDirection();
-      }
-
-      public int getFetchSize() throws SQLException
-      {
-         return target.getFetchSize();
-      }
-
-      public int getMaxFieldSize() throws SQLException
-      {
-         return target.getMaxFieldSize();
-      }
-
-      public int getMaxRows() throws SQLException
-      {
-         return target.getMaxRows();
-      }
-
-      public int getQueryTimeout() throws SQLException
-      {
-         return target.getQueryTimeout();
-      }
-
-      public int getResultSetConcurrency() throws SQLException
-      {
-         return target.getResultSetConcurrency();
-      }
-
-      
-      public int getResultSetHoldability() throws SQLException
-      {
-         return target.getResultSetHoldability();
-      }
-      
-
-      public int getResultSetType() throws SQLException
-      {
-         return target.getResultSetType();
-      }
-
-      public int getUpdateCount() throws SQLException
-      {
-         return target.getUpdateCount();
-      }
-
-      public void cancel() throws SQLException
-      {
-         target.cancel();
-      }
-
-      public void clearBatch() throws SQLException
-      {
-         target.clearBatch();
-      }
-
-      public void clearWarnings() throws SQLException
-      {
-         target.clearWarnings();
-      }
-
-      public void close() throws SQLException
-      {
-         target.close();
-      }
-
-      public boolean getMoreResults() throws SQLException
-      {
-         return target.getMoreResults();
-      }
-
-      public int[] executeBatch() throws SQLException
-      {
-         return target.executeBatch();
-      }
-
-      public void setFetchDirection(int direction) throws SQLException
-      {
-         target.setFetchDirection(direction);
-      }
-
-      public void setFetchSize(int rows) throws SQLException
-      {
-         target.setFetchSize(rows);
-      }
-
-      public void setMaxFieldSize(int max) throws SQLException
-      {
-         target.setMaxFieldSize(max);
-      }
-
-      public void setMaxRows(int max) throws SQLException
-      {
-         target.setMaxRows(max);
-      }
-
-      public void setQueryTimeout(int seconds) throws SQLException
-      {
-         target.setQueryTimeout(seconds);
-      }
-
-      
-      public boolean getMoreResults(int current) throws SQLException
-      {
-         return target.getMoreResults(current);
-      }
-      
-
-      public void setEscapeProcessing(boolean enable) throws SQLException
-      {
-         target.setEscapeProcessing(enable);
-      }
-
-      public int executeUpdate(String sql) throws SQLException
-      {
-         logSql(sql);
-         return target.executeUpdate(sql);
-      }
-
-      public void addBatch(String sql) throws SQLException
-      {
-         logSql(sql);
-         target.addBatch(sql);
-      }
-
-      public void setCursorName(String name) throws SQLException
-      {
-         target.setCursorName(name);
-      }
-
-      public boolean execute(String sql) throws SQLException
-      {
-         logSql(sql);
-         return target.execute(sql);
-      }
-
-      
-      public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
-      {
-         logSql(sql);
-         return target.executeUpdate(sql, autoGeneratedKeys);
-      }
-      
-
-      
-      public boolean execute(String sql, int autoGeneratedKeys) throws SQLException
-      {
-         logSql(sql);
-         return target.execute(sql, autoGeneratedKeys);
-      }
-      
-
-      
-      public int executeUpdate(String sql, int columnIndexes[]) throws SQLException
-      {
-         logSql(sql);
-         return target.executeUpdate(sql, columnIndexes);
-      }
-      
-
-      
-      public boolean execute(String sql, int columnIndexes[]) throws SQLException
-      {
-         logSql(sql);
-         return target.execute(sql, columnIndexes);
-      }
-      
-
-      public Connection getConnection() throws SQLException
-      {
-         return con;
-      }
-
-      
-      public ResultSet getGeneratedKeys() throws SQLException
-      {
-         return target.getGeneratedKeys();
-      }
-      
-
-      public ResultSet getResultSet() throws SQLException
-      {
-         return target.getResultSet();
-      }
-
-      public SQLWarning getWarnings() throws SQLException
-      {
-         return target.getWarnings();
-      }
-
-      
-      public int executeUpdate(String sql, String columnNames[]) throws SQLException
-      {
-         logSql(sql);
-         return target.executeUpdate(sql, columnNames);
-      }
-      
-
-      
-      public boolean execute(String sql, String columnNames[]) throws SQLException
-      {
-         logSql(sql);
-         return target.execute(sql, columnNames);
-      }
-      
-
-      public ResultSet executeQuery(String sql) throws SQLException
-      {
-         logSql(sql);
-         return target.executeQuery(sql);
-      }
-
-      public <T>T unwrap(Class<T> iface) throws SQLException
-      {
-         return target.unwrap(iface);
-      }
-
-      public boolean isWrapperFor(Class<?> iface) throws SQLException
-      {
-         return target.isWrapperFor(iface);
-      }
-
-      public boolean isClosed() throws SQLException
-      {
-         return target.isClosed();
-      }
-
-      public void setPoolable(boolean poolable) throws SQLException
-      {
-         target.setPoolable(poolable);
-      }
-
-      public boolean isPoolable() throws SQLException
-      {
-         return target.isPoolable();
-      }
-   }
-
-   public class PreparedStatementInterceptor
-      extends StatementInterceptor
-      implements PreparedStatement
-   {
-      private final PreparedStatement target;
-
-      public PreparedStatementInterceptor(Connection con, PreparedStatement target)
-      {
-         super(con, target);
-         this.target = target;
-      }
-
-      public int executeUpdate() throws SQLException
-      {
-         return target.executeUpdate();
-      }
-
-      public void addBatch() throws SQLException
-      {
-         target.addBatch();
-      }
-
-      public void clearParameters() throws SQLException
-      {
-         target.clearParameters();
-      }
-
-      public boolean execute() throws SQLException
-      {
-         return target.execute();
-      }
-
-      public void setByte(int parameterIndex, byte x) throws SQLException
-      {
-         target.setByte(parameterIndex, x);
-      }
-
-      public void setDouble(int parameterIndex, double x) throws SQLException
-      {
-         target.setDouble(parameterIndex, x);
-      }
-
-      public void setFloat(int parameterIndex, float x) throws SQLException
-      {
-         target.setFloat(parameterIndex, x);
-      }
-
-      public void setInt(int parameterIndex, int x) throws SQLException
-      {
-         target.setInt(parameterIndex, x);
-      }
-
-      public void setNull(int parameterIndex, int sqlType) throws SQLException
-      {
-         target.setNull(parameterIndex, sqlType);
-      }
-
-      public void setLong(int parameterIndex, long x) throws SQLException
-      {
-         target.setLong(parameterIndex, x);
-      }
-
-      public void setShort(int parameterIndex, short x) throws SQLException
-      {
-         target.setShort(parameterIndex, x);
-      }
-
-      public void setBoolean(int parameterIndex, boolean x) throws SQLException
-      {
-         target.setBoolean(parameterIndex, x);
-      }
-
-      public void setBytes(int parameterIndex, byte x[]) throws SQLException
-      {
-         target.setBytes(parameterIndex, x);
-      }
-
-      public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException
-      {
-         target.setAsciiStream(parameterIndex, x, length);
-      }
-
-      public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException
-      {
-         target.setBinaryStream(parameterIndex, x, length);
-      }
-
-      public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException
-      {
-         target.setUnicodeStream(parameterIndex, x, length);
-      }
-
-      public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException
-      {
-         target.setCharacterStream(parameterIndex, reader, length);
-      }
-
-      public void setObject(int parameterIndex, Object x) throws SQLException
-      {
-         target.setObject(parameterIndex, x);
-      }
-
-      public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException
-      {
-         target.setObject(parameterIndex, x, targetSqlType);
-      }
-
-      public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException
-      {
-         target.setObject(parameterIndex, x, targetSqlType, scale);
-      }
-
-      public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException
-      {
-         target.setNull(paramIndex, sqlType, typeName);
-      }
-
-      public void setString(int parameterIndex, String x) throws SQLException
-      {
-         target.setString(parameterIndex, x);
-      }
-
-      public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException
-      {
-         target.setBigDecimal(parameterIndex, x);
-      }
-
-      
-      public void setURL(int parameterIndex, URL x) throws SQLException
-      {
-         target.setURL(parameterIndex, x);
-      }
-      
-
-      public void setArray(int i, Array x) throws SQLException
-      {
-         target.setArray(i, x);
-      }
-
-      public void setBlob(int i, Blob x) throws SQLException
-      {
-         target.setBlob(i, x);
-      }
-
-      public void setClob(int i, Clob x) throws SQLException
-      {
-         target.setClob(i, x);
-      }
-
-      public void setDate(int parameterIndex, Date x) throws SQLException
-      {
-         target.setDate(parameterIndex, x);
-      }
-
-      
-      public ParameterMetaData getParameterMetaData() throws SQLException
-      {
-         return target.getParameterMetaData();
-      }
-      
-
-      public void setRef(int i, Ref x) throws SQLException
-      {
-         target.setRef(i, x);
-      }
-
-      public ResultSet executeQuery() throws SQLException
-      {
-         return target.executeQuery();
-      }
-
-      public ResultSetMetaData getMetaData() throws SQLException
-      {
-         return target.getMetaData();
-      }
-
-      public void setTime(int parameterIndex, Time x) throws SQLException
-      {
-         target.setTime(parameterIndex, x);
-      }
-
-      public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException
-      {
-         target.setTimestamp(parameterIndex, x);
-      }
-
-      public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException
-      {
-         target.setDate(parameterIndex, x, cal);
-      }
-
-      public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException
-      {
-         target.setTime(parameterIndex, x, cal);
-      }
-
-      public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException
-      {
-         target.setTimestamp(parameterIndex, x, cal);
-      }
-
-      public void setRowId(int parameterIndex, RowId x) throws SQLException
-      {
-         target.setRowId(parameterIndex, x);
-      }
-
-      public void setNString(int parameterIndex, String value) throws SQLException
-      {
-         target.setNString(parameterIndex, value);
-      }
-
-      public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException
-      {
-         target.setNCharacterStream(parameterIndex, value, length);
-      }
-
-      public void setNClob(int parameterIndex, NClob value) throws SQLException
-      {
-         target.setNClob(parameterIndex, value);
-      }
-
-      public void setClob(int parameterIndex, Reader reader, long length) throws SQLException
-      {
-         target.setClob(parameterIndex, reader, length);
-      }
-
-      public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException
-      {
-         target.setBlob(parameterIndex, inputStream, length);
-      }
-
-      public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException
-      {
-         target.setNClob(parameterIndex, reader, length);
-      }
-
-      public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
-      {
-         target.setSQLXML(parameterIndex, xmlObject);
-      }
-
-      public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException
-      {
-         target.setAsciiStream(parameterIndex, x, length);
-      }
-
-      public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException
-      {
-         target.setBinaryStream(parameterIndex, x, length);
-      }
-
-      public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException
-      {
-         target.setCharacterStream(parameterIndex, reader, length);
-      }
-
-      public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException
-      {
-         target.setAsciiStream(parameterIndex, x);
-      }
-
-      public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException
-      {
-         target.setBinaryStream(parameterIndex, x);
-      }
-
-      public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException
-      {
-         target.setCharacterStream(parameterIndex, reader);
-      }
-
-      public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException
-      {
-         target.setNCharacterStream(parameterIndex, value);
-      }
-
-      public void setClob(int parameterIndex, Reader reader) throws SQLException
-      {
-         target.setClob(parameterIndex, reader);
-      }
-
-      public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException
-      {
-         target.setBlob(parameterIndex, inputStream);
-      }
-
-      public void setNClob(int parameterIndex, Reader reader) throws SQLException
-      {
-         target.setNClob(parameterIndex, reader);
-      }
-   }
 }
Index: varia/src/main/org/jboss/varia/stats/AbstractDataSourceInterceptorJDBC4.java
===================================================================
--- varia/src/main/org/jboss/varia/stats/AbstractDataSourceInterceptorJDBC4.java	(revision 112923)
+++ varia/src/main/org/jboss/varia/stats/AbstractDataSourceInterceptorJDBC4.java	(working copy)
@@ -21,48 +21,45 @@
  */
 package org.jboss.varia.stats;
 
-import java.sql.SQLException;
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.SQLWarning;
-import java.sql.Statement;
-import java.sql.CallableStatement;
-import java.sql.SQLClientInfoException;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
+import java.io.InputStream;
+import java.io.Reader;
+import java.math.BigDecimal;
+import java.net.URL;
 import java.sql.Array;
 import java.sql.Blob;
+import java.sql.CallableStatement;
 import java.sql.Clob;
-import java.sql.NClob;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
 import java.sql.Date;
+import java.sql.NClob;
+import java.sql.ParameterMetaData;
+import java.sql.PreparedStatement;
 import java.sql.Ref;
+import java.sql.ResultSet;
 import java.sql.ResultSetMetaData;
 import java.sql.RowId;
-import java.sql.Struct;
+import java.sql.SQLClientInfoException;
+import java.sql.SQLException;
+import java.sql.SQLWarning;
 import java.sql.SQLXML;
+import java.sql.Savepoint;
+import java.sql.Statement;
+import java.sql.Struct;
 import java.sql.Time;
 import java.sql.Timestamp;
-
-import java.sql.Savepoint;
-import java.sql.ParameterMetaData;
-
-import java.io.PrintWriter;
-import java.io.InputStream;
-import java.io.Reader;
-import java.util.Map;
 import java.util.Calendar;
+import java.util.Map;
 import java.util.Properties;
-import java.math.BigDecimal;
-import java.net.URL;
 
 /**
- * @author <a href="mailto:alex@jboss.org">Alexey Loubyansky</a>
- * @version <tt>$Revision$</tt>
- * @@jmx:mbean name="jboss.stats:name=DataSourceInterceptor"
- * extends="org.jboss.system.ServiceMBean"
+ * @author <a href="mailto:cdewolf@redhat.com">Carlo de Wolf</a>
  */
-public class DataSourceInterceptorJDK6 extends DataSourceInterceptor
+abstract class AbstractDataSourceInterceptorJDBC4 extends DataSourceInterceptor
 {
+   protected abstract ConnectionInterceptor createConnectionInterceptor(final Connection conn);
+   protected abstract PreparedStatementInterceptor createPreparedStatementInterceptor(final ConnectionInterceptor conn, final PreparedStatement pstmt);
+   protected abstract StatementInterceptor createStatementInterceptor(final ConnectionInterceptor conn, final Statement stmt);
 
    public <T>T unwrap(Class<T> iface) throws SQLException
    {
@@ -76,20 +73,20 @@
 
    public Connection getConnection() throws SQLException
    {
-      return new ConnectionInterceptor(target.getConnection());
+      return createConnectionInterceptor(target.getConnection());
    }
 
    public Connection getConnection(String username, String password) throws SQLException
    {
-      return new ConnectionInterceptor(target.getConnection());
+      return createConnectionInterceptor(target.getConnection());
    }
 
    // Inner
 
-   public class ConnectionInterceptor
+   protected abstract class ConnectionInterceptor
       implements Connection
    {
-      private final Connection target;
+      protected final Connection target;
 
       public ConnectionInterceptor(Connection target)
       {
@@ -208,19 +205,19 @@
 
       public Statement createStatement() throws SQLException
       {
-         return new StatementInterceptor(this, target.createStatement());
+         return createStatementInterceptor(this, target.createStatement());
       }
 
       public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
       {
-         return new StatementInterceptor(this, target.createStatement(resultSetType, resultSetConcurrency));
+         return createStatementInterceptor(this, target.createStatement(resultSetType, resultSetConcurrency));
       }
 
       
       public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
          throws SQLException
       {
-         return new StatementInterceptor(this,
+         return createStatementInterceptor(this,
             target.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability));
       }
       
@@ -264,14 +261,14 @@
       public PreparedStatement prepareStatement(String sql) throws SQLException
       {
          logSql(sql);
-         return new PreparedStatementInterceptor(this, target.prepareStatement(sql));
+         return createPreparedStatementInterceptor(this, target.prepareStatement(sql));
       }
 
       
       public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
       {
          logSql(sql);
-         return new PreparedStatementInterceptor(this, target.prepareStatement(sql, autoGeneratedKeys));
+         return createPreparedStatementInterceptor(this, target.prepareStatement(sql, autoGeneratedKeys));
       }
       
 
@@ -279,7 +276,7 @@
          throws SQLException
       {
          logSql(sql);
-         return new PreparedStatementInterceptor(this,
+         return createPreparedStatementInterceptor(this,
             target.prepareStatement(sql, resultSetType, resultSetConcurrency));
       }
 
@@ -290,7 +287,7 @@
                                                 int resultSetHoldability) throws SQLException
       {
          logSql(sql);
-         return new PreparedStatementInterceptor(this,
+         return createPreparedStatementInterceptor(this,
             target.prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability));
       }
       
@@ -299,7 +296,7 @@
       public PreparedStatement prepareStatement(String sql, int columnIndexes[]) throws SQLException
       {
          logSql(sql);
-         return new PreparedStatementInterceptor(this, target.prepareStatement(sql, columnIndexes));
+         return createPreparedStatementInterceptor(this, target.prepareStatement(sql, columnIndexes));
       }
       
 
@@ -314,7 +311,7 @@
       public PreparedStatement prepareStatement(String sql, String columnNames[]) throws SQLException
       {
          logSql(sql);
-         return new PreparedStatementInterceptor(this, target.prepareStatement(sql, columnNames));
+         return createPreparedStatementInterceptor(this, target.prepareStatement(sql, columnNames));
       }
 
       public <T>T unwrap(Class<T> iface) throws SQLException
@@ -383,11 +380,11 @@
       }
    }
 
-   public class StatementInterceptor
+   protected abstract class StatementInterceptor
       implements Statement
    {
-      private final Connection con;
-      private final Statement target;
+      protected final Connection con;
+      protected final Statement target;
 
       public StatementInterceptor(Connection con, Statement target)
       {
@@ -634,11 +631,11 @@
       }
    }
 
-   public class PreparedStatementInterceptor
+   protected abstract class PreparedStatementInterceptor
       extends StatementInterceptor
       implements PreparedStatement
    {
-      private final PreparedStatement target;
+      protected final PreparedStatement target;
 
       public PreparedStatementInterceptor(Connection con, PreparedStatement target)
       {
