[jboss-cvs] JBossAS SVN: r74998 - in branches/Branch_4_2_JDK6: connector/src/main/org/jboss/resource/adapter/jdbc and 8 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jun 24 13:36:19 EDT 2008


Author: smcgowan at redhat.com
Date: 2008-06-24 13:36:19 -0400 (Tue, 24 Jun 2008)
New Revision: 74998

Added:
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/JBossWrapper.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedConnectionFactory.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/CachedCallableStatementJDK5.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/CachedPreparedStatementJDK5.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedCallableStatementJDK5.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedConnectionFactoryJDK5.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedConnectionJDK5.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedPreparedStatementJDK5.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedResultSetJDK5.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedStatementJDK5.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/CachedCallableStatementJDK6.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/CachedPreparedStatementJDK6.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedCallableStatementJDK6.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedConnectionFactoryJDK6.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedConnectionJDK6.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedPreparedStatementJDK6.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedResultSetJDK6.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedStatementJDK6.java
Modified:
   branches/Branch_4_2_JDK6/connector/build.xml
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnection.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnectionFactory.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/CachedCallableStatement.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/CachedPreparedStatement.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedCallableStatement.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedConnection.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedPreparedStatement.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedResultSet.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedStatement.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrapperDataSource.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/remote/SerializableParameterMetaData.java
   branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/remote/SerializableResultSetMetaData.java
   branches/Branch_4_2_JDK6/testsuite/build.sh
   branches/Branch_4_2_JDK6/testsuite/src/main/org/jboss/test/jca/adapter/MockedXADataSource.java
   branches/Branch_4_2_JDK6/testsuite/src/main/org/jboss/test/jca/jdbc/TestConnection.java
   branches/Branch_4_2_JDK6/testsuite/src/main/org/jboss/test/jca/jdbc/TestPreparedStatement.java
   branches/Branch_4_2_JDK6/testsuite/src/main/org/jboss/test/jca/jdbc/TestStatement.java
   branches/Branch_4_2_JDK6/testsuite/src/main/org/jboss/test/security/test/LoginModulesUnitTestCase.java
   branches/Branch_4_2_JDK6/varia/src/main/org/jboss/varia/stats/DataSourceInterceptor.java
Log:
JBAS-4501 - updates to compile with JDK6

Modified: branches/Branch_4_2_JDK6/connector/build.xml
===================================================================
--- branches/Branch_4_2_JDK6/connector/build.xml	2008-06-24 17:17:02 UTC (rev 74997)
+++ branches/Branch_4_2_JDK6/connector/build.xml	2008-06-24 17:36:19 UTC (rev 74998)
@@ -181,7 +181,8 @@
     description="Compile all source files."/>
 
   <!-- Compile all class files -->
-  <target name="compile-classes" depends="init">
+  <target name="compile-classes" depends="compile-classes-jdk5, compile-classes-jdk6"/>
+  <target name="compile-classes-jdk5" depends="init" unless="HAVE_JDK_1.6">
     <mkdir dir="${build.classes}"/>
 
     <!-- compile the non adapter classes from regular source -->
@@ -199,10 +200,34 @@
       excludes="${javac.excludes}"
       failonerror="${javac.fail.onerror}">
       <src path="${source.java}"/>
+      <exclude name="org/jboss/resource/adapter/jdbc/jdk6/**"/>
       <classpath refid="javac.classpath"/>
     </javac>
   </target>
  
+  <target name="compile-classes-jdk6" depends="init" if="HAVE_JDK_1.6">
+    <mkdir dir="${build.classes}"/>
+
+    <!-- compile the non adapter classes from regular source -->
+    <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}"/>
+      <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}"/>
@@ -263,11 +288,14 @@
         <include name="org/jboss/resource/adapter/jdbc/vendor/*.class"/>
         <include name="org/jboss/resource/adapter/jdbc/Null*.class"/>
         <include name="org/jboss/resource/adapter/jdbc/Wrap*.class"/>
+        <include name="org/jboss/resource/adapter/jdbc/JBossWrapper.class"/>
         <include name="org/jboss/resource/adapter/jdbc/BaseWrap*.class"/>
         <include name="org/jboss/resource/adapter/jdbc/CachedCallableStatement.class"/>
         <include name="org/jboss/resource/adapter/jdbc/CachedPreparedStatement.class"/>
         <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/jdk5/*class"/>
+        <include name="org/jboss/resource/adapter/jdbc/jdk6/*class"/>
         <include name="org/jboss/resource/adapter/jdbc/remote/*"/>
         <!-- JBAS-2250 hack -->
         <include name="org/jboss/ejb/plugins/cmp/jdbc/*" />

Modified: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnection.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnection.java	2008-06-24 17:17:02 UTC (rev 74997)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnection.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -58,50 +58,91 @@
  *
  * @author <a href="mailto:d_jencks at users.sourceforge.net">David Jencks</a>
  * @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:weston.price at jboss.com>Weston Price</a>
  * @version $Revision$
  */
 
-public abstract class BaseWrapperManagedConnection
-   implements  ManagedConnection , JBossConnectionStatistics
+public abstract class BaseWrapperManagedConnection implements ManagedConnection , JBossConnectionStatistics
 {
+   private static final WrappedConnectionFactory wrappedConnectionFactory;
+   
    protected final BaseWrapperManagedConnectionFactory mcf;
+
    protected final Connection con;
+
    protected final Properties props;
+
    private final int transactionIsolation;
+
    private final boolean readOnly;
 
    private ReentrantLock lock = new ReentrantLock();
-   
+
    private final Collection cels = new ArrayList();
+
    private final Set handles = new HashSet();
+
    private PreparedStatementCache psCache = null;
-   
+
    protected final Object stateLock = new Object();
-   
+
    protected boolean inManagedTransaction = false;
+
    protected SynchronizedBoolean inLocalTransaction = new SynchronizedBoolean(false);
+
    protected boolean jdbcAutoCommit = true;
+
    protected boolean underlyingAutoCommit = true;
+
    protected boolean jdbcReadOnly;
+
    protected boolean underlyingReadOnly;
+
    protected int jdbcTransactionIsolation;
+
    protected boolean destroyed = false;
+   
+   static
+   {
+      Class connectionFactory = null;
+      try
+      {
+         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");
+         }
+         catch (ClassNotFoundException ex)
+         {
+            throw new RuntimeException("Unabled to load wrapped connection factory", ex);
+         }
+      }
+      try
+      {
+         wrappedConnectionFactory = (WrappedConnectionFactory) connectionFactory.newInstance();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException("Error initializign connection factory", e);
+      }
+   }
 
-   public BaseWrapperManagedConnection (final BaseWrapperManagedConnectionFactory mcf,
-                                  final Connection con,
-                                  final Properties props,
-                                  final int transactionIsolation,
-                                  final int psCacheSize)
-      throws SQLException
+   public BaseWrapperManagedConnection(final BaseWrapperManagedConnectionFactory mcf, final Connection con,
+         final Properties props, final int transactionIsolation, final int psCacheSize) throws SQLException
    {
       this.mcf = mcf;
       this.con = con;
       this.props = props;
+
       if (psCacheSize > 0)
-          psCache = new PreparedStatementCache(psCacheSize);
+         psCache = new PreparedStatementCache(psCacheSize);
 
       if (transactionIsolation == -1)
          this.transactionIsolation = con.getTransactionIsolation();
+
       else
       {
          this.transactionIsolation = transactionIsolation;
@@ -148,8 +189,8 @@
    {
       if (!(handle instanceof WrappedConnection))
          throw new JBossResourceException("Wrong kind of connection handle to associate" + handle);
-      ((WrappedConnection)handle).setManagedConnection(this);
-      synchronized(handles)
+      ((WrappedConnection) handle).setManagedConnection(this);
+      synchronized (handles)
       {
          handles.add(handle);
       }
@@ -176,9 +217,9 @@
    {
       synchronized (handles)
       {
-         for (Iterator i = handles.iterator(); i.hasNext(); )
+         for (Iterator i = handles.iterator(); i.hasNext();)
          {
-            WrappedConnection lc = (WrappedConnection)i.next();
+            WrappedConnection lc = (WrappedConnection) i.next();
             lc.setManagedConnection(null);
          }
          handles.clear();
@@ -200,18 +241,47 @@
                mcf.log.warn("Error resetting transaction isolation ", e);
             }
          }
-         // I'm recreating the lock object when we return to the pool
-         // because it looks too nasty to expect the connection handle
-         // to unlock properly in certain race conditions
-         // where the dissociation of the managed connection is "random".
-         lock = new ReentrantLock();
       }
+      // I'm recreating the lock object when we return to the pool
+      // because it looks too nasty to expect the connection handle
+      // to unlock properly in certain race conditions
+      // where the dissociation of the managed connection is "random".
+      lock = new ReentrantLock();
    }
 
+   protected void lock()
+   {
+      lock.lock();
+   }
+
+   protected void tryLock() throws SQLException
+   {
+      int tryLock = mcf.getUseTryLock();
+      if (tryLock <= 0)
+      {
+         lock();
+         return;
+      }
+      try
+      {
+         if (lock.tryLock(tryLock, TimeUnit.SECONDS) == false)
+            throw new SQLException("Unable to obtain lock in " + tryLock + " seconds: " + this);
+      }
+      catch (InterruptedException e)
+      {
+         throw new SQLException("Interrupted attempting lock: " + this);
+      }
+   }
+   
+   protected void unlock()
+   {
+      lock.unlock();
+   }
+
    public Object getConnection(Subject subject, ConnectionRequestInfo cri) throws ResourceException
    {
       checkIdentity(subject, cri);
-      WrappedConnection lc =  new WrappedConnection(this);
+      WrappedConnection lc = wrappedConnectionFactory.createWrappedConnection(this);
       synchronized (handles)
       {
          handles.add(lc);
@@ -252,35 +322,12 @@
       }
    }
 
-   protected void lock()
+   public Properties getProperties()
    {
-      lock.lock();
+      return this.props;
+
    }
 
-   protected void tryLock() throws SQLException
-   {
-      int tryLock = mcf.getUseTryLock();
-      if (tryLock <= 0)
-      {
-         lock();
-         return;
-      }
-      try
-      {
-         if (lock.tryLock(tryLock, TimeUnit.SECONDS) == false)
-            throw new SQLException("Unable to obtain lock in " + tryLock + " seconds: " + this);
-      }
-      catch (InterruptedException e)
-      {
-         throw new SQLException("Interrupted attempting lock: " + this);
-      }
-   }
-   
-   protected void unlock()
-   {
-      lock.unlock();
-   }
-   
    void closeHandle(WrappedConnection handle)
    {
       synchronized (stateLock)
@@ -289,20 +336,20 @@
             return;
       }
 
-      synchronized(handles)
+      synchronized (handles)
       {
          handles.remove(handle);
       }
       ConnectionEvent ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
       ce.setConnectionHandle(handle);
       Collection copy = null;
-      synchronized(cels)
+      synchronized (cels)
       {
          copy = new ArrayList(cels);
       }
-      for (Iterator i = copy.iterator(); i.hasNext(); )
+      for (Iterator i = copy.iterator(); i.hasNext();)
       {
-         ConnectionEventListener cel = (ConnectionEventListener)i.next();
+         ConnectionEventListener cel = (ConnectionEventListener) i.next();
          cel.connectionClosed(ce);
       }
    }
@@ -313,6 +360,7 @@
          broadcastConnectionError(t);
    }
 
+
    protected void broadcastConnectionError(Throwable e)
    {
       synchronized (stateLock)
@@ -325,7 +373,7 @@
             return;
          }
       }
-      
+
       Exception ex = null;
       if (e instanceof Exception)
          ex = (Exception) e;
@@ -333,13 +381,13 @@
          ex = new ResourceAdapterInternalException("Unexpected error", e);
       ConnectionEvent ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, ex);
       Collection copy = null;
-      synchronized(cels)
+      synchronized (cels)
       {
          copy = new ArrayList(cels);
       }
-      for (Iterator i = copy.iterator(); i.hasNext(); )
+      for (Iterator i = copy.iterator(); i.hasNext();)
       {
-         ConnectionEventListener cel = (ConnectionEventListener)i.next();
+         ConnectionEventListener cel = (ConnectionEventListener) i.next();
          try
          {
             cel.connectionErrorOccurred(ce);
@@ -351,8 +399,7 @@
       }
    }
 
-   Connection getConnection()
-      throws SQLException
+   Connection getConnection() throws SQLException
    {
       if (con == null)
          throw new SQLException("Connection has been destroyed!!!");
@@ -363,7 +410,8 @@
    {
       if (psCache != null)
       {
-         PreparedStatementCache.Key key = new PreparedStatementCache.Key(sql, PreparedStatementCache.Key.PREPARED_STATEMENT, resultSetType, resultSetConcurrency);
+         PreparedStatementCache.Key key = new PreparedStatementCache.Key(sql,
+               PreparedStatementCache.Key.PREPARED_STATEMENT, resultSetType, resultSetConcurrency);
          CachedPreparedStatement cachedps = (CachedPreparedStatement) psCache.get(key);
          if (cachedps != null)
          {
@@ -375,7 +423,7 @@
          else
          {
             PreparedStatement ps = doPrepareStatement(sql, resultSetType, resultSetConcurrency);
-            cachedps = new CachedPreparedStatement(ps);
+            cachedps = wrappedConnectionFactory.createCachedPreparedStatement(ps);
             psCache.insert(key, cachedps);
          }
          return cachedps;
@@ -393,8 +441,9 @@
    {
       if (psCache != null)
       {
-         PreparedStatementCache.Key key = new PreparedStatementCache.Key(sql, PreparedStatementCache.Key.CALLABLE_STATEMENT, resultSetType, resultSetConcurrency);
-         CachedCallableStatement cachedps = (CachedCallableStatement)psCache.get(key);
+         PreparedStatementCache.Key key = new PreparedStatementCache.Key(sql,
+               PreparedStatementCache.Key.CALLABLE_STATEMENT, resultSetType, resultSetConcurrency);
+         CachedCallableStatement cachedps = (CachedCallableStatement) psCache.get(key);
          if (cachedps != null)
          {
             if (canUse(cachedps))
@@ -405,7 +454,7 @@
          else
          {
             CallableStatement cs = doPrepareCall(sql, resultSetType, resultSetConcurrency);
-            cachedps = new CachedCallableStatement(cs);
+            cachedps = wrappedConnectionFactory.createCachedCallableStatement(cs);
             psCache.insert(key, cachedps);
          }
          return cachedps;
@@ -418,29 +467,28 @@
    {
       return con.prepareCall(sql, resultSetType, resultSetConcurrency);
    }
-   
+
    boolean canUse(CachedPreparedStatement cachedps)
    {
       // Nobody is using it so we are ok
       if (cachedps.isInUse() == false)
          return true;
-      
+
       // Cannot reuse prepared statements in auto commit mode
       // if will close the previous usage of the PS
       if (underlyingAutoCommit == true)
          return false;
-      
+
       // We have been told not to share
       return mcf.sharePS;
    }
-   
+
    protected Logger getLog()
    {
       return mcf.log;
    }
 
-   private void checkIdentity(Subject subject, ConnectionRequestInfo cri)
-      throws ResourceException
+   private void checkIdentity(Subject subject, ConnectionRequestInfo cri) throws ResourceException
    {
       Properties newProps = mcf.getConnectionProperties(subject, cri);
       if (!props.equals(newProps))
@@ -474,7 +522,7 @@
       if (jdbcAutoCommit == false && inLocalTransaction.set(true) == false)
       {
          ArrayList copy;
-         synchronized(cels)
+         synchronized (cels)
          {
             copy = new ArrayList(cels);
          }
@@ -492,7 +540,7 @@
             }
          }
       }
-      
+
       checkState();
    }
 
@@ -511,7 +559,7 @@
 
    boolean isJdbcAutoCommit()
    {
-      return inManagedTransaction? false: jdbcAutoCommit;
+      return inManagedTransaction ? false : jdbcAutoCommit;
    }
 
    void setJdbcAutoCommit(final boolean jdbcAutoCommit) throws SQLException
@@ -526,7 +574,7 @@
       if (jdbcAutoCommit && inLocalTransaction.set(false))
       {
          ArrayList copy;
-         synchronized(cels)
+         synchronized (cels)
          {
             copy = new ArrayList(cels);
          }
@@ -589,7 +637,7 @@
       if (inLocalTransaction.set(false))
       {
          ArrayList copy;
-         synchronized(cels)
+         synchronized (cels)
          {
             copy = new ArrayList(cels);
          }
@@ -623,7 +671,7 @@
       if (inLocalTransaction.set(false))
       {
          ArrayList copy;
-         synchronized(cels)
+         synchronized (cels)
          {
             copy = new ArrayList(cels);
          }
@@ -664,12 +712,12 @@
    {
       return mcf.isTransactionQueryTimeout;
    }
-   
+
    int getQueryTimeout()
    {
       return mcf.getQueryTimeout();
    }
-   
+
    protected void checkException(SQLException e) throws ResourceException
    {
       connectionError(e);
@@ -683,5 +731,4 @@
 	   else
 		   return "-1"; //-1 indicates NoCache
    }
-   
 }

Modified: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnectionFactory.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnectionFactory.java	2008-06-24 17:17:02 UTC (rev 74997)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/BaseWrapperManagedConnectionFactory.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -23,12 +23,16 @@
 
 import java.io.PrintWriter;
 import java.io.Serializable;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.sql.Connection;
 import java.sql.SQLException;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Properties;
 import java.util.Set;
 
@@ -46,9 +50,9 @@
 /**
  * BaseWrapperManagedConnectionFactory
  *
- * @author <a href="mailto:d_jencks at users.sourceforge.net">David Jencks</a>
- * @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>
- * @author <a href="weston.price at jboss.com">Weston Price</a>
+ * @author <a href="mailto:d_jencks at users.sourceforge.net">David Jencks</a>/
+ * @author <a href="mailto:weston.price at jboss.com">Weston Price</a>
+ * 
  * @version $Revision$
  */
 
@@ -119,12 +123,12 @@
    protected boolean isTransactionQueryTimeout = false;
    
    protected int queryTimeout = 0;
+   
+   private boolean validateOnMatch = true;
 
-   private boolean validateOnMatch;
-
    /** Whether to use a try lock */
    private int useTryLock = 0;
-   
+
    public BaseWrapperManagedConnectionFactory ()
    {
 
@@ -132,13 +136,11 @@
 
    public PrintWriter getLogWriter() throws ResourceException
    {
-      // TODO: implement this javax.resource.spi.ManagedConnectionFactory method
       return null;
    }
 
    public void setLogWriter(PrintWriter param1) throws ResourceException
    {
-      // TODO: implement this javax.resource.spi.ManagedConnectionFactory method
    }
 
    public Object createConnectionFactory(ConnectionManager cm) throws ResourceException
@@ -148,7 +150,7 @@
 
    public Object createConnectionFactory() throws ResourceException
    {
-      throw new JBossResourceException("NYI");
+      throw new JBossResourceException("Resource Adapter does not currently support running in a non-managed environment.");
    }
 
    public String getUserName()
@@ -268,16 +270,12 @@
    
    public boolean getValidateOnMatch()
    {
-      
       return this.validateOnMatch;
-      
    }
-   
+
    public void setValidateOnMatch(boolean validateOnMatch)
    {
-      
       this.validateOnMatch = validateOnMatch;
-      
    }
    
    public void setTrackStatements(String value)
@@ -332,7 +330,7 @@
    {
       queryTimeout = timeout;
    }
- 
+   
    /**
     * Get the useTryLock.
     * 
@@ -352,29 +350,29 @@
    {
       this.useTryLock = useTryLock;
    }
-
+   
    public Set getInvalidConnections(final Set connectionSet) throws ResourceException
    {
-      
       final Set invalid = new HashSet();
-      
-      for(Iterator iter = connectionSet.iterator(); iter.hasNext();){
-         
-         Object anonymous = iter.next();
-         
+
+      for (Iterator iter = connectionSet.iterator(); iter.hasNext();)
+      {
+         final Object anonymous = iter.next();
+
          if (anonymous instanceof BaseWrapperManagedConnection)
          {
             BaseWrapperManagedConnection mc = (BaseWrapperManagedConnection) anonymous;
-            
-            if(!mc.checkValid()){
-               
+
+            if (!mc.checkValid())
+            {
                invalid.add(mc);
+
             }
-            
+
          }
-         
+
       }
-   
+
       return invalid;
    }
    
@@ -485,6 +483,7 @@
       return null;
    }
 
+   
    static class SubjectActions implements PrivilegedAction
    {
       Subject subject;

Modified: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/CachedCallableStatement.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/CachedCallableStatement.java	2008-06-24 17:17:02 UTC (rev 74997)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/CachedCallableStatement.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -44,7 +44,7 @@
  * @author Scott.Stark at jboss.org
  * @version $Revision$
  */
-public class CachedCallableStatement extends CachedPreparedStatement
+public abstract class CachedCallableStatement extends CachedPreparedStatement
    implements CallableStatement
 {
    private final CallableStatement cs;
@@ -305,6 +305,7 @@
       cs.setObject(parameterName, x, targetSqlType, scale);
    }
 
+   @SuppressWarnings("unchecked")
    public Object getObject(int i, Map map) throws SQLException
    {
       return cs.getObject(i, map);
@@ -415,6 +416,7 @@
       return cs.getTimestamp(parameterIndex, cal);
    }
 
+   @SuppressWarnings("unchecked")
    public Object getObject(String parameterName, Map map) throws SQLException
    {
       return cs.getObject(parameterName, map);
@@ -450,4 +452,9 @@
       cs.setTimestamp(parameterName, x, cal);
    }
 
+   protected CallableStatement getWrappedObject() throws SQLException
+   {
+      return cs;
+   }
+
 }

Modified: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/CachedPreparedStatement.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/CachedPreparedStatement.java	2008-06-24 17:17:02 UTC (rev 74997)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/CachedPreparedStatement.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -46,7 +46,7 @@
  * @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
-public class CachedPreparedStatement implements PreparedStatement
+public abstract class CachedPreparedStatement extends JBossWrapper implements PreparedStatement
 {
    private PreparedStatement ps;
    private SynchronizedBoolean cached = new SynchronizedBoolean(true);
@@ -174,9 +174,7 @@
       ps.setAsciiStream(parameterIndex, x, length);
    }
 
-   /**
-    * @deprecated
-    */
+   @Deprecated
    public void setUnicodeStream(int parameterIndex, java.io.InputStream x,
                                 int length) throws SQLException
    {
@@ -527,4 +525,9 @@
    {
       return ps.getResultSetHoldability();
    }
+
+   protected PreparedStatement getWrappedObject() throws SQLException
+   {
+      return ps;
+   }
 }

Added: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/JBossWrapper.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/JBossWrapper.java	                        (rev 0)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/JBossWrapper.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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;
+
+import java.io.Serializable;
+import java.sql.SQLException;
+
+/**
+ * JBossWrapper.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossWrapper implements Serializable
+{
+   /** The serialVersionUID */
+   private static final long serialVersionUID = -4018404397552543628L;
+
+   public boolean isWrapperFor(Class<?> iface) throws SQLException
+   {
+      if (iface == null)
+         throw new IllegalArgumentException("Null interface");
+      Object wrapped = getWrappedObject();
+      if (wrapped == null)
+         return false;
+      return iface.isAssignableFrom(wrapped.getClass());
+   }
+
+   public <T> T unwrap(Class<T> iface) throws SQLException
+   {
+      if (iface == null)
+         throw new IllegalArgumentException("Null interface");
+      Object wrapped = getWrappedObject();
+      if (wrapped != null && iface.isAssignableFrom(wrapped.getClass()))
+         return iface.cast(wrapped);
+      throw new SQLException("Not a wrapper for: " + iface.getName());
+   }
+   
+   protected Object getWrappedObject() throws SQLException
+   {
+      return null;
+   }
+}

Modified: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedCallableStatement.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedCallableStatement.java	2008-06-24 17:17:02 UTC (rev 74997)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedCallableStatement.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -30,6 +30,7 @@
 import java.sql.CallableStatement;
 import java.sql.Clob;
 import java.sql.Date;
+import java.sql.PreparedStatement;
 import java.sql.Ref;
 import java.sql.SQLException;
 import java.sql.Time;
@@ -44,7 +45,7 @@
  * @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
-public class WrappedCallableStatement extends WrappedPreparedStatement implements CallableStatement
+public abstract class WrappedCallableStatement extends WrappedPreparedStatement implements CallableStatement
 {
    private final CallableStatement cs;
 
@@ -54,6 +55,11 @@
       this.cs = cs;
    }
 
+   public CallableStatement getUnderlyingStatement() throws SQLException
+   {
+      return (CallableStatement) super.getUnderlyingStatement();
+   }
+
    public Object getObject(int parameterIndex) throws SQLException
    {
       checkState();
@@ -1083,4 +1089,9 @@
          throw checkException(t);
       }
    }
+
+   protected CallableStatement getWrappedObject() throws SQLException
+   {
+      return (CallableStatement) super.getWrappedObject();
+   }
 }

Modified: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedConnection.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedConnection.java	2008-06-24 17:17:02 UTC (rev 74997)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedConnection.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -34,8 +34,6 @@
 import java.util.Iterator;
 import java.util.Map;
 
-import javax.resource.spi.ManagedConnection;
-
 import org.jboss.logging.Logger;
 import org.jboss.util.NestedSQLException;
 
@@ -46,7 +44,7 @@
  * @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
-public class WrappedConnection implements Connection
+public abstract class WrappedConnection extends JBossWrapper implements Connection
 {
    private static final Logger log = Logger.getLogger(WrappedConnection.class);
 
@@ -54,7 +52,7 @@
 
    private WrapperDataSource dataSource;
    
-   private HashMap statements;
+   private HashMap<WrappedStatement, Throwable> statements;
 
    private boolean closed = false;
 
@@ -91,7 +89,7 @@
       // We recreate the lock when returned to the pool
       // so missing the unlock after disassociation is not important
    }
-   
+
    public WrapperDataSource getDataSource()
    {
       return dataSource;
@@ -133,13 +131,13 @@
             {
                if (statements != null)
                {
-                  for (Iterator i = statements.entrySet().iterator(); i.hasNext(); )
+                  for (Iterator<Map.Entry<WrappedStatement, Throwable>> i = statements.entrySet().iterator(); i.hasNext(); )
                   {
-                     Map.Entry entry = (Map.Entry) i.next();
-                     WrappedStatement ws = (WrappedStatement) entry.getKey();
+                     Map.Entry<WrappedStatement, Throwable> entry = i.next();
+                     WrappedStatement ws = entry.getKey();
                      if (trackStatements == BaseWrapperManagedConnectionFactory.TRACK_STATEMENTS_TRUE_INT)
                      {
-                        Throwable stackTrace = (Throwable) entry.getValue();
+                        Throwable stackTrace = entry.getValue();
                         log.warn("Closing a statement you left open, please do your own housekeeping", stackTrace);
                      }
                      try
@@ -165,6 +163,8 @@
       return closed;
    }
 
+   protected abstract WrappedStatement wrapStatement(Statement statement);
+   
    public Statement createStatement() throws SQLException
    {
       lock();
@@ -173,7 +173,7 @@
          checkTransaction();
          try
          {
-            return new WrappedStatement(this, mc.getConnection().createStatement());
+            return wrapStatement(mc.getConnection().createStatement());
          }
          catch (Throwable t)
          {
@@ -194,7 +194,7 @@
          checkTransaction();
          try
          {
-            return new WrappedStatement(this, mc.getConnection().createStatement(resultSetType, resultSetConcurrency));
+            return wrapStatement(mc.getConnection().createStatement(resultSetType, resultSetConcurrency));
          }
          catch (Throwable t)
          {
@@ -216,7 +216,7 @@
          checkTransaction();
          try
          {
-            return new WrappedStatement(this, mc.getConnection()
+            return wrapStatement(mc.getConnection()
                   .createStatement(resultSetType, resultSetConcurrency, resultSetHoldability));
          }
          catch (Throwable t)
@@ -230,6 +230,8 @@
       }
    }
 
+   protected abstract WrappedPreparedStatement wrapPreparedStatement(PreparedStatement statement);
+
    public PreparedStatement prepareStatement(String sql) throws SQLException
    {
       lock();
@@ -238,7 +240,7 @@
          checkTransaction();
          try
          {
-            return new WrappedPreparedStatement(this, mc.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY));
+            return wrapPreparedStatement(mc.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY));
          }
          catch (Throwable t)
          {
@@ -260,7 +262,7 @@
          checkTransaction();
          try
          {
-            return new WrappedPreparedStatement(this, mc.prepareStatement(sql, resultSetType, resultSetConcurrency));
+            return wrapPreparedStatement(mc.prepareStatement(sql, resultSetType, resultSetConcurrency));
          }
          catch (Throwable t)
          {
@@ -282,7 +284,7 @@
          checkTransaction();
          try
          {
-            return new WrappedPreparedStatement(this, mc.getConnection()
+            return wrapPreparedStatement(mc.getConnection()
                   .prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability));
          }
          catch (Throwable t)
@@ -304,7 +306,7 @@
          checkTransaction();
          try
          {
-            return new WrappedPreparedStatement(this, mc.getConnection().prepareStatement(sql, autoGeneratedKeys));
+            return wrapPreparedStatement(mc.getConnection().prepareStatement(sql, autoGeneratedKeys));
          }
          catch (Throwable t)
          {
@@ -325,7 +327,7 @@
          checkTransaction();
          try
          {
-            return new WrappedPreparedStatement(this, mc.getConnection().prepareStatement(sql, columnIndexes));
+            return wrapPreparedStatement(mc.getConnection().prepareStatement(sql, columnIndexes));
          }
          catch (Throwable t)
          {
@@ -346,7 +348,7 @@
          checkTransaction();
          try
          {
-            return new WrappedPreparedStatement(this, mc.getConnection().prepareStatement(sql, columnNames));
+            return wrapPreparedStatement(mc.getConnection().prepareStatement(sql, columnNames));
          }
          catch (Throwable t)
          {
@@ -359,6 +361,8 @@
       }
    }
 
+   protected abstract WrappedCallableStatement wrapCallableStatement(CallableStatement statement);
+
    public CallableStatement prepareCall(String sql) throws SQLException
    {
       lock();
@@ -367,7 +371,7 @@
          checkTransaction();
          try
          {
-            return new WrappedCallableStatement(this, mc.prepareCall(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY));
+            return wrapCallableStatement(mc.prepareCall(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY));
          }
          catch (Throwable t)
          {
@@ -388,7 +392,7 @@
          checkTransaction();
          try
          {
-            return new WrappedCallableStatement(this, mc.prepareCall(sql, resultSetType, resultSetConcurrency));
+            return wrapCallableStatement(mc.prepareCall(sql, resultSetType, resultSetConcurrency));
          }
          catch (Throwable t)
          {
@@ -410,7 +414,7 @@
          checkTransaction();
          try
          {
-            return new WrappedCallableStatement(this, mc.getConnection()
+            return wrapCallableStatement(mc.getConnection()
                   .prepareCall(sql, resultSetType, resultSetConcurrency, resultSetHoldability));
          }
          catch (Throwable t)
@@ -556,6 +560,7 @@
          unlock();
       }
    }
+
    public String getCatalog() throws SQLException
    {
       lock();
@@ -647,6 +652,7 @@
       }
    }
 
+   @SuppressWarnings("unchecked")
    public Map getTypeMap() throws SQLException
    {
       lock();
@@ -668,6 +674,7 @@
       }
    }
 
+   @SuppressWarnings("unchecked")
    public void setTypeMap(Map typeMap) throws SQLException
    {
       lock();
@@ -808,14 +815,21 @@
       }
    }
 
-   void checkTransaction() throws SQLException
+   protected Connection getWrappedObject() throws SQLException
    {
+      return getUnderlyingConnection();
+   }
+
+   protected void checkTransaction() throws SQLException
+   {
       checkStatus();
       mc.checkTransaction();
    }
 
    void checkTransactionActive() throws SQLException
    {
+      if (dataSource == null)
+         return;
       dataSource.checkTransactionActive();
    }
 
@@ -839,17 +853,26 @@
     * the ManagedConnection of the error. Subclasses may override this to
     * filter exceptions based on their severity.
     * 
-    * @param e a <code>SQLException</code> value
-    * @exception Exception if an error occurs
+    * @param t a throwable
+    * @return the sql exception
+    * @exception SQLException if an error occurs
     */
    protected SQLException checkException(Throwable t) throws SQLException
    {
+      Throwable result = null;
+
       if (mc != null)
          mc.connectionError(t);
+
       if (t instanceof SQLException)
+      {
          throw (SQLException) t;
+      }
       else
+      {
          throw new NestedSQLException("Error", t);
+      }
+      
    }
 
    int getTrackStatements()
@@ -865,7 +888,7 @@
       synchronized (this)
       {
          if (statements == null)
-            statements = new HashMap();
+            statements = new HashMap<WrappedStatement, Throwable>();
          
          if (trackStatements == BaseWrapperManagedConnectionFactory.TRACK_STATEMENTS_TRUE_INT)
             statements.put(ws, new Throwable("STACKTRACE"));

Added: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedConnectionFactory.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedConnectionFactory.java	                        (rev 0)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedConnectionFactory.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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;
+
+import java.sql.CallableStatement;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+
+/**
+ * WrappedConnectionFactory.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public interface WrappedConnectionFactory
+{
+   WrappedConnection createWrappedConnection(BaseWrapperManagedConnection mc);
+
+   CachedPreparedStatement createCachedPreparedStatement(PreparedStatement ps) throws SQLException;
+
+   CachedCallableStatement createCachedCallableStatement(CallableStatement cs) throws SQLException;
+}

Modified: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedPreparedStatement.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedPreparedStatement.java	2008-06-24 17:17:02 UTC (rev 74997)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedPreparedStatement.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -35,7 +35,6 @@
 import java.sql.ResultSet;
 import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
-import java.sql.Statement;
 import java.sql.Time;
 import java.sql.Timestamp;
 import java.util.Calendar;
@@ -47,7 +46,7 @@
  * @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
-public class WrappedPreparedStatement extends WrappedStatement implements PreparedStatement 
+public abstract class WrappedPreparedStatement extends WrappedStatement implements PreparedStatement 
 {
    private final PreparedStatement ps;
 
@@ -57,12 +56,12 @@
       this.ps = ps;
    }
 
-   public Statement getUnderlyingStatement() throws SQLException
+   public PreparedStatement getUnderlyingStatement() throws SQLException
    {
       lock();
       try
       {
-         checkTransaction();
+         checkState();
          if (ps instanceof CachedPreparedStatement)
          {
             return ((CachedPreparedStatement)ps).getUnderlyingPreparedStatement();
@@ -80,131 +79,211 @@
 
    public void setBoolean(int parameterIndex, boolean value) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setBoolean(parameterIndex, value);         
+         checkState();
+         try 
+         {
+            ps.setBoolean(parameterIndex, value);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setByte(int parameterIndex, byte value) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setByte(parameterIndex, value);         
+         checkState();
+         try 
+         {
+            ps.setByte(parameterIndex, value);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setShort(int parameterIndex, short value) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setShort(parameterIndex, value);         
+         checkState();
+         try 
+         {
+            ps.setShort(parameterIndex, value);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setInt(int parameterIndex, int value) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setInt(parameterIndex, value);         
+         checkState();
+         try 
+         {
+            ps.setInt(parameterIndex, value);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setLong(int parameterIndex, long value) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setLong(parameterIndex, value);         
+         checkState();
+         try 
+         {
+            ps.setLong(parameterIndex, value);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setFloat(int parameterIndex, float value) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setFloat(parameterIndex, value);         
+         checkState();
+         try 
+         {
+            ps.setFloat(parameterIndex, value);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setDouble(int parameterIndex, double value) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setDouble(parameterIndex, value);         
+         checkState();
+         try 
+         {
+            ps.setDouble(parameterIndex, value);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setURL(int parameterIndex, URL value) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setURL(parameterIndex, value);         
+         checkState();
+         try 
+         {
+            ps.setURL(parameterIndex, value);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setTime(int parameterIndex, Time value) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setTime(parameterIndex, value);         
+         checkState();
+         try 
+         {
+            ps.setTime(parameterIndex, value);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setTime(int parameterIndex, Time value, Calendar calendar) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setTime(parameterIndex, value, calendar);         
+         checkState();
+         try 
+         {
+            ps.setTime(parameterIndex, value, calendar);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
@@ -232,14 +311,22 @@
 
    public ResultSetMetaData getMetaData() throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         return ps.getMetaData();         
+         checkState();
+         try 
+         {
+            return ps.getMetaData();         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
@@ -293,7 +380,7 @@
       lock();
       try
       {
-         checkTransaction();
+         checkState();
          try 
          {
             ps.addBatch();         
@@ -311,293 +398,470 @@
 
    public void setNull(int parameterIndex, int sqlType) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setNull(parameterIndex, sqlType);         
+         checkState();
+         try 
+         {
+            ps.setNull(parameterIndex, sqlType);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setNull(parameterIndex, sqlType, typeName);         
+         checkState();
+         try 
+         {
+            ps.setNull(parameterIndex, sqlType, typeName);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setBigDecimal(int parameterIndex, BigDecimal value) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setBigDecimal(parameterIndex, value);         
+         checkState();
+         try 
+         {
+            ps.setBigDecimal(parameterIndex, value);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setString(int parameterIndex, String value) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setString(parameterIndex, value);         
+         checkState();
+         try 
+         {
+            ps.setString(parameterIndex, value);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setBytes(int parameterIndex, byte[] value) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setBytes(parameterIndex, value);         
+         checkState();
+         try 
+         {
+            ps.setBytes(parameterIndex, value);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setDate(int parameterIndex, Date value) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setDate(parameterIndex, value);         
+         checkState();
+         try 
+         {
+            ps.setDate(parameterIndex, value);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setDate(int parameterIndex, Date value, Calendar calendar) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setDate(parameterIndex, value, calendar);         
+         checkState();
+         try 
+         {
+            ps.setDate(parameterIndex, value, calendar);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setTimestamp(int parameterIndex, Timestamp value) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setTimestamp(parameterIndex, value);         
+         checkState();
+         try 
+         {
+            ps.setTimestamp(parameterIndex, value);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setTimestamp(int parameterIndex, Timestamp value, Calendar calendar) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setTimestamp(parameterIndex, value, calendar);         
+         checkState();
+         try 
+         {
+            ps.setTimestamp(parameterIndex, value, calendar);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
-   /**
-    * @deprecated
-    */
+   @Deprecated
    public void setAsciiStream(int parameterIndex, InputStream stream, int length) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setAsciiStream(parameterIndex, stream, length);         
+         checkState();
+         try 
+         {
+            ps.setAsciiStream(parameterIndex, stream, length);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
-   /**
-    * @deprecated
-    */
+   @Deprecated
    public void setUnicodeStream(int parameterIndex, InputStream stream, int length) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setUnicodeStream(parameterIndex, stream, length);         
+         checkState();
+         try 
+         {
+            ps.setUnicodeStream(parameterIndex, stream, length);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setBinaryStream(int parameterIndex, InputStream stream, int length) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setBinaryStream(parameterIndex, stream, length);         
+         checkState();
+         try 
+         {
+            ps.setBinaryStream(parameterIndex, stream, length);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void clearParameters() throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.clearParameters();         
+         checkState();
+         try 
+         {
+            ps.clearParameters();         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setObject(int parameterIndex, Object value, int sqlType, int scale) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setObject(parameterIndex, value, sqlType, scale);         
+         checkState();
+         try 
+         {
+            ps.setObject(parameterIndex, value, sqlType, scale);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setObject(int parameterIndex, Object value, int sqlType) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setObject(parameterIndex, value, sqlType);         
+         checkState();
+         try 
+         {
+            ps.setObject(parameterIndex, value, sqlType);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setObject(int parameterIndex, Object value) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setObject(parameterIndex, value);         
+         checkState();
+         try 
+         {
+            ps.setObject(parameterIndex, value);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setCharacterStream(parameterIndex, reader, length);         
+         checkState();
+         try 
+         {
+            ps.setCharacterStream(parameterIndex, reader, length);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setRef(int parameterIndex, Ref value) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setRef(parameterIndex, value);         
+         checkState();
+         try 
+         {
+            ps.setRef(parameterIndex, value);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setBlob(int parameterIndex, Blob value) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setBlob(parameterIndex, value);         
+         checkState();
+         try 
+         {
+            ps.setBlob(parameterIndex, value);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setClob(int parameterIndex, Clob value) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setClob(parameterIndex, value);         
+         checkState();
+         try 
+         {
+            ps.setClob(parameterIndex, value);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setArray(int parameterIndex, Array value) throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         ps.setArray(parameterIndex, value);         
+         checkState();
+         try 
+         {
+            ps.setArray(parameterIndex, value);         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public ParameterMetaData getParameterMetaData() throws SQLException
    {
-      checkState();
-      try 
+      lock();
+      try
       {
-         return ps.getParameterMetaData();         
+         checkState();
+         try 
+         {
+            return ps.getParameterMetaData();         
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
+
+   protected PreparedStatement getWrappedObject() throws SQLException
+   {
+      return (PreparedStatement) super.getWrappedObject();
+   }
 }

Modified: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedResultSet.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedResultSet.java	2008-06-24 17:17:02 UTC (rev 74997)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedResultSet.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -39,15 +39,15 @@
 import java.sql.Timestamp;
 import java.util.Calendar;
 import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 /**
  * A wrapper for a result set
  * 
  * @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>
- * @author <a href="weston.price at jboss.com">Weston Price</a>
  * @version $Revision$
  */
-public class WrappedResultSet implements ResultSet
+public abstract class WrappedResultSet extends JBossWrapper implements ResultSet
 {
    /** The wrapped statement */
    private WrappedStatement statement;
@@ -56,10 +56,7 @@
    private ResultSet resultSet;
 
    /** Whether we are closed */
-   private boolean closed = false;
-
-   /** The state lock */
-   private Object lock = new Object();
+   private AtomicBoolean closed = new AtomicBoolean(false);
    
    /** 
     * Create a new wrapped result set
@@ -181,13 +178,10 @@
 
    public void close() throws SQLException
    {
-      synchronized (lock)
-      {
-         if (closed)
-           return;
-         closed = true;
-      
-      }
+      if (closed.get())
+         return;
+ 
+      closed.set(true);
       statement.unregisterResultSet(this);
       internalClose();
    }
@@ -304,9 +298,7 @@
       }
    }
 
-   /**
-    * @deprecated
-    */
+   @Deprecated
    public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException
    {
       checkState();
@@ -333,9 +325,7 @@
       }
    }
 
-   /**
-    * @deprecated
-    */
+   @Deprecated
    public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException
    {
       checkState();
@@ -765,6 +755,7 @@
       }
    }
 
+   @SuppressWarnings("unchecked")
    public Object getObject(int i, Map map) throws SQLException
    {
       checkState();
@@ -791,6 +782,7 @@
       }
    }
 
+   @SuppressWarnings("unchecked")
    public Object getObject(String colName, Map map) throws SQLException
    {
       checkState();
@@ -1018,9 +1010,7 @@
       }
    }
 
-   /**
-    * @deprecated
-    */
+   @Deprecated
    public InputStream getUnicodeStream(int columnIndex) throws SQLException
    {
       checkState();
@@ -1034,9 +1024,7 @@
       }
    }
 
-   /**
-    * @deprecated
-    */
+   @Deprecated
    public InputStream getUnicodeStream(String columnName) throws SQLException
    {
       try
@@ -1949,32 +1937,31 @@
       }
    }
 
-   SQLException checkException(Throwable t) throws SQLException
+   protected ResultSet getWrappedObject() throws SQLException
    {
+      return getUnderlyingResultSet();
+   }
+
+   protected SQLException checkException(Throwable t) throws SQLException
+   {
       throw statement.checkException(t);
    }
    
    void internalClose() throws SQLException
    {
-      synchronized (lock)
-      {
-         closed = true;
-      }
+      closed.set(true);
       resultSet.close();
    }
 
    void checkState() throws SQLException
    {
-      synchronized (lock)
-      {
-         if (closed)
-            throw new SQLException("The result set is closed.");
-      }
+      if (closed.get())
+        throw new SQLException("The result set is closed.");
    }
 
-   void checkTransaction() throws SQLException
+   protected void checkTransaction() throws SQLException
    {
       checkState();
       statement.checkTransactionActive();
    }
-}
\ No newline at end of file
+}

Modified: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedStatement.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedStatement.java	2008-06-24 17:17:02 UTC (rev 74997)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrappedStatement.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -29,6 +29,7 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 /**
  * A wrapper for a statement.
@@ -37,24 +38,20 @@
  *
  * @author <a href="mailto:d_jencks at users.sourceforge.net">David Jencks</a>
  * @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>
- * @author <a href="weston.price at jboss.com">Weston Price</a>
  * @version $Revision$
  */
-public class WrappedStatement implements Statement, StatementAccess,
+public abstract class WrappedStatement extends JBossWrapper implements Statement, StatementAccess,
    org.jboss.ejb.plugins.cmp.jdbc.WrappedStatement
 {
    private final WrappedConnection lc;
    private final Statement s;
 
    /** The result sets */
-   private HashMap resultSets;
+   private HashMap<WrappedResultSet, Throwable> resultSets;
 
    /** Whether we are closed */
-   private boolean closed = false;
+   private AtomicBoolean closed = new AtomicBoolean(false);
 
-   /** The state lock */
-   private Object lock = new Object();
-
    public WrappedStatement(final WrappedConnection lc, Statement s)
    {
       this.lc = lc;
@@ -71,16 +68,13 @@
    {
       lc.unlock();
    }
-   
+
    public void close() throws SQLException
    {
-      synchronized (lock)
-      {
-         if (closed)
-            return;
+      if (closed.get())
+         return;
          
-         closed = true;
-      }
+      closed.set(true);
       lc.unregisterStatement(this);
       internalClose();
    }
@@ -180,27 +174,43 @@
 
    public SQLWarning getWarnings() throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         return s.getWarnings();
+         checkState();
+         try
+         {
+            return s.getWarnings();
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void clearWarnings() throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         s.clearWarnings();
+         checkState();
+         try
+         {
+            s.clearWarnings();
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
@@ -317,92 +327,148 @@
 
    public int getMaxFieldSize() throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         return s.getMaxFieldSize();
+         checkState();
+         try
+         {
+            return s.getMaxFieldSize();
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setMaxFieldSize(int max) throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         s.setMaxFieldSize(max);
+         checkState();
+         try
+         {
+            s.setMaxFieldSize(max);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public int getMaxRows() throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         return s.getMaxRows();
+         checkState();
+         try
+         {
+            return s.getMaxRows();
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setMaxRows(int max) throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         s.setMaxRows(max);
+         checkState();
+         try
+         {
+            s.setMaxRows(max);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setEscapeProcessing(boolean enable) throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         s.setEscapeProcessing(enable);
+         checkState();
+         try
+         {
+            s.setEscapeProcessing(enable);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public int getQueryTimeout() throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         return s.getQueryTimeout();
+         checkState();
+         try
+         {
+            return s.getQueryTimeout();
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setQueryTimeout(int timeout) throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         s.setQueryTimeout(timeout);
+         checkState();
+         try
+         {
+            s.setQueryTimeout(timeout);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
@@ -421,148 +487,236 @@
 
    public void setCursorName(String name) throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         s.setCursorName(name);
+         checkState();
+         try
+         {
+            s.setCursorName(name);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public ResultSet getResultSet() throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         ResultSet result = s.getResultSet();
-         if (result == null)
-            return null;
-         else
-            return registerResultSet(result);
+         checkState();
+         try
+         {
+            ResultSet result = s.getResultSet();
+            if (result == null)
+               return null;
+            else
+               return registerResultSet(result);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public int getUpdateCount() throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         return s.getUpdateCount();
+         checkState();
+         try
+         {
+            return s.getUpdateCount();
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public boolean getMoreResults() throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         return s.getMoreResults();
+         checkState();
+         try
+         {
+            return s.getMoreResults();
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public boolean getMoreResults(int current) throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         return s.getMoreResults(current);
+         checkState();
+         try
+         {
+            return s.getMoreResults(current);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setFetchDirection(int direction) throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         s.setFetchDirection(direction);
+         checkState();
+         try
+         {
+            s.setFetchDirection(direction);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public int getFetchDirection() throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         return s.getFetchDirection();
+         checkState();
+         try
+         {
+            return s.getFetchDirection();
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public void setFetchSize(int rows) throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         s.setFetchSize(rows);
+         checkState();
+         try
+         {
+            s.setFetchSize(rows);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public int getFetchSize() throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         return s.getFetchSize();
+         checkState();
+         try
+         {
+            return s.getFetchSize();
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public int getResultSetConcurrency() throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         return s.getResultSetConcurrency();
+         checkState();
+         try
+         {
+            return s.getResultSetConcurrency();
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
    public int getResultSetType() throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         return s.getResultSetType();
+         checkState();
+         try
+         {
+            return s.getResultSetType();
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
@@ -571,7 +725,7 @@
       lock();
       try
       {
-         checkTransaction();
+         checkState();
          try
          {
             s.addBatch(sql);
@@ -592,7 +746,7 @@
       lock();
       try
       {
-         checkTransaction();
+         checkState();
          try
          {
             s.clearBatch();
@@ -613,7 +767,7 @@
       lock();
       try
       {
-         checkTransaction();
+         checkState();
          try
          {
             checkConfiguredQueryTimeout();
@@ -635,7 +789,7 @@
       lock();
       try
       {
-         checkTransaction();
+         checkState();
          try
          {
             ResultSet resultSet = s.getGeneratedKeys();
@@ -654,14 +808,22 @@
 
    public int getResultSetHoldability() throws SQLException
    {
-      checkState();
+      lock();
       try
       {
-         return s.getResultSetHoldability();
+         checkState();
+         try
+         {
+            return s.getResultSetHoldability();
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
       }
-      catch (Throwable t)
+      finally
       {
-         throw checkException(t);
+         unlock();
       }
    }
 
@@ -670,7 +832,7 @@
       lock();
       try
       {
-         checkTransaction();
+         checkState();
          return s;
       }
       finally
@@ -679,6 +841,11 @@
       }
    }
 
+   protected Statement getWrappedObject() throws SQLException
+   {
+      return getUnderlyingStatement();
+   }
+
    protected SQLException checkException(Throwable t)
       throws SQLException
    {
@@ -701,13 +868,10 @@
    {
       lc.checkTransactionActive();
    }
-   
+
    protected void internalClose() throws SQLException
    {
-      synchronized (lock)
-      {
-         closed = true;
-      }
+      closed.set(true);
       try
       {
          closeResultSets();
@@ -720,30 +884,31 @@
 
    void checkState() throws SQLException
    {
-      synchronized (lock)
-      {
-         if (closed)
-            throw new SQLException("The statement is closed.");
-      }
+      if (closed.get())
+         throw new SQLException("The statement is closed.");
    }
 
+   protected abstract WrappedResultSet wrapResultSet(ResultSet resultSet);
+   
    protected ResultSet registerResultSet(ResultSet resultSet)
    {
       if (resultSet != null)
-         resultSet = new WrappedResultSet(this, resultSet);
+         resultSet = wrapResultSet(resultSet);
       
       if (lc.getTrackStatements() == BaseWrapperManagedConnectionFactory.TRACK_STATEMENTS_FALSE_INT)
          return resultSet;
 
+      WrappedResultSet wrapped = (WrappedResultSet) resultSet;
+      
       synchronized (this)
       {
          if (resultSets == null)
-            resultSets = new HashMap();
+            resultSets = new HashMap<WrappedResultSet, Throwable>();
          
          if (lc.getTrackStatements() == BaseWrapperManagedConnectionFactory.TRACK_STATEMENTS_TRUE_INT)
-            resultSets.put(resultSet, new Throwable("STACKTRACE"));
+            resultSets.put(wrapped, new Throwable("STACKTRACE"));
          else
-            resultSets.put(resultSet, null);
+            resultSets.put(wrapped, null);
       }
       return resultSet;
    }
@@ -769,13 +934,13 @@
       {
          if (resultSets == null)
             return;
-         for (Iterator i = resultSets.entrySet().iterator(); i.hasNext();)
+         for (Iterator<Map.Entry<WrappedResultSet, Throwable>> i = resultSets.entrySet().iterator(); i.hasNext();)
          {
-            Map.Entry entry = (Map.Entry) i.next();
-            WrappedResultSet resultSet = (WrappedResultSet) entry.getKey();
+            Map.Entry<WrappedResultSet, Throwable> entry = i.next();
+            WrappedResultSet resultSet = entry.getKey();
             if (lc.getTrackStatements() == BaseWrapperManagedConnectionFactory.TRACK_STATEMENTS_TRUE_INT)
             {
-               Throwable stackTrace = (Throwable) entry.getValue();
+               Throwable stackTrace = entry.getValue();
                lc.getLogger().warn("Closing a result set you left open! Please close it yourself.", stackTrace);
             }
             try

Modified: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrapperDataSource.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrapperDataSource.java	2008-06-24 17:17:02 UTC (rev 74997)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/WrapperDataSource.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -33,7 +33,6 @@
 import javax.resource.spi.ConnectionRequestInfo;
 import javax.sql.DataSource;
 import javax.transaction.RollbackException;
-import javax.transaction.SystemException;
 
 import org.jboss.resource.connectionmanager.JTATransactionChecker;
 import org.jboss.tm.TransactionTimeoutConfiguration;
@@ -46,7 +45,7 @@
  * @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>
  * @version $Revision$
  */
-public class WrapperDataSource implements Referenceable, DataSource, Serializable  
+public class WrapperDataSource extends JBossWrapper implements Referenceable, DataSource, Serializable  
 {
    static final long serialVersionUID = 3570285419164793501L;
    
@@ -55,7 +54,7 @@
 
    private Reference reference;
 
-   public WrapperDataSource (final BaseWrapperManagedConnectionFactory mcf, final ConnectionManager cm)
+   protected WrapperDataSource (final BaseWrapperManagedConnectionFactory mcf, final ConnectionManager cm)
    {
       this.mcf = mcf;
       this.cm = cm;   
@@ -111,7 +110,7 @@
          throw new NestedSQLException(re);
       }
    }
-   
+
    public void setReference(final Reference reference)
    {
       this.reference = reference;

Added: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/CachedCallableStatementJDK5.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/CachedCallableStatementJDK5.java	                        (rev 0)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/CachedCallableStatementJDK5.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.jdk5;
+
+import java.sql.CallableStatement;
+import java.sql.SQLException;
+
+import org.jboss.resource.adapter.jdbc.CachedCallableStatement;
+
+/**
+ * CachedCallableStatementJDK5.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class CachedCallableStatementJDK5 extends CachedCallableStatement
+{
+   public CachedCallableStatementJDK5(CallableStatement cs) throws SQLException
+   {
+      super(cs);
+   }
+
+}

Added: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/CachedPreparedStatementJDK5.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/CachedPreparedStatementJDK5.java	                        (rev 0)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/CachedPreparedStatementJDK5.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.jdk5;
+
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+
+import org.jboss.resource.adapter.jdbc.CachedPreparedStatement;
+
+/**
+ * CachedPreparedStatementJDK5.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class CachedPreparedStatementJDK5 extends CachedPreparedStatement
+{
+   public CachedPreparedStatementJDK5(PreparedStatement ps) throws SQLException
+   {
+      super(ps);
+   }
+
+}

Added: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedCallableStatementJDK5.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedCallableStatementJDK5.java	                        (rev 0)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedCallableStatementJDK5.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.jdk5;
+
+import java.sql.CallableStatement;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+
+import org.jboss.resource.adapter.jdbc.WrappedCallableStatement;
+import org.jboss.resource.adapter.jdbc.WrappedPreparedStatement;
+import org.jboss.resource.adapter.jdbc.WrappedResultSet;
+
+/**
+ * WrappedCallableStatementJDK5.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class WrappedCallableStatementJDK5 extends WrappedCallableStatement
+{
+   public WrappedCallableStatementJDK5(WrappedConnectionJDK5 lc, CallableStatement s)
+   {
+      super(lc, s);
+   }
+   
+   protected WrappedResultSet wrapResultSet(ResultSet resultSet)
+   {
+      return new WrappedResultSetJDK5(this, resultSet);
+   }
+}

Added: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedConnectionFactoryJDK5.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedConnectionFactoryJDK5.java	                        (rev 0)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedConnectionFactoryJDK5.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.jdk5;
+
+import java.sql.CallableStatement;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+
+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.WrappedConnection;
+import org.jboss.resource.adapter.jdbc.WrappedConnectionFactory;
+
+/**
+ * WrappedConnectionFactoryJDK5
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class WrappedConnectionFactoryJDK5 implements WrappedConnectionFactory
+{
+   public WrappedConnection createWrappedConnection(BaseWrapperManagedConnection mc)
+   {
+      return new WrappedConnectionJDK5(mc);
+   }
+
+   public CachedPreparedStatement createCachedPreparedStatement(PreparedStatement ps) throws SQLException
+   {
+      return new CachedPreparedStatementJDK5(ps);
+   }
+
+   public CachedCallableStatement createCachedCallableStatement(CallableStatement cs) throws SQLException
+   {
+      return new CachedCallableStatementJDK5(cs);
+   }
+}

Added: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedConnectionJDK5.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedConnectionJDK5.java	                        (rev 0)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedConnectionJDK5.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.jdk5;
+
+import java.sql.CallableStatement;
+import java.sql.PreparedStatement;
+import java.sql.Statement;
+
+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.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class WrappedConnectionJDK5 extends WrappedConnection
+{
+   /**
+    * Create a new WrappedConnectionJDK5.
+    * 
+    * @param mc the managed connection
+    */
+   public WrappedConnectionJDK5(BaseWrapperManagedConnection mc)
+   {
+      super(mc);
+   }
+
+   protected WrappedStatement wrapStatement(Statement statement)
+   {
+      return new WrappedStatementJDK5(this, statement);
+   }
+
+   protected WrappedPreparedStatement wrapPreparedStatement(PreparedStatement statement)
+   {
+      return new WrappedPreparedStatementJDK5(this, statement);
+   }
+
+   protected WrappedCallableStatement wrapCallableStatement(CallableStatement statement)
+   {
+      return new WrappedCallableStatementJDK5(this, statement);
+   }
+}

Added: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedPreparedStatementJDK5.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedPreparedStatementJDK5.java	                        (rev 0)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedPreparedStatementJDK5.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.jdk5;
+
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+
+import org.jboss.resource.adapter.jdbc.WrappedPreparedStatement;
+import org.jboss.resource.adapter.jdbc.WrappedResultSet;
+
+/**
+ * WrappedPreparedStatementJDK5.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class WrappedPreparedStatementJDK5 extends WrappedPreparedStatement
+{
+   public WrappedPreparedStatementJDK5(WrappedConnectionJDK5 lc, PreparedStatement s)
+   {
+      super(lc, s);
+   }
+   
+   protected WrappedResultSet wrapResultSet(ResultSet resultSet)
+   {
+      return new WrappedResultSetJDK5(this, resultSet);
+   }
+}

Added: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedResultSetJDK5.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedResultSetJDK5.java	                        (rev 0)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedResultSetJDK5.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.jdk5;
+
+import java.sql.ResultSet;
+
+import org.jboss.resource.adapter.jdbc.WrappedResultSet;
+import org.jboss.resource.adapter.jdbc.WrappedStatement;
+
+/**
+ * WrappedResultSetJDK5.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class WrappedResultSetJDK5 extends WrappedResultSet
+{
+   public WrappedResultSetJDK5(WrappedStatement statement, ResultSet resultSet)
+   {
+      super(statement, resultSet);
+   }
+}

Added: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedStatementJDK5.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedStatementJDK5.java	                        (rev 0)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk5/WrappedStatementJDK5.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.jdk5;
+
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+import org.jboss.resource.adapter.jdbc.WrappedResultSet;
+import org.jboss.resource.adapter.jdbc.WrappedStatement;
+
+/**
+ * WrappedStatementJDK5.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class WrappedStatementJDK5 extends WrappedStatement
+{
+   public WrappedStatementJDK5(WrappedConnectionJDK5 lc, Statement s)
+   {
+      super(lc, s);
+   }
+   
+   protected WrappedResultSet wrapResultSet(ResultSet resultSet)
+   {
+      return new WrappedResultSetJDK5(this, resultSet);
+   }
+}

Added: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/CachedCallableStatementJDK6.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/CachedCallableStatementJDK6.java	                        (rev 0)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/CachedCallableStatementJDK6.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -0,0 +1,313 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.jdk6;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.sql.Blob;
+import java.sql.CallableStatement;
+import java.sql.Clob;
+import java.sql.NClob;
+import java.sql.RowId;
+import java.sql.SQLException;
+import java.sql.SQLXML;
+
+import org.jboss.resource.adapter.jdbc.CachedCallableStatement;
+
+/**
+ * CachedCallableStatementJDK6.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class CachedCallableStatementJDK6 extends CachedCallableStatement
+{
+   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);
+   }
+}

Added: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/CachedPreparedStatementJDK6.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/CachedPreparedStatementJDK6.java	                        (rev 0)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/CachedPreparedStatementJDK6.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -0,0 +1,151 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.jdk6;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.sql.NClob;
+import java.sql.PreparedStatement;
+import java.sql.RowId;
+import java.sql.SQLException;
+import java.sql.SQLXML;
+
+import org.jboss.resource.adapter.jdbc.CachedPreparedStatement;
+
+/**
+ * CachedPreparedStatementJDK5.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class CachedPreparedStatementJDK6 extends CachedPreparedStatement
+{
+   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);
+   }
+}

Added: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedCallableStatementJDK6.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedCallableStatementJDK6.java	                        (rev 0)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedCallableStatementJDK6.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -0,0 +1,748 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.jdk6;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.sql.Blob;
+import java.sql.CallableStatement;
+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.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class WrappedCallableStatementJDK6 extends WrappedCallableStatement
+{
+   public WrappedCallableStatementJDK6(WrappedConnectionJDK6 lc, CallableStatement s)
+   {
+      super(lc, s);
+   }
+   
+   protected WrappedResultSet wrapResultSet(ResultSet resultSet)
+   {
+      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);
+      }
+   }
+
+}

Added: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedConnectionFactoryJDK6.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedConnectionFactoryJDK6.java	                        (rev 0)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedConnectionFactoryJDK6.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.jdk6;
+
+import java.sql.CallableStatement;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+
+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.WrappedConnection;
+import org.jboss.resource.adapter.jdbc.WrappedConnectionFactory;
+
+/**
+ * WrappedConnectionFactoryJDK6
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class WrappedConnectionFactoryJDK6 implements WrappedConnectionFactory
+{
+   public WrappedConnection createWrappedConnection(BaseWrapperManagedConnection mc)
+   {
+      return new WrappedConnectionJDK6(mc);
+   }
+
+   public CachedPreparedStatement createCachedPreparedStatement(PreparedStatement ps) throws SQLException
+   {
+      return new CachedPreparedStatementJDK6(ps);
+   }
+
+   public CachedCallableStatement createCachedCallableStatement(CallableStatement cs) throws SQLException
+   {
+      return new CachedCallableStatementJDK6(cs);
+   }
+}

Added: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedConnectionJDK6.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedConnectionJDK6.java	                        (rev 0)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedConnectionJDK6.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -0,0 +1,346 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.jdk6;
+
+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.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at SuppressWarnings("unchecked")
+public class WrappedConnectionJDK6 extends WrappedConnection
+{
+   /**
+    * Create a new WrappedConnectionJDK6.
+    * 
+    * @param mc the managed connection
+    */
+   public WrappedConnectionJDK6(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();
+      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();
+      }
+   }
+}

Added: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedPreparedStatementJDK6.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedPreparedStatementJDK6.java	                        (rev 0)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedPreparedStatementJDK6.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -0,0 +1,493 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.jdk6;
+
+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 at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class WrappedPreparedStatementJDK6 extends WrappedPreparedStatement
+{
+   public WrappedPreparedStatementJDK6(WrappedConnectionJDK6 lc, PreparedStatement s)
+   {
+      super(lc, s);
+   }
+   
+   protected WrappedResultSet wrapResultSet(ResultSet resultSet)
+   {
+      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();
+      }
+   }
+}

Added: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedResultSetJDK6.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedResultSetJDK6.java	                        (rev 0)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedResultSetJDK6.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -0,0 +1,673 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.jdk6;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.sql.NClob;
+import java.sql.ResultSet;
+import java.sql.RowId;
+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 at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class WrappedResultSetJDK6 extends WrappedResultSet
+{
+   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);
+      }
+   }
+}

Added: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedStatementJDK6.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedStatementJDK6.java	                        (rev 0)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/jdk6/WrappedStatementJDK6.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -0,0 +1,110 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.jdk6;
+
+import java.sql.ResultSet;
+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 at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class WrappedStatementJDK6 extends WrappedStatement
+{
+   public WrappedStatementJDK6(WrappedConnectionJDK6 lc, Statement s)
+   {
+      super(lc, s);
+   }
+
+   protected WrappedResultSet wrapResultSet(ResultSet resultSet)
+   {
+      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();
+      }
+   }
+}

Modified: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/remote/SerializableParameterMetaData.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/remote/SerializableParameterMetaData.java	2008-06-24 17:17:02 UTC (rev 74997)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/remote/SerializableParameterMetaData.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -25,11 +25,14 @@
 import java.sql.ParameterMetaData;
 import java.sql.SQLException;
 
+import org.jboss.resource.adapter.jdbc.JBossWrapper;
+
 /**
  * @author <a href="mailto:telrod at e2technologies.net">Tom Elrod</a>
  * @version $Revision$
  */
-public class SerializableParameterMetaData implements ParameterMetaData, Serializable
+public class SerializableParameterMetaData extends JBossWrapper
+		implements ParameterMetaData, Serializable
 {
    /** @since 1.1 */
    static final long serialVersionUID = -6601828413479683906L;

Modified: branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/remote/SerializableResultSetMetaData.java
===================================================================
--- branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/remote/SerializableResultSetMetaData.java	2008-06-24 17:17:02 UTC (rev 74997)
+++ branches/Branch_4_2_JDK6/connector/src/main/org/jboss/resource/adapter/jdbc/remote/SerializableResultSetMetaData.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -25,12 +25,14 @@
 import java.sql.SQLException;
 import java.io.Serializable;
 
+import org.jboss.resource.adapter.jdbc.JBossWrapper;
+
 /** A wrapper to marshall ResultSetMetaData remotely.
  *
  * @author Scott.Stark at jboss.org
  * @version $Revision$
  */
-public class   SerializableResultSetMetaData
+public class SerializableResultSetMetaData extends JBossWrapper
    implements ResultSetMetaData, Serializable
 {
    /** @since 1.3 */

Modified: branches/Branch_4_2_JDK6/testsuite/build.sh
===================================================================
--- branches/Branch_4_2_JDK6/testsuite/build.sh	2008-06-24 17:17:02 UTC (rev 74997)
+++ branches/Branch_4_2_JDK6/testsuite/build.sh	2008-06-24 17:36:19 UTC (rev 74998)
@@ -151,7 +151,7 @@
     ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
 
     # add some more memory
-    ANT_OPTS="$ANT_OPTS -Xmx256m"
+    ANT_OPTS="$ANT_OPTS -Xmx1024m"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml

Modified: branches/Branch_4_2_JDK6/testsuite/src/main/org/jboss/test/jca/adapter/MockedXADataSource.java
===================================================================
--- branches/Branch_4_2_JDK6/testsuite/src/main/org/jboss/test/jca/adapter/MockedXADataSource.java	2008-06-24 17:17:02 UTC (rev 74997)
+++ branches/Branch_4_2_JDK6/testsuite/src/main/org/jboss/test/jca/adapter/MockedXADataSource.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -21,24 +21,16 @@
  */
 package org.jboss.test.jca.adapter;
 
-import javax.sql.XADataSource;
-import javax.sql.XAConnection;
-import javax.sql.ConnectionEventListener;
+import javax.sql.*;
 import javax.transaction.xa.XAResource;
 import javax.transaction.xa.XAException;
 import javax.transaction.xa.Xid;
 import java.util.Map;
 import java.util.HashMap;
 import java.util.Arrays;
+import java.util.Properties;
 import java.io.PrintWriter;
-import java.sql.SQLException;
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.SQLWarning;
-import java.sql.Savepoint;
-import java.sql.Statement;
-import java.sql.CallableStatement;
-import java.sql.PreparedStatement;
+import java.sql.*;
 import java.lang.reflect.Proxy;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
@@ -142,6 +134,14 @@
          return con;
       }
 
+      public void addStatementEventListener(StatementEventListener listener)
+      {
+      }
+
+      public void removeStatementEventListener(StatementEventListener listener)
+      {
+      }
+
       public void addConnectionEventListener(ConnectionEventListener listener)
       {
       }
@@ -149,6 +149,7 @@
       public void removeConnectionEventListener(ConnectionEventListener listener)
       {
       }
+   
 
       class MockedConnection
          implements Connection
@@ -159,11 +160,89 @@
          private boolean readOnly;
          private String catalog;
 
-         public String getUrl()
+	public Clob createClob() throws SQLException
          {
-            return url;
+           // TODO: Implement me
+           return null;
          }
 
+         public Blob createBlob() throws SQLException
+         {
+           // TODO: Implement me
+           return null;
+         }
+
+         public NClob createNClob() throws SQLException
+         {
+            // TODO: Implement me   
+            return null;
+         }
+
+         public SQLXML createSQLXML() throws SQLException
+         {
+            // TODO: Implement me
+            return null;
+         }
+
+         public boolean isValid(int timeout) throws SQLException
+         {
+            // TODO: Implement me
+            return false;
+         }
+
+         public void setClientInfo(String name, String value)
+                                               throws SQLClientInfoException
+         {
+            // TODO: Implement me
+         }
+
+         public void setClientInfo(Properties properties)
+                                                throws SQLClientInfoException
+         {
+            // TODO: Implement me
+         }
+
+         public String getClientInfo(String name) throws SQLException
+         {
+            // TODO: Implement me
+           return null;
+         }
+
+         public Properties getClientInfo() throws SQLException
+         {
+            // TODO: Implement me
+           return null;
+         }
+
+         public Array createArrayOf(String typeName, Object[] elements)                                                                       throws SQLException
+         {
+            // TODO: Implement me
+            return null;
+         }
+         
+         public Struct createStruct(String typeName, Object[] attributes) throws SQLException
+         {
+            // TODO: Implement me
+           return null;
+         }
+
+         public boolean isWrapperFor(Class<?> iface) throws SQLException
+         {
+            // TODO: Implement me
+           return false;
+         }
+
+         public <T> T unwrap(Class<T> iface) throws SQLException
+         {
+            // TODO: Implement me
+            return null;
+         } 
+
+        public String getUrl()
+        {
+           return url;
+        }
+
          public int getHoldability() throws SQLException
          {
             check();

Modified: branches/Branch_4_2_JDK6/testsuite/src/main/org/jboss/test/jca/jdbc/TestConnection.java
===================================================================
--- branches/Branch_4_2_JDK6/testsuite/src/main/org/jboss/test/jca/jdbc/TestConnection.java	2008-06-24 17:17:02 UTC (rev 74997)
+++ branches/Branch_4_2_JDK6/testsuite/src/main/org/jboss/test/jca/jdbc/TestConnection.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -21,15 +21,9 @@
  */
 package org.jboss.test.jca.jdbc;
 
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.sql.PreparedStatement;
-import java.sql.CallableStatement;
-import java.sql.DatabaseMetaData;
+import java.sql.*;
 import java.util.Map;
-import java.sql.SQLWarning;
-import java.sql.Savepoint;
+import java.util.Properties;
 
 
 /**
@@ -255,4 +249,82 @@
    {
    }
 
+       public Clob createClob() throws SQLException
+         {
+           // TODO: Implement me
+           return null;
+         }
+
+         public Blob createBlob() throws SQLException
+         {
+           // TODO: Implement me
+           return null;
+         }
+
+         public NClob createNClob() throws SQLException
+         {
+            // TODO: Implement me   
+            return null;
+         }
+
+         public SQLXML createSQLXML() throws SQLException
+         {
+            // TODO: Implement me
+            return null;
+         }
+
+         public boolean isValid(int timeout) throws SQLException
+         {
+            // TODO: Implement me
+            return false;
+         }
+
+         public void setClientInfo(String name, String value)
+                                               throws SQLClientInfoException
+         {
+            // TODO: Implement me
+         }
+
+         public void setClientInfo(Properties properties)
+                                                throws SQLClientInfoException
+         {
+            // TODO: Implement me
+         }
+
+         public String getClientInfo(String name) throws SQLException
+         {
+            // TODO: Implement me
+           return null;
+         }
+
+         public Properties getClientInfo() throws SQLException
+         {
+            // TODO: Implement me
+           return null;
+         }
+
+         public Array createArrayOf(String typeName, Object[] elements)                                                                       throws SQLException
+         {
+            // TODO: Implement me
+            return null;
+         }
+
+         public Struct createStruct(String typeName, Object[] attributes) throws SQLException
+         {
+            // TODO: Implement me
+           return null;
+         }
+
+         public boolean isWrapperFor(Class<?> iface) throws SQLException
+         {
+            // TODO: Implement me
+           return false;
+         }
+
+         public <T> T unwrap(Class<T> iface) throws SQLException
+         {
+            // TODO: Implement me
+            return null;
+         }
+
 }// TestConnection

Modified: branches/Branch_4_2_JDK6/testsuite/src/main/org/jboss/test/jca/jdbc/TestPreparedStatement.java
===================================================================
--- branches/Branch_4_2_JDK6/testsuite/src/main/org/jboss/test/jca/jdbc/TestPreparedStatement.java	2008-06-24 17:17:02 UTC (rev 74997)
+++ branches/Branch_4_2_JDK6/testsuite/src/main/org/jboss/test/jca/jdbc/TestPreparedStatement.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -25,17 +25,7 @@
 import java.io.Reader;
 import java.math.BigDecimal;
 import java.net.URL;
-import java.sql.Array;
-import java.sql.Blob;
-import java.sql.Clob;
-import java.sql.Date;
-import java.sql.ParameterMetaData;
-import java.sql.PreparedStatement;
-import java.sql.Ref;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.Time;
-import java.sql.Timestamp;
+import java.sql.*;
 import java.util.Calendar;
 
 /**
@@ -121,6 +111,10 @@
    {
    }
 
+   public void setClob(int i, Reader x, long l) throws SQLException
+   {
+   }
+
    public void setClob(int i, Clob x)
    {
    }
@@ -204,4 +198,86 @@
    public void setURL(int i, URL url)
    {
    }
+
+
+   public void setClob(int i, Reader reader) throws SQLException
+   {
+   }
+
+   public void setNCharacterStream(int parameterIndex, Reader value,
+                                       long length) throws SQLException
+   {
+   }
+
+   public void setNCharacterStream(int parameterIndex, Reader value)
+                                                         throws SQLException
+   {
+   }
+
+   public void setNString(int parameterIndex, String value)
+                                                        throws SQLException
+   {
+   }
+
+   public void setCharacterStream(int parameterIndex,
+                                  java.io.Reader reader) throws SQLException
+   {
+   }
+
+   public void setBinaryStream(int i, java.io.InputStream input)
+                                              throws SQLException
+   {
+   }
+
+   public void setAsciiStream(int i, java.io.InputStream input)
+                                                throws SQLException
+   {
+   }
+
+   public void setCharacterStream(int i, Reader reader, long l)
+                                                throws SQLException
+   {
+   }
+
+   public void setBinaryStream(int i, java.io.InputStream input, long l)
+                                                throws SQLException
+   {
+   }
+
+   public void setNClob(int parameterIndex, NClob value) throws SQLException
+   {
+   }
+
+   public void setNClob(int parameterIndex, Reader reader) throws SQLException
+   {
+   }
+
+   public void setNClob(int parameterIndex, Reader reader, long l)
+                                                        throws SQLException
+   {
+   }
+
+   public void setBlob(int parameterIndex, java.io.InputStream inputStream,
+                                          long length) throws SQLException
+   {
+   }
+
+   public void setBlob(int parameterIndex, java.io.InputStream inputStream)
+                                                        throws SQLException
+   {
+   }
+
+   public void setAsciiStream(int i, java.io.InputStream input, long l)
+                                                throws SQLException
+   {
+   }
+
+   public void setSQLXML(int i,java.sql.SQLXML x) throws SQLException
+   {
+   }
+
+   public void setRowId(int i, java.sql.RowId d) throws SQLException
+   {
+   }   
+
 }

Modified: branches/Branch_4_2_JDK6/testsuite/src/main/org/jboss/test/jca/jdbc/TestStatement.java
===================================================================
--- branches/Branch_4_2_JDK6/testsuite/src/main/org/jboss/test/jca/jdbc/TestStatement.java	2008-06-24 17:17:02 UTC (rev 74997)
+++ branches/Branch_4_2_JDK6/testsuite/src/main/org/jboss/test/jca/jdbc/TestStatement.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -59,6 +59,33 @@
    {
    }
 
+   public boolean isPoolable() throws SQLException
+   {
+      return false;
+   }
+
+   public void setPoolable(boolean p) throws SQLException
+   {
+   }
+
+   public boolean isClosed() throws SQLException
+   {
+      return false;
+   }
+
+   public <T> T unwrap(Class<T> iface)
+                           throws SQLException
+   {
+      return null;
+   }
+
+   public boolean isWrapperFor(Class<?> iface)
+                     throws SQLException
+   {
+      return false;
+   }
+
+
    /**
     *
     * @param param1 <description>

Modified: branches/Branch_4_2_JDK6/testsuite/src/main/org/jboss/test/security/test/LoginModulesUnitTestCase.java
===================================================================
--- branches/Branch_4_2_JDK6/testsuite/src/main/org/jboss/test/security/test/LoginModulesUnitTestCase.java	2008-06-24 17:17:02 UTC (rev 74997)
+++ branches/Branch_4_2_JDK6/testsuite/src/main/org/jboss/test/security/test/LoginModulesUnitTestCase.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -365,6 +365,17 @@
       {
          return getConnection("sa", "");
       }
+
+      public boolean isWrapperFor(Class<?> iface) throws SQLException
+      {
+        return false;
+      }
+
+      public <T> T unwrap(Class<T> iface) throws SQLException
+      {
+         return null;
+      }
+
       public java.sql.Connection getConnection(String user, String pass) throws java.sql.SQLException
       {
 			java.sql.Connection con = null;

Modified: branches/Branch_4_2_JDK6/varia/src/main/org/jboss/varia/stats/DataSourceInterceptor.java
===================================================================
--- branches/Branch_4_2_JDK6/varia/src/main/org/jboss/varia/stats/DataSourceInterceptor.java	2008-06-24 17:17:02 UTC (rev 74997)
+++ branches/Branch_4_2_JDK6/varia/src/main/org/jboss/varia/stats/DataSourceInterceptor.java	2008-06-24 17:36:19 UTC (rev 74998)
@@ -30,30 +30,12 @@
 import javax.naming.NamingException;
 import javax.naming.Name;
 import javax.naming.InitialContext;
-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.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.Array;
-import java.sql.Blob;
-import java.sql.Clob;
-import java.sql.Date;
-import java.sql.Ref;
-import java.sql.ResultSetMetaData;
-import java.sql.Time;
-import java.sql.Timestamp;
-
-import java.sql.Savepoint;
-import java.sql.ParameterMetaData;
-
+import java.sql.*;
 import java.io.PrintWriter;
 import java.io.InputStream;
 import java.io.Reader;
 import java.util.Map;
+import java.util.Properties;
 import java.util.Calendar;
 import java.math.BigDecimal;
 import java.net.URL;
@@ -88,11 +70,24 @@
    /**
     * @jmx.managed-attribute
     */
+
    public ObjectName getStatsCollector()
    {
       return statsCollector;
    }
 
+   public boolean isWrapperFor(Class<?> iface)
+                                throws SQLException
+   {
+      return target.isWrapperFor(iface);
+   }
+
+   public <T> T unwrap(Class<T> iface)
+                        throws SQLException
+   {
+      return target.unwrap(iface);
+   }
+
    /**
     * @jmx.managed-attribute
     */
@@ -198,13 +193,80 @@
          this.target = target;
       }
 
-      
       public int getHoldability() throws SQLException
       {
          return target.getHoldability();
       }
-      
 
+      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 boolean isWrapperFor(Class<?> iface) throws SQLException
+      {
+        return target.isWrapperFor(iface);
+      }
+
+      public <T> T unwrap(Class<T> iface) throws SQLException      
+      {
+        return target.unwrap(iface);
+      }
+
       public int getTransactionIsolation() throws SQLException
       {
          return target.getTransactionIsolation();
@@ -433,11 +495,38 @@
          this.target = target;
       }
 
+      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 int getFetchDirection() throws SQLException
       {
          return target.getFetchDirection();
       }
 
+      public boolean isPoolable() throws SQLException
+      {
+         return target.isPoolable();
+      }
+
+      public void setPoolable(boolean p) throws SQLException
+      {
+         target.setPoolable(p);
+      }
+
+      public boolean isClosed() throws SQLException
+      {
+         return target.isClosed();
+      }
+
       public int getFetchSize() throws SQLException
       {
          return target.getFetchSize();
@@ -796,18 +885,49 @@
          target.setClob(i, x);
       }
 
+      public void setClob(int i, Reader x, long l) throws SQLException
+      {
+         target.setClob(i, x, l);
+      }
+
       public void setDate(int parameterIndex, Date x) throws SQLException
       {
          target.setDate(parameterIndex, x);
       }
 
-      
+      public boolean isClosed()
+                 throws SQLException
+      {
+         return target.isClosed();
+      }
+
+      public void setPoolable(boolean p) throws SQLException
+      {
+         target.setPoolable(p);
+      }
+
+      public boolean isPoolable() throws SQLException
+      {
+         return target.isPoolable();
+      }
+
       public ParameterMetaData getParameterMetaData() throws SQLException
       {
          return target.getParameterMetaData();
       }
       
+      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 void setRef(int i, Ref x) throws SQLException
       {
          target.setRef(i, x);
@@ -833,6 +953,104 @@
          target.setTimestamp(parameterIndex, x);
       }
 
+      public void setNClob(int parameterIndex, NClob value) throws SQLException
+      {
+         target.setNClob(parameterIndex, value);
+      }
+
+      public void setNClob(int parameterIndex, Reader reader) throws SQLException
+      {
+         target.setNClob(parameterIndex, reader);
+      }
+
+      public void setNClob(int parameterIndex, Reader reader, long l)
+                                                        throws SQLException
+      {
+         target.setNClob(parameterIndex, reader, l);
+      }
+
+      public void setBlob(int parameterIndex, java.io.InputStream inputStream,
+                                          long length) throws SQLException
+      {
+         target.setBlob(parameterIndex, inputStream, length);
+      }
+
+      public void setBlob(int parameterIndex, java.io.InputStream inputStream)
+                                                        throws SQLException
+      {
+         target.setBlob(parameterIndex, inputStream);
+      }
+
+      public void setClob(int i, Reader reader) throws SQLException
+      {
+         target.setClob(i, reader);
+      }
+
+      public void setNCharacterStream(int parameterIndex, Reader value,
+                                                       long length)
+                                                       throws SQLException
+      {
+         target.setNCharacterStream(parameterIndex, value, length);
+      }
+
+      public void setNCharacterStream(int parameterIndex, Reader value)
+                                                         throws SQLException
+      {
+         target.setNCharacterStream(parameterIndex, value);
+      }
+
+      public void setNString(int parameterIndex, String value)
+                                                        throws SQLException
+      {
+         target.setNString(parameterIndex, value);
+      }
+
+      public void setCharacterStream(int parameterIndex,
+                                  java.io.Reader reader) throws SQLException
+      {
+         target.setCharacterStream(parameterIndex, reader);
+      }
+
+      public void setBinaryStream(int i, java.io.InputStream input)
+                                                throws SQLException
+      {
+         target.setBinaryStream(i, input);
+      }
+
+      public void setAsciiStream(int i, java.io.InputStream input)
+                                                throws SQLException
+      {
+         target.setAsciiStream(i, input);
+      }
+
+      public void setCharacterStream(int i, Reader reader, long l)
+                                                throws SQLException
+      {
+         target.setCharacterStream(i, reader, l);
+      }
+
+      public void setBinaryStream(int i, java.io.InputStream input, long l)
+                                                throws SQLException
+      {
+         target.setBinaryStream(i, input, l);
+      }
+
+      public void setAsciiStream(int i, java.io.InputStream input, long l)
+                                                throws SQLException
+      {
+         target.setAsciiStream(i, input, l);
+      }
+
+      public void setSQLXML(int i,java.sql.SQLXML x) throws SQLException
+      {
+         target.setSQLXML(i, x);
+      }
+
+      public void setRowId(int i, java.sql.RowId d) throws SQLException
+      {
+         target.setRowId(i, d);
+      }
+
       public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException
       {
          target.setDate(parameterIndex, x, cal);




More information about the jboss-cvs-commits mailing list