[jboss-cvs] JBossAS SVN: r110495 - in projects/jboss-jca/trunk/adapters/src/main: java/org/jboss/jca/adapters/jdbc/jdk6 and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jan 28 15:52:31 EST 2011


Author: jesper.pedersen
Date: 2011-01-28 15:52:30 -0500 (Fri, 28 Jan 2011)
New Revision: 110495

Added:
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/Constants.java
Modified:
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/BaseWrapperManagedConnection.java
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/BaseWrapperManagedConnectionFactory.java
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedCallableStatement.java
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedConnection.java
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedConnectionFactory.java
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedPreparedStatement.java
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedResultSet.java
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedStatement.java
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrapperDataSource.java
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedCallableStatementJDK6.java
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedConnectionFactoryJDK6.java
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedConnectionJDK6.java
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedPreparedStatementJDK6.java
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedResultSetJDK6.java
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedStatementJDK6.java
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedCallableStatementJDK7.java
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedConnectionFactoryJDK7.java
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedConnectionJDK7.java
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedPreparedStatementJDK7.java
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedResultSetJDK7.java
   projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedStatementJDK7.java
   projects/jboss-jca/trunk/adapters/src/main/resources/jdbc/local/META-INF/ra.xml
   projects/jboss-jca/trunk/adapters/src/main/resources/jdbc/xa/META-INF/ra.xml
Log:
[JBJCA-482] Add spy functionality to JDBC resource adapter (Part 1)

Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/BaseWrapperManagedConnection.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/BaseWrapperManagedConnection.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/BaseWrapperManagedConnection.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -354,7 +354,9 @@
    public Object getConnection(Subject subject, ConnectionRequestInfo cri) throws ResourceException
    {
       checkIdentity(subject, cri);
-      WrappedConnection lc = WRAPPED_CONNECTION_FACTORY.createWrappedConnection(this);
+      WrappedConnection lc = WRAPPED_CONNECTION_FACTORY.createWrappedConnection(this,
+                                                                                mcf.getSpy().booleanValue(),
+                                                                                mcf.getJndiName());
       synchronized (handles)
       {
          handles.add(lc);

Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/BaseWrapperManagedConnectionFactory.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/BaseWrapperManagedConnectionFactory.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/BaseWrapperManagedConnectionFactory.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -64,6 +64,7 @@
  * @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>
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
  *
  * @version $Revision: 105426 $
  */
@@ -95,6 +96,9 @@
    /** The logger */
    protected final Logger log = Logger.getLogger(getClass());
 
+   /** The print writer */
+   private PrintWriter printWriter;
+
    /** The user name */
    protected String userName;
 
@@ -199,6 +203,12 @@
    /** Whether to use a try lock */
    private Integer useTryLock = Integer.valueOf(60);
 
+   /** Spy functionality */
+   private Boolean spy = Boolean.FALSE;
+
+   /** JNDI name */
+   private String jndiName;
+
    /**
     * Constructor
     */
@@ -211,14 +221,15 @@
     */
    public PrintWriter getLogWriter() throws ResourceException
    {
-      return null;
+      return printWriter;
    }
 
    /**
     * {@inheritDoc}
     */
-   public void setLogWriter(PrintWriter param1) throws ResourceException
+   public void setLogWriter(PrintWriter v) throws ResourceException
    {
+      this.printWriter = v;
    }
 
    /**
@@ -588,7 +599,7 @@
 
    /**
     * Get the url delimiter
-    * @return The vlaue
+    * @return The value
     */
    public String getURLDelimiter()
    {
@@ -596,6 +607,44 @@
    }
 
    /**
+    * Set the spy value
+    * @param v The value
+    */
+   public void setSpy(Boolean v)
+   {
+      if (v != null)
+         this.spy = v;
+   }
+
+   /**
+    * Get the spy value
+    * @return The value
+    */
+   public Boolean getSpy()
+   {
+      return spy;
+   }
+
+   /**
+    * Set the jndi name value
+    * @param v The value
+    */
+   public void setJndiName(String v)
+   {
+      if (v != null)
+         this.jndiName = v;
+   }
+
+   /**
+    * Get the jndi name value
+    * @return The value
+    */
+   public String getJndiName()
+   {
+      return jndiName;
+   }
+
+   /**
     * Set the url delimiter.
     * @param urlDelimiter The value
     * @exception ResourceException Thrown in case of an error

Added: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/Constants.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/Constants.java	                        (rev 0)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/Constants.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.jca.adapters.jdbc;
+
+/**
+ * Constants
+ *
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+public class Constants
+{
+   /** The spy logger category */
+   public static final String SPY_LOGGER_CATEGORY = "jboss.jdbc.spy";
+
+   /** The spy logger prefix for a connection */
+   public static final String SPY_LOGGER_PREFIX_CONNECTION = "Connection";
+
+   /** The spy logger prefix for a statement */
+   public static final String SPY_LOGGER_PREFIX_STATEMENT = "Statement";
+
+   /** The spy logger prefix for a prepared statement */
+   public static final String SPY_LOGGER_PREFIX_PREPARED_STATEMENT = "PreparedStatement";
+
+   /** The spy logger prefix for a callable statement */
+   public static final String SPY_LOGGER_PREFIX_CALLABLE_STATEMENT = "CallableStatement";
+
+   /** The spy logger prefix for a result set */
+   public static final String SPY_LOGGER_PREFIX_RESULTSET = "ResultSet";
+
+   /**
+    * Constructor
+    */
+   private Constants()
+   {
+   }
+}

Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedCallableStatement.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedCallableStatement.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedCallableStatement.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -31,10 +31,15 @@
 import java.sql.CallableStatement;
 import java.sql.Clob;
 import java.sql.Date;
+import java.sql.NClob;
+import java.sql.PreparedStatement;
 import java.sql.Ref;
+import java.sql.RowId;
 import java.sql.SQLException;
+import java.sql.SQLXML;
 import java.sql.Time;
 import java.sql.Timestamp;
+import java.util.Arrays;
 import java.util.Calendar;
 import java.util.Map;
 
@@ -43,6 +48,7 @@
  * 
  * @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:jesper.pedersen at jboss.org">Jesper Pedersen</a>
  * @version $Revision: 71788 $
  */
 public abstract class WrappedCallableStatement extends WrappedPreparedStatement implements CallableStatement
@@ -53,10 +59,13 @@
     * Constructor
     * @param lc The connection
     * @param cs The callable statement
+    * @param spy The spy value
+    * @param jndiName The jndi name
     */
-   public WrappedCallableStatement(final WrappedConnection lc, final CallableStatement cs)
+   public WrappedCallableStatement(final WrappedConnection lc, final CallableStatement cs,
+                                   boolean spy, String jndiName)
    {
-      super(lc, cs);
+      super(lc, cs, spy, jndiName);
       this.cs = cs;
    }
 
@@ -76,6 +85,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getObject(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
          return cs.getObject(parameterIndex);
       }
       catch (Throwable t)
@@ -87,11 +101,16 @@
    /**
     * {@inheritDoc}
     */
-   public Object getObject(int parameterIndex, Map<String, Class<?>>typeMap) throws SQLException
+   public Object getObject(int parameterIndex, Map<String, Class<?>> typeMap) throws SQLException
    {
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getObject(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, typeMap);
+
          return cs.getObject(parameterIndex, typeMap);
       }
       catch (Throwable t)
@@ -108,6 +127,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getObject(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
          return cs.getObject(parameterName);
       }
       catch (Throwable t)
@@ -124,6 +148,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getObject(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, typeMap);
+
          return cs.getObject(parameterName, typeMap);
       }
       catch (Throwable t)
@@ -140,6 +169,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBoolean(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
          return cs.getBoolean(parameterIndex);
       }
       catch (Throwable t)
@@ -156,6 +190,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBoolean(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
          return cs.getBoolean(parameterName);
       }
       catch (Throwable t)
@@ -172,6 +211,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getByte(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
          return cs.getByte(parameterIndex);
       }
       catch (Throwable t)
@@ -188,6 +232,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getByte(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
          return cs.getByte(parameterName);
       }
       catch (Throwable t)
@@ -204,6 +253,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getShort(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
          return cs.getShort(parameterIndex);
       }
       catch (Throwable t)
@@ -220,6 +274,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getShort(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
          return cs.getShort(parameterName);
       }
       catch (Throwable t)
@@ -236,6 +295,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getInt(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
          return cs.getInt(parameterIndex);
       }
       catch (Throwable t)
@@ -252,6 +316,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getInt(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
          return cs.getInt(parameterName);
       }
       catch (Throwable t)
@@ -268,6 +337,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getLong(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
          return cs.getLong(parameterIndex);
       }
       catch (Throwable t)
@@ -284,6 +358,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getLong(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
          return cs.getLong(parameterName);
       }
       catch (Throwable t)
@@ -300,6 +379,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getFloat(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
          return cs.getFloat(parameterIndex);
       }
       catch (Throwable t)
@@ -316,6 +400,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getFloat(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
          return cs.getFloat(parameterName);
       }
       catch (Throwable t)
@@ -332,6 +421,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getDouble(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
          return cs.getDouble(parameterIndex);
       }
       catch (Throwable t)
@@ -348,6 +442,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getDouble(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
          return cs.getDouble(parameterName);
       }
       catch (Throwable t)
@@ -364,6 +463,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBytes(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
          return cs.getBytes(parameterIndex);
       }
       catch (Throwable t)
@@ -380,6 +484,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBytes(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
          return cs.getBytes(parameterName);
       }
       catch (Throwable t)
@@ -396,6 +505,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getURL(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
          return cs.getURL(parameterIndex);
       }
       catch (Throwable t)
@@ -412,6 +526,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getURL(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
          return cs.getURL(parameterName);
       }
       catch (Throwable t)
@@ -428,6 +547,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getString(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
          return cs.getString(parameterIndex);
       }
       catch (Throwable t)
@@ -444,6 +568,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getString(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
          return cs.getString(parameterName);
       }
       catch (Throwable t)
@@ -460,6 +589,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getRef(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
          return cs.getRef(parameterIndex);
       }
       catch (Throwable t)
@@ -476,6 +610,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getRef(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
          return cs.getRef(parameterName);
       }
       catch (Throwable t)
@@ -492,6 +631,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getTime(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
          return cs.getTime(parameterIndex);
       }
       catch (Throwable t)
@@ -508,6 +652,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getTime(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, calendar);
+
          return cs.getTime(parameterIndex, calendar);
       }
       catch (Throwable t)
@@ -524,6 +673,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getTime(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
          return cs.getTime(parameterName);
       }
       catch (Throwable t)
@@ -540,6 +694,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getTime(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, calendar);
+
          return cs.getTime(parameterName, calendar);
       }
       catch (Throwable t)
@@ -556,6 +715,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getDate(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
          return cs.getDate(parameterIndex);
       }
       catch (Throwable t)
@@ -572,6 +736,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getDate(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, calendar);
+
          return cs.getDate(parameterIndex, calendar);
       }
       catch (Throwable t)
@@ -588,6 +757,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getDate(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
          return cs.getDate(parameterName);
       }
       catch (Throwable t)
@@ -604,6 +778,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getDate(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, calendar);
+
          return cs.getDate(parameterName, calendar);
       }
       catch (Throwable t)
@@ -620,6 +799,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] registerOutParameter(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, sqlType);
+
          cs.registerOutParameter(parameterIndex, sqlType);
       }
       catch (Throwable t)
@@ -636,6 +820,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] registerOutParameter(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, sqlType, scale);
+
          cs.registerOutParameter(parameterIndex, sqlType, scale);
       }
       catch (Throwable t)
@@ -652,6 +841,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] registerOutParameter(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, sqlType, typeName);
+
          cs.registerOutParameter(parameterIndex, sqlType, typeName);
       }
       catch (Throwable t)
@@ -668,6 +862,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] registerOutParameter(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, sqlType);
+
          cs.registerOutParameter(parameterName, sqlType);
       }
       catch (Throwable t)
@@ -684,6 +883,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] registerOutParameter(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, sqlType, scale);
+
          cs.registerOutParameter(parameterName, sqlType, scale);
       }
       catch (Throwable t)
@@ -700,6 +904,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] registerOutParameter(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, sqlType, typeName);
+
          cs.registerOutParameter(parameterName, sqlType, typeName);
       }
       catch (Throwable t)
@@ -716,6 +925,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] wasNull()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT);
+
          return cs.wasNull();
       }
       catch (Throwable t)
@@ -733,6 +946,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBigDecimal(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, scale);
+
          return cs.getBigDecimal(parameterIndex, scale);
       }
       catch (Throwable t)
@@ -749,6 +967,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBigDecimal(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
          return cs.getBigDecimal(parameterIndex);
       }
       catch (Throwable t)
@@ -765,6 +988,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBigDecimal(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
          return cs.getBigDecimal(parameterName);
       }
       catch (Throwable t)
@@ -781,6 +1009,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getTimestamp(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
          return cs.getTimestamp(parameterIndex);
       }
       catch (Throwable t)
@@ -797,6 +1030,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getTimestamp(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, calendar);
+
          return cs.getTimestamp(parameterIndex, calendar);
       }
       catch (Throwable t)
@@ -813,6 +1051,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getTimestamp(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
          return cs.getTimestamp(parameterName);
       }
       catch (Throwable t)
@@ -829,6 +1072,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getTimestamp(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, calendar);
+
          return cs.getTimestamp(parameterName, calendar);
       }
       catch (Throwable t)
@@ -845,6 +1093,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBlob(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
          return cs.getBlob(parameterIndex);
       }
       catch (Throwable t)
@@ -861,6 +1114,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBlob(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
          return cs.getBlob(parameterName);
       }
       catch (Throwable t)
@@ -877,6 +1135,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getClob(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
          return cs.getClob(parameterIndex);
       }
       catch (Throwable t)
@@ -893,6 +1156,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getClob(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
          return cs.getClob(parameterName);
       }
       catch (Throwable t)
@@ -909,6 +1177,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getArray(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
          return cs.getArray(parameterIndex);
       }
       catch (Throwable t)
@@ -925,6 +1198,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getArray(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
          return cs.getArray(parameterName);
       }
       catch (Throwable t)
@@ -936,11 +1214,79 @@
    /**
     * {@inheritDoc}
     */
+   public boolean isClosed() throws SQLException
+   {
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] isClosed()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT);
+
+         PreparedStatement wrapped = getWrappedObject();
+         if (wrapped == null)
+            return true;
+         return wrapped.isClosed();
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public boolean isPoolable() throws SQLException
+   {
+      PreparedStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] isPoolable()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT);
+
+         return statement.isPoolable();
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setPoolable(boolean poolable) throws SQLException
+   {
+      PreparedStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setPoolable(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             poolable);
+
+         statement.setPoolable(poolable);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
    public void setBoolean(String parameterName, boolean value) throws SQLException
    {
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setBoolean(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value);
+
          cs.setBoolean(parameterName, value);
       }
       catch (Throwable t)
@@ -957,6 +1303,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setByte(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value);
+
          cs.setByte(parameterName, value);
       }
       catch (Throwable t)
@@ -973,6 +1324,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setShort(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value);
+
          cs.setShort(parameterName, value);
       }
       catch (Throwable t)
@@ -989,6 +1345,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setInt(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value);
+
          cs.setInt(parameterName, value);
       }
       catch (Throwable t)
@@ -1005,6 +1366,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setLong(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value);
+
          cs.setLong(parameterName, value);
       }
       catch (Throwable t)
@@ -1021,6 +1387,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setFloat(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value);
+
          cs.setFloat(parameterName, value);
       }
       catch (Throwable t)
@@ -1037,6 +1408,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setDouble(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value);
+
          cs.setDouble(parameterName, value);
       }
       catch (Throwable t)
@@ -1053,6 +1429,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setURL(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value);
+
          cs.setURL(parameterName, value);
       }
       catch (Throwable t)
@@ -1069,6 +1450,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setTime(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value);
+
          cs.setTime(parameterName, value);
       }
       catch (Throwable t)
@@ -1085,6 +1471,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setTime(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value, calendar);
+
          cs.setTime(parameterName, value, calendar);
       }
       catch (Throwable t)
@@ -1101,6 +1492,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setNull(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value);
+
          cs.setNull(parameterName, value);
       }
       catch (Throwable t)
@@ -1117,6 +1513,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setNull(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, sqlType, typeName);
+
          cs.setNull(parameterName, sqlType, typeName);
       }
       catch (Throwable t)
@@ -1133,6 +1534,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setBigDecimal(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value);
+
          cs.setBigDecimal(parameterName, value);
       }
       catch (Throwable t)
@@ -1149,6 +1555,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setString(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value);
+
          cs.setString(parameterName, value);
       }
       catch (Throwable t)
@@ -1165,6 +1576,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setBytes(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, Arrays.toString(value));
+
          cs.setBytes(parameterName, value);
       }
       catch (Throwable t)
@@ -1181,6 +1597,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setDate(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value);
+
          cs.setDate(parameterName, value);
       }
       catch (Throwable t)
@@ -1197,6 +1618,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setDate(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value, calendar);
+
          cs.setDate(parameterName, value, calendar);
       }
       catch (Throwable t)
@@ -1213,6 +1639,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setTimestamp(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value);
+
          cs.setTimestamp(parameterName, value);
       }
       catch (Throwable t)
@@ -1229,6 +1660,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setTimestamp(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value, calendar);
+
          cs.setTimestamp(parameterName, value, calendar);
       }
       catch (Throwable t)
@@ -1245,6 +1681,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setAsciiStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, stream, length);
+
          cs.setAsciiStream(parameterName, stream, length);
       }
       catch (Throwable t)
@@ -1261,6 +1702,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setBinaryStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, stream, length);
+
          cs.setBinaryStream(parameterName, stream, length);
       }
       catch (Throwable t)
@@ -1277,6 +1723,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setObject(%s, %s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value, sqlType, scale);
+
          cs.setObject(parameterName, value, sqlType, scale);
       }
       catch (Throwable t)
@@ -1293,6 +1744,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setObject(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value, sqlType);
+
          cs.setObject(parameterName, value, sqlType);
       }
       catch (Throwable t)
@@ -1309,6 +1765,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setObject(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value);
+
          cs.setObject(parameterName, value);
       }
       catch (Throwable t)
@@ -1325,6 +1786,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setCharacterStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, reader, length);
+
          cs.setCharacterStream(parameterName, reader, length);
       }
       catch (Throwable t)
@@ -1336,6 +1802,1056 @@
    /**
     * {@inheritDoc}
     */
+   public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException
+   {
+      PreparedStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setAsciiStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, x, length);
+
+         statement.setAsciiStream(parameterIndex, x, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException
+   {
+      PreparedStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setAsciiStream(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, x);
+
+         statement.setAsciiStream(parameterIndex, x);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException
+   {
+      PreparedStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setBinaryStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, x, length);
+
+         statement.setBinaryStream(parameterIndex, x, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException
+   {
+      PreparedStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setBinaryStream(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, x);
+
+         statement.setBinaryStream(parameterIndex, x);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException
+   {
+      PreparedStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setBlob(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, inputStream, length);
+
+         statement.setBlob(parameterIndex, inputStream, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException
+   {
+      PreparedStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setBlob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, inputStream);
+
+         statement.setBlob(parameterIndex, inputStream);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException
+   {
+      PreparedStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setCharacterStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, reader, length);
+
+         statement.setCharacterStream(parameterIndex, reader, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException
+   {
+      PreparedStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setCharacterStream(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, reader);
+
+         statement.setCharacterStream(parameterIndex, reader);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setClob(int parameterIndex, Reader reader, long length) throws SQLException
+   {
+      PreparedStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setClob(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, reader, length);
+
+         statement.setClob(parameterIndex, reader, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setClob(int parameterIndex, Reader reader) throws SQLException
+   {
+      PreparedStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setClob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, reader);
+
+         statement.setClob(parameterIndex, reader);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException
+   {
+      PreparedStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setNCharacterStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, value, length);
+
+         statement.setNCharacterStream(parameterIndex, value, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException
+   {
+      PreparedStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setNCharacterStream(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, value);
+ 
+         statement.setNCharacterStream(parameterIndex, value);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setNClob(int parameterIndex, NClob value) throws SQLException
+   {
+      PreparedStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setNClob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, value);
+
+         statement.setNClob(parameterIndex, value);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException
+   {
+      PreparedStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setNClob(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, reader, length);
+
+         statement.setNClob(parameterIndex, reader, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setNClob(int parameterIndex, Reader reader) throws SQLException
+   {
+      PreparedStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setNClob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, reader);
+
+         statement.setNClob(parameterIndex, reader);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setNString(int parameterIndex, String value) throws SQLException
+   {
+      PreparedStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setNString(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, value);
+
+         statement.setNString(parameterIndex, value);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setRowId(int parameterIndex, RowId x) throws SQLException
+   {
+      PreparedStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setRowId(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, x);
+
+         statement.setRowId(parameterIndex, x);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
+   {
+      PreparedStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setSQLXML(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, xmlObject);
+
+         statement.setSQLXML(parameterIndex, xmlObject);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public Reader getCharacterStream(int parameterIndex) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getCharacterStream(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
+         return statement.getCharacterStream(parameterIndex);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public Reader getCharacterStream(String parameterName) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getCharacterStream(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
+         return statement.getCharacterStream(parameterName);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public Reader getNCharacterStream(int parameterIndex) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getNCharacterStream(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
+         return statement.getNCharacterStream(parameterIndex);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public Reader getNCharacterStream(String parameterName) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getNCharacterStream(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
+         return statement.getCharacterStream(parameterName);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public NClob getNClob(int parameterIndex) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getNClob(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
+         return statement.getNClob(parameterIndex);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public NClob getNClob(String parameterName) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getNClob(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
+         return statement.getNClob(parameterName);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public String getNString(int parameterIndex) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getNString(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
+         return statement.getNString(parameterIndex);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public String getNString(String parameterName) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getNString(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
+         return statement.getNString(parameterName);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public RowId getRowId(int parameterIndex) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getRowId(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
+         return statement.getRowId(parameterIndex);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public RowId getRowId(String parameterName) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getRowId(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
+         return statement.getRowId(parameterName);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public SQLXML getSQLXML(int parameterIndex) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getSQLXML(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex);
+
+         return statement.getSQLXML(parameterIndex);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public SQLXML getSQLXML(String parameterName) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getSQLXML(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName);
+
+         return statement.getSQLXML(parameterName);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setAsciiStream(String parameterName, InputStream x, long length) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setAsciiStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, x, length);
+
+         statement.setAsciiStream(parameterName, x, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setAsciiStream(String parameterName, InputStream x) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setAsciiStream(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, x);
+
+         statement.setAsciiStream(parameterName, x);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setBinaryStream(String parameterName, InputStream x, long length) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setBinaryStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, x, length);
+
+         statement.setBinaryStream(parameterName, x, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setBinaryStream(String parameterName, InputStream x) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setBinaryStream(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, x);
+
+         statement.setBinaryStream(parameterName, x);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setBlob(String parameterName, Blob x) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setBlob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, x);
+
+         statement.setBlob(parameterName, x);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setBlob(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, inputStream, length);
+
+         statement.setBlob(parameterName, inputStream, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setBlob(String parameterName, InputStream inputStream) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setBlob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, inputStream);
+
+         statement.setBlob(parameterName, inputStream);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setCharacterStream(String parameterName, Reader reader, long length) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setCharacterStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, reader, length);
+
+         statement.setCharacterStream(parameterName, reader, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setCharacterStream(String parameterName, Reader reader) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setCharacterStream(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, reader);
+
+         statement.setCharacterStream(parameterName, reader);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setClob(String parameterName, Clob x) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setClob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, x);
+
+         statement.setClob(parameterName, x);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setClob(String parameterName, Reader reader, long length) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setClob(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, reader, length);
+
+         statement.setClob(parameterName, reader, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setClob(String parameterName, Reader reader) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setClob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, reader);
+
+         statement.setClob(parameterName, reader);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setNCharacterStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value, length);
+
+         statement.setNCharacterStream(parameterName, value, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setNCharacterStream(String parameterName, Reader value) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setNCharacterStream(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value);
+
+         statement.setNCharacterStream(parameterName, value);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setNClob(String parameterName, NClob value) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setNClob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value);
+
+         statement.setNClob(parameterName, value);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setNClob(String parameterName, Reader reader, long length) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setNClob(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, reader, length);
+
+         statement.setNClob(parameterName, reader, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setNClob(String parameterName, Reader reader) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setNClob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, reader);
+
+         statement.setNClob(parameterName, reader);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setNString(String parameterName, String value) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setNString(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, value);
+
+         statement.setNString(parameterName, value);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setRowId(String parameterName, RowId x) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setRowId(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, x);
+
+         statement.setRowId(parameterName, x);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException
+   {
+      CallableStatement statement = getUnderlyingStatement();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setSQLXML(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, xmlObject);
+
+         statement.setSQLXML(parameterName, xmlObject);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
    protected CallableStatement getWrappedObject() throws SQLException
    {
       return (CallableStatement) super.getWrappedObject();

Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedConnection.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedConnection.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedConnection.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -22,19 +22,28 @@
 
 package org.jboss.jca.adapters.jdbc;
 
+import java.sql.Array;
+import java.sql.Blob;
 import java.sql.CallableStatement;
+import java.sql.Clob;
 import java.sql.Connection;
 import java.sql.DatabaseMetaData;
+import java.sql.NClob;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
+import java.sql.SQLClientInfoException;
 import java.sql.SQLException;
 import java.sql.SQLFeatureNotSupportedException;
 import java.sql.SQLWarning;
+import java.sql.SQLXML;
 import java.sql.Savepoint;
 import java.sql.Statement;
+import java.sql.Struct;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.Properties;
 
 import org.jboss.logging.Logger;
 
@@ -43,12 +52,16 @@
  *
  * @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:jesper.pedersen at jboss.org">Jesper Pedersen</a>
  * @version $Revision: 96595 $
  */
 public abstract class WrappedConnection extends JBossWrapper implements Connection
 {
    private static Logger log = Logger.getLogger(WrappedConnection.class);
 
+   /** The spy logger */
+   protected static Logger spyLogger = Logger.getLogger(Constants.SPY_LOGGER_CATEGORY);
+
    private volatile BaseWrapperManagedConnection mc;
    private BaseWrapperManagedConnection lockedMC;
    private int lockCount;
@@ -61,13 +74,21 @@
 
    private int trackStatements;
 
+   private boolean spy = false;
+
+   private String jndiName = null;
+
    /**
     * Constructor
     * @param mc The managed connection
+    * @param spy The spy value
+    * @param jndiName The jndi name
     */
-   public WrappedConnection(final BaseWrapperManagedConnection mc)
+   public WrappedConnection(final BaseWrapperManagedConnection mc, boolean spy, String jndiName)
    {
       setManagedConnection(mc);
+      setSpy(spy);
+      setJndiName(jndiName);
    }
 
    /**
@@ -135,6 +156,42 @@
    }
 
    /**
+    * Get the spy value
+    * @return The value
+    */
+   public boolean isSpy()
+   {
+      return spy;
+   }
+
+   /**
+    * Set the spy value
+    * @param v The value
+    */
+   protected void setSpy(boolean v)
+   {
+      this.spy = v;
+   }
+
+   /**
+    * Get the jndi name value
+    * @return The value
+    */
+   public String getJndiName()
+   {
+      return jndiName;
+   }
+
+   /**
+    * Set the jndi name value
+    * @param v The value
+    */
+   protected void setJndiName(String v)
+   {
+      this.jndiName = v;
+   }
+
+   /**
     * {@inheritDoc}
     */
    public void setReadOnly(boolean readOnly) throws SQLException
@@ -143,6 +200,11 @@
       try
       {
          checkStatus();
+
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setReadOnly(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION, readOnly);
+
          mc.setJdbcReadOnly(readOnly);
       }
       finally
@@ -157,6 +219,10 @@
    public boolean isReadOnly() throws SQLException
    {
       checkStatus();
+
+      if (isSpy())
+         spyLogger.debugf("%s [%s] isReadOnly()", getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
       return mc.isJdbcReadOnly();
    }
 
@@ -166,6 +232,10 @@
    public void close() throws SQLException
    {
       closed = true;
+
+      if (isSpy())
+         spyLogger.debugf("%s [%s] close()", getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
       if (mc != null)
       {
          if (trackStatements != BaseWrapperManagedConnectionFactory.TRACK_STATEMENTS_FALSE_INT)
@@ -207,15 +277,20 @@
     */
    public boolean isClosed() throws SQLException
    {
+      if (isSpy())
+         spyLogger.debugf("%s [%s] isClosed()", getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
       return closed;
    }
 
    /**
     * Wrap statement
     * @param statement The statement
+    * @param spy The spy value
+    * @param jndiName The jndi name
     * @return The wrapped statement
     */
-   protected abstract WrappedStatement wrapStatement(Statement statement);
+   protected abstract WrappedStatement wrapStatement(Statement statement, boolean spy, String jndiName);
 
    /**
     * {@inheritDoc}
@@ -228,7 +303,10 @@
          checkTransaction();
          try
          {
-            return wrapStatement(mc.getConnection().createStatement());
+            if (isSpy())
+               spyLogger.debugf("%s [%s] createStatement()", getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
+            return wrapStatement(mc.getConnection().createStatement(), isSpy(), getJndiName());
          }
          catch (Throwable t)
          {
@@ -252,7 +330,13 @@
          checkTransaction();
          try
          {
-            return wrapStatement(mc.getConnection().createStatement(resultSetType, resultSetConcurrency));
+            if (isSpy())
+               spyLogger.debugf("%s [%s] createStatement(%s, %s)", 
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION,
+                                resultSetType, resultSetConcurrency);
+
+            return wrapStatement(mc.getConnection().createStatement(resultSetType, resultSetConcurrency),
+                                 isSpy(), getJndiName());
          }
          catch (Throwable t)
          {
@@ -277,8 +361,14 @@
          checkTransaction();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] createStatement(%s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION,
+                                resultSetType, resultSetConcurrency, resultSetHoldability);
+
             return wrapStatement(mc.getConnection()
-                  .createStatement(resultSetType, resultSetConcurrency, resultSetHoldability));
+                                 .createStatement(resultSetType, resultSetConcurrency, resultSetHoldability),
+                                 isSpy(), getJndiName());
          }
          catch (Throwable t)
          {
@@ -294,9 +384,12 @@
    /**
     * Wrap a prepared statement
     * @param statement The statement
+    * @param spy The spy value
+    * @param jndiName The jndi name
     * @return The wrapped prepared statement
     */
-   protected abstract WrappedPreparedStatement wrapPreparedStatement(PreparedStatement statement);
+   protected abstract WrappedPreparedStatement wrapPreparedStatement(PreparedStatement statement,
+                                                                     boolean spy, String jndiName);
 
    /**
     * {@inheritDoc}
@@ -309,8 +402,13 @@
          checkTransaction();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] prepareStatement(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION, sql);
+
             return wrapPreparedStatement(mc.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY,
-                                                             ResultSet.CONCUR_READ_ONLY));
+                                                             ResultSet.CONCUR_READ_ONLY),
+                                         isSpy(), getJndiName());
          }
          catch (Throwable t)
          {
@@ -335,7 +433,13 @@
          checkTransaction();
          try
          {
-            return wrapPreparedStatement(mc.prepareStatement(sql, resultSetType, resultSetConcurrency));
+            if (isSpy())
+               spyLogger.debugf("%s [%s] prepareStatement(%s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION,
+                                sql, resultSetType, resultSetConcurrency);
+
+            return wrapPreparedStatement(mc.prepareStatement(sql, resultSetType, resultSetConcurrency),
+                                         isSpy(), getJndiName());
          }
          catch (Throwable t)
          {
@@ -360,8 +464,15 @@
          checkTransaction();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] prepareStatement(%s, %s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION,
+                                sql, resultSetType, resultSetConcurrency, resultSetHoldability);
+
             return wrapPreparedStatement(mc.getConnection()
-                  .prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability));
+                                         .prepareStatement(sql, resultSetType,
+                                                           resultSetConcurrency, resultSetHoldability),
+                                         isSpy(), getJndiName());
          }
          catch (Throwable t)
          {
@@ -385,7 +496,13 @@
          checkTransaction();
          try
          {
-            return wrapPreparedStatement(mc.getConnection().prepareStatement(sql, autoGeneratedKeys));
+            if (isSpy())
+               spyLogger.debugf("%s [%s] prepareStatement(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION,
+                                sql, autoGeneratedKeys);
+
+            return wrapPreparedStatement(mc.getConnection().prepareStatement(sql, autoGeneratedKeys),
+                                         isSpy(), getJndiName());
          }
          catch (Throwable t)
          {
@@ -409,7 +526,13 @@
          checkTransaction();
          try
          {
-            return wrapPreparedStatement(mc.getConnection().prepareStatement(sql, columnIndexes));
+            if (isSpy())
+               spyLogger.debugf("%s [%s] prepareStatement(%s, %s)"
+                                , getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION,
+                                sql, Arrays.toString(columnIndexes));
+
+            return wrapPreparedStatement(mc.getConnection().prepareStatement(sql, columnIndexes),
+                                         isSpy(), getJndiName());
          }
          catch (Throwable t)
          {
@@ -433,7 +556,13 @@
          checkTransaction();
          try
          {
-            return wrapPreparedStatement(mc.getConnection().prepareStatement(sql, columnNames));
+            if (isSpy())
+               spyLogger.debugf("%s [%s] prepareStatement(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION,
+                                sql, Arrays.toString(columnNames));
+
+            return wrapPreparedStatement(mc.getConnection().prepareStatement(sql, columnNames),
+                                         isSpy(), getJndiName());
          }
          catch (Throwable t)
          {
@@ -449,9 +578,12 @@
    /**
     * Wrap a callable statement
     * @param statement The statement
+    * @param spy The spy value
+    * @param jndiName The jndi name
     * @return The wrapped callable statement
     */
-   protected abstract WrappedCallableStatement wrapCallableStatement(CallableStatement statement);
+   protected abstract WrappedCallableStatement wrapCallableStatement(CallableStatement statement,
+                                                                     boolean spy, String jndiName);
 
    /**
     * {@inheritDoc}
@@ -464,7 +596,11 @@
          checkTransaction();
          try
          {
-            return wrapCallableStatement(mc.prepareCall(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY));
+            if (isSpy())
+               spyLogger.debugf("%s [%s] prepareCall(%s)", getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION, sql);
+
+            return wrapCallableStatement(mc.prepareCall(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY),
+                                         isSpy(), getJndiName());
          }
          catch (Throwable t)
          {
@@ -488,7 +624,13 @@
          checkTransaction();
          try
          {
-            return wrapCallableStatement(mc.prepareCall(sql, resultSetType, resultSetConcurrency));
+            if (isSpy())
+               spyLogger.debugf("%s [%s] prepareCall(%s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION,
+                                sql, resultSetType, resultSetConcurrency);
+
+            return wrapCallableStatement(mc.prepareCall(sql, resultSetType, resultSetConcurrency),
+                                         isSpy(), getJndiName());
          }
          catch (Throwable t)
          {
@@ -513,8 +655,14 @@
          checkTransaction();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] prepareCall(%s, %s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION,
+                                sql, resultSetType, resultSetConcurrency, resultSetHoldability);
+
             return wrapCallableStatement(mc.getConnection()
-                  .prepareCall(sql, resultSetType, resultSetConcurrency, resultSetHoldability));
+                                         .prepareCall(sql, resultSetType, resultSetConcurrency, resultSetHoldability),
+                                         isSpy(), getJndiName());
          }
          catch (Throwable t)
          {
@@ -538,6 +686,10 @@
          checkTransaction();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] nativeSQL(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION, sql);
+
             return mc.getConnection().nativeSQL(sql);
          }
          catch (Throwable t)
@@ -560,6 +712,11 @@
       try
       {
          checkStatus();
+
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setAutoCommit(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION, autocommit);
+
          mc.setJdbcAutoCommit(autocommit);
       }
       finally
@@ -577,6 +734,10 @@
       try
       {
          checkStatus();
+
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getAutoCommit()", getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
          return mc.isJdbcAutoCommit();
       }
       finally
@@ -594,6 +755,10 @@
       try
       {
          checkTransaction();
+
+         if (isSpy())
+            spyLogger.debugf("%s [%s] commit()", getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
          mc.jdbcCommit();
       }
       finally
@@ -611,6 +776,10 @@
       try
       {
          checkTransaction();
+
+         if (isSpy())
+            spyLogger.debugf("%s [%s] rollback()", getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
          mc.jdbcRollback();
       }
       finally
@@ -628,6 +797,11 @@
       try
       {
          checkTransaction();
+
+         if (isSpy())
+            spyLogger.debugf("%s [%s] rollback(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION, savepoint);
+
          mc.jdbcRollback(savepoint);
       }
       finally
@@ -647,6 +821,9 @@
          checkTransaction();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getMetaData()", getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
             return mc.getConnection().getMetaData();
          }
          catch (Throwable t)
@@ -671,6 +848,10 @@
          checkTransaction();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setCatalog(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION, catalog);
+
             mc.getConnection().setCatalog(catalog);
          }
          catch (Throwable t)
@@ -695,6 +876,10 @@
          checkTransaction();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getCatalog()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
             return mc.getConnection().getCatalog();
          }
          catch (Throwable t)
@@ -717,6 +902,11 @@
       try
       {
          checkStatus();
+
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setTransactionIsolation(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION, isolationLevel);
+
          mc.setJdbcTransactionIsolation(isolationLevel);
       }
       finally
@@ -734,6 +924,11 @@
       try
       {
          checkStatus();
+
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getTransactionIsolation()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
          return mc.getJdbcTransactionIsolation();
       }
       finally
@@ -753,6 +948,10 @@
          checkTransaction();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getWarnings()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
             return mc.getConnection().getWarnings();
          }
          catch (Throwable t)
@@ -777,6 +976,9 @@
          checkTransaction();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] clearWarnings()", getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
             mc.getConnection().clearWarnings();
          }
          catch (Throwable t)
@@ -802,6 +1004,9 @@
          checkTransaction();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getTypeMap()", getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
             return mc.getConnection().getTypeMap();
          }
          catch (Throwable t)
@@ -827,6 +1032,10 @@
          checkTransaction();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setTypeMap(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION, typeMap);
+
             mc.getConnection().setTypeMap(typeMap);
          }
          catch (Throwable t)
@@ -851,6 +1060,10 @@
          checkTransaction();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setHoldability(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION, holdability);
+
             mc.getConnection().setHoldability(holdability);
          }
          catch (Throwable t)
@@ -875,6 +1088,9 @@
          checkTransaction();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getHoldability()", getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
             return mc.getConnection().getHoldability();
          }
          catch (Throwable t)
@@ -899,6 +1115,9 @@
          checkTransaction();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setSavepoint()", getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
             return mc.getConnection().setSavepoint();
          }
          catch (Throwable t)
@@ -923,6 +1142,10 @@
          checkTransaction();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setSavepoint(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION, name);
+
             return mc.getConnection().setSavepoint(name);
          }
          catch (Throwable t)
@@ -947,6 +1170,10 @@
          checkTransaction();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] releaseSavepoint(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION, savepoint);
+
             mc.getConnection().releaseSavepoint(savepoint);
          }
          catch (Throwable t)
@@ -960,9 +1187,362 @@
       }
    }
 
+
    /**
     * {@inheritDoc}
     */
+   public Array createArrayOf(String typeName, Object[] elements) throws SQLException
+   {
+      lock();
+      try
+      {
+         Connection c = getUnderlyingConnection();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] createArrayOf(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION,
+                                typeName, Arrays.toString(elements));
+
+            return c.createArrayOf(typeName, elements);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public Blob createBlob() throws SQLException
+   {
+      lock();
+      try
+      {
+         Connection c = getUnderlyingConnection();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] createBlob()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
+            return c.createBlob();
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public Clob createClob() throws SQLException
+   {
+      lock();
+      try
+      {
+         Connection c = getUnderlyingConnection();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] createClob()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
+            return c.createClob();
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public NClob createNClob() throws SQLException
+   {
+      lock();
+      try
+      {
+         Connection c = getUnderlyingConnection();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] createNClob()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
+            return c.createNClob();
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public SQLXML createSQLXML() throws SQLException
+   {
+      lock();
+      try
+      {
+         Connection c = getUnderlyingConnection();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] createSQLXML()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
+            return c.createSQLXML();
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public Struct createStruct(String typeName, Object[] attributes) throws SQLException
+   {
+      lock();
+      try
+      {
+         Connection c = getUnderlyingConnection();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] createStruct(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION,
+                                typeName, Arrays.toString(attributes));
+
+            return c.createStruct(typeName, attributes);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public Properties getClientInfo() throws SQLException
+   {
+      lock();
+      try
+      {
+         Connection c = getUnderlyingConnection();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getClientInfo()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
+            return c.getClientInfo();
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public String getClientInfo(String name) throws SQLException
+   {
+      lock();
+      try
+      {
+         Connection c = getUnderlyingConnection();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getClientInfo(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION,
+                                name);
+
+            return c.getClientInfo(name);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public boolean isValid(int timeout) throws SQLException
+   {
+      lock();
+      try
+      {
+         Connection c = getUnderlyingConnection();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] isValid(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION,
+                                timeout);
+
+            return c.isValid(timeout);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setClientInfo(Properties properties) throws SQLClientInfoException
+   {
+      try
+      {
+         lock();
+         try
+         {
+            Connection c = getUnderlyingConnection();
+            try
+            {
+               if (isSpy())
+                  spyLogger.debugf("%s [%s] setClientInfo(%s)",
+                                   getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION,
+                                   properties);
+
+               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();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setClientInfo(String name, String value) throws SQLClientInfoException
+   {
+      try
+      {
+         lock();
+         try
+         {
+            Connection c = getUnderlyingConnection();
+            try
+            {
+               if (isSpy())
+                  spyLogger.debugf("%s [%s] setClientInfo(%s, %s)",
+                                   getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION,
+                                   name, value);
+
+               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();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
    public Connection getUnderlyingConnection() throws SQLException
    {
       lock();

Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedConnectionFactory.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedConnectionFactory.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedConnectionFactory.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -30,6 +30,7 @@
  * WrappedConnectionFactory.
  * 
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
  * @version $Revision: 85945 $
  */
 public interface WrappedConnectionFactory
@@ -37,9 +38,11 @@
    /**
     * Create a wrapped connection
     * @param mc The managed connection
+    * @param spy The spy value
+    * @param jndiName The jndi name
     * @return The wrapped connection
     */
-   WrappedConnection createWrappedConnection(BaseWrapperManagedConnection mc);
+   WrappedConnection createWrappedConnection(BaseWrapperManagedConnection mc, boolean spy, String jndiName);
 
    /**
     * Create a cached prepared statement

Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedPreparedStatement.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedPreparedStatement.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedPreparedStatement.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -30,14 +30,18 @@
 import java.sql.Blob;
 import java.sql.Clob;
 import java.sql.Date;
+import java.sql.NClob;
 import java.sql.ParameterMetaData;
 import java.sql.PreparedStatement;
 import java.sql.Ref;
 import java.sql.ResultSet;
 import java.sql.ResultSetMetaData;
+import java.sql.RowId;
 import java.sql.SQLException;
+import java.sql.SQLXML;
 import java.sql.Time;
 import java.sql.Timestamp;
+import java.util.Arrays;
 import java.util.Calendar;
 
 /**
@@ -45,6 +49,7 @@
  *
  * @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:jesper.pedersen at jboss.org">Jesper Pedersen</a>
  * @version $Revision: 71788 $
  */
 public abstract class WrappedPreparedStatement extends WrappedStatement implements PreparedStatement 
@@ -55,10 +60,13 @@
     * Constructor
     * @param lc The connection
     * @param ps The prepared statement
+    * @param spy The spy value
+    * @param jndiName The jndi name
     */
-   public WrappedPreparedStatement(final WrappedConnection lc, final PreparedStatement ps) 
+   public WrappedPreparedStatement(final WrappedConnection lc, final PreparedStatement ps,
+                                   boolean spy, String jndiName) 
    {
-      super(lc, ps);
+      super(lc, ps, spy, jndiName);
       this.ps = ps;
    }
 
@@ -97,6 +105,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setBoolean(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
             ps.setBoolean(parameterIndex, value);         
          }
          catch (Throwable t)
@@ -121,6 +134,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setByte(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
             ps.setByte(parameterIndex, value);         
          }
          catch (Throwable t)
@@ -145,6 +163,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setShort(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
             ps.setShort(parameterIndex, value);         
          }
          catch (Throwable t)
@@ -169,6 +192,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setInt(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
             ps.setInt(parameterIndex, value);         
          }
          catch (Throwable t)
@@ -193,6 +221,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setLong(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
             ps.setLong(parameterIndex, value);         
          }
          catch (Throwable t)
@@ -217,6 +250,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setFloat(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
             ps.setFloat(parameterIndex, value);         
          }
          catch (Throwable t)
@@ -241,6 +279,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setDouble(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
             ps.setDouble(parameterIndex, value);         
          }
          catch (Throwable t)
@@ -265,6 +308,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setURL(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
             ps.setURL(parameterIndex, value);         
          }
          catch (Throwable t)
@@ -289,6 +337,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setTime(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
             ps.setTime(parameterIndex, value);         
          }
          catch (Throwable t)
@@ -313,6 +366,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setTime(%s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value, calendar);
+
             ps.setTime(parameterIndex, value, calendar);         
          }
          catch (Throwable t)
@@ -338,6 +396,11 @@
          try 
          {
             checkConfiguredQueryTimeout();
+
+            if (isSpy())
+               spyLogger.debugf("%s [%s] execute()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT);
+
             return ps.execute();         
          }
          catch (Throwable t)
@@ -362,6 +425,10 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getMetaData()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT);
+
             return ps.getMetaData();         
          }
          catch (Throwable t)
@@ -387,6 +454,11 @@
          try 
          {
             checkConfiguredQueryTimeout();
+
+            if (isSpy())
+               spyLogger.debugf("%s [%s] executeQuery()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT);
+
             ResultSet resultSet = ps.executeQuery();
             return registerResultSet(resultSet);
          }
@@ -413,6 +485,11 @@
          try 
          {
             checkConfiguredQueryTimeout();
+
+            if (isSpy())
+               spyLogger.debugf("%s [%s] executeUpdate()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT);
+
             return ps.executeUpdate();         
          }
          catch (Throwable t)
@@ -437,6 +514,10 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] addBatch()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT);
+
             ps.addBatch();         
          }
          catch (Throwable t)
@@ -461,6 +542,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setNull(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, sqlType);
+
             ps.setNull(parameterIndex, sqlType);         
          }
          catch (Throwable t)
@@ -485,6 +571,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setNull(%s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, sqlType, typeName);
+
             ps.setNull(parameterIndex, sqlType, typeName);         
          }
          catch (Throwable t)
@@ -509,6 +600,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setBigDecimal(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
             ps.setBigDecimal(parameterIndex, value);         
          }
          catch (Throwable t)
@@ -533,6 +629,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setString(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
             ps.setString(parameterIndex, value);         
          }
          catch (Throwable t)
@@ -557,6 +658,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setBytes(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, Arrays.toString(value));
+
             ps.setBytes(parameterIndex, value);         
          }
          catch (Throwable t)
@@ -581,6 +687,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setDate(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
             ps.setDate(parameterIndex, value);         
          }
          catch (Throwable t)
@@ -605,6 +716,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setDate(%s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value, calendar);
+
             ps.setDate(parameterIndex, value, calendar);         
          }
          catch (Throwable t)
@@ -629,6 +745,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setTimestamp(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
             ps.setTimestamp(parameterIndex, value);         
          }
          catch (Throwable t)
@@ -653,6 +774,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setTimestamp(%s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value, calendar);
+
             ps.setTimestamp(parameterIndex, value, calendar);         
          }
          catch (Throwable t)
@@ -678,6 +804,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setAsciiStream(%s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, stream, length);
+
             ps.setAsciiStream(parameterIndex, stream, length);         
          }
          catch (Throwable t)
@@ -703,6 +834,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setUnicodeStream(%s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, stream, length);
+
             ps.setUnicodeStream(parameterIndex, stream, length);         
          }
          catch (Throwable t)
@@ -727,6 +863,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setBinaryStream(%s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, stream, length);
+
             ps.setBinaryStream(parameterIndex, stream, length);         
          }
          catch (Throwable t)
@@ -751,6 +892,10 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] clearParameters()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT);
+
             ps.clearParameters();         
          }
          catch (Throwable t)
@@ -775,6 +920,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setObject(%s, %s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value, sqlType, scale);
+
             ps.setObject(parameterIndex, value, sqlType, scale);         
          }
          catch (Throwable t)
@@ -799,6 +949,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setObject(%s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value, sqlType);
+
             ps.setObject(parameterIndex, value, sqlType);         
          }
          catch (Throwable t)
@@ -823,6 +978,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setObject(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
             ps.setObject(parameterIndex, value);         
          }
          catch (Throwable t)
@@ -847,6 +1007,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setCharacterStream(%s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, reader, length);
+
             ps.setCharacterStream(parameterIndex, reader, length);         
          }
          catch (Throwable t)
@@ -871,6 +1036,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setRef(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
             ps.setRef(parameterIndex, value);         
          }
          catch (Throwable t)
@@ -895,6 +1065,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setBlob(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
             ps.setBlob(parameterIndex, value);         
          }
          catch (Throwable t)
@@ -919,6 +1094,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setClob(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
             ps.setClob(parameterIndex, value);         
          }
          catch (Throwable t)
@@ -943,6 +1123,11 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setArray(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
             ps.setArray(parameterIndex, value);         
          }
          catch (Throwable t)
@@ -967,6 +1152,10 @@
          checkState();
          try 
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getParameterMetaData()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT);
+
             return ps.getParameterMetaData();         
          }
          catch (Throwable t)
@@ -980,9 +1169,616 @@
       }
    }
 
+
    /**
     * {@inheritDoc}
     */
+   public boolean isClosed() throws SQLException
+   {
+      lock();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] isClosed()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT);
+
+         PreparedStatement wrapped = getWrappedObject();
+         if (wrapped == null)
+            return true;
+         return wrapped.isClosed();
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public boolean isPoolable() throws SQLException
+   {
+      lock();
+      try
+      {
+         PreparedStatement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] isPoolable()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT);
+
+            return statement.isPoolable();
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setPoolable(boolean poolable) throws SQLException
+   {
+      lock();
+      try
+      {
+         PreparedStatement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setPoolable(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                poolable);
+
+            statement.setPoolable(poolable);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException
+   {
+      lock();
+      try
+      {
+         PreparedStatement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setAsciiStream(%s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, x, length);
+
+            statement.setAsciiStream(parameterIndex, x, length);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException
+   {
+      lock();
+      try
+      {
+         PreparedStatement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setAsciiStream(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, x);
+
+            statement.setAsciiStream(parameterIndex, x);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException
+   {
+      lock();
+      try
+      {
+         PreparedStatement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setBinaryStream(%s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, x, length);
+
+            statement.setBinaryStream(parameterIndex, x, length);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException
+   {
+      lock();
+      try
+      {
+         PreparedStatement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setBinaryStream(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, x);
+
+            statement.setBinaryStream(parameterIndex, x);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException
+   {
+      lock();
+      try
+      {
+         PreparedStatement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setBlob(%s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, inputStream, length);
+
+            statement.setBlob(parameterIndex, inputStream, length);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException
+   {
+      lock();
+      try
+      {
+         PreparedStatement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setBlob(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, inputStream);
+
+            statement.setBlob(parameterIndex, inputStream);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException
+   {
+      lock();
+      try
+      {
+         PreparedStatement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setCharacterStream(%s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, reader, length);
+
+            statement.setCharacterStream(parameterIndex, reader, length);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException
+   {
+      lock();
+      try
+      {
+         PreparedStatement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setCharacterStream(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, reader);
+
+            statement.setCharacterStream(parameterIndex, reader);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setClob(int parameterIndex, Reader reader, long length) throws SQLException
+   {
+      lock();
+      try
+      {
+         PreparedStatement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setClob(%s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, reader, length);
+
+            statement.setClob(parameterIndex, reader, length);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setClob(int parameterIndex, Reader reader) throws SQLException
+   {
+      lock();
+      try
+      {
+         PreparedStatement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setClob(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, reader);
+
+            statement.setClob(parameterIndex, reader);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException
+   {
+      lock();
+      try
+      {
+         PreparedStatement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setNCharacterStream(%s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value, length);
+
+            statement.setNCharacterStream(parameterIndex, value, length);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException
+   {
+      lock();
+      try
+      {
+         PreparedStatement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setNCharacterStream(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
+            statement.setNCharacterStream(parameterIndex, value);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setNClob(int parameterIndex, NClob value) throws SQLException
+   {
+      lock();
+      try
+      {
+         PreparedStatement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setNClob(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
+            statement.setNClob(parameterIndex, value);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException
+   {
+      lock();
+      try
+      {
+         PreparedStatement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setNClob(%s, %s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, reader, length);
+
+            statement.setNClob(parameterIndex, reader, length);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setNClob(int parameterIndex, Reader reader) throws SQLException
+   {
+      lock();
+      try
+      {
+         PreparedStatement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setNClob(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, reader);
+
+            statement.setNClob(parameterIndex, reader);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setNString(int parameterIndex, String value) throws SQLException
+   {
+      lock();
+      try
+      {
+         PreparedStatement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setNString(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, value);
+
+            statement.setNString(parameterIndex, value);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setRowId(int parameterIndex, RowId x) throws SQLException
+   {
+      lock();
+      try
+      {
+         PreparedStatement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setRowId(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, x);
+
+            statement.setRowId(parameterIndex, x);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
+   {
+      lock();
+      try
+      {
+         PreparedStatement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setSQLXML(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT,
+                                parameterIndex, xmlObject);
+
+            statement.setSQLXML(parameterIndex, xmlObject);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
    protected PreparedStatement getWrappedObject() throws SQLException
    {
       return (PreparedStatement) super.getWrappedObject();

Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedResultSet.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedResultSet.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedResultSet.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -30,26 +30,36 @@
 import java.sql.Blob;
 import java.sql.Clob;
 import java.sql.Date;
+import java.sql.NClob;
 import java.sql.Ref;
 import java.sql.ResultSet;
 import java.sql.ResultSetMetaData;
+import java.sql.RowId;
 import java.sql.SQLException;
 import java.sql.SQLWarning;
+import java.sql.SQLXML;
 import java.sql.Statement;
 import java.sql.Time;
 import java.sql.Timestamp;
+import java.util.Arrays;
 import java.util.Calendar;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicBoolean;
 
+import org.jboss.logging.Logger;
+
 /**
  * A wrapper for a result set
  * 
  * @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:jesper.pedersne at jboss.org">Jesper Pedersen</a>
  * @version $Revision: 74335 $
  */
 public abstract class WrappedResultSet extends JBossWrapper implements ResultSet
 {
+   /** The spy logger */
+   protected static Logger spyLogger = Logger.getLogger(Constants.SPY_LOGGER_CATEGORY);
+
    /** The wrapped statement */
    private WrappedStatement statement;
 
@@ -58,24 +68,55 @@
 
    /** Whether we are closed */
    private AtomicBoolean closed = new AtomicBoolean(false);
+
+   /** Spy functionality */
+   private boolean spy;
+
+   /** The jndi name */
+   private String jndiName;
    
    /** 
     * Create a new wrapped result set
     * 
     * @param statement the wrapped statement
     * @param resultSet the real result set
+    * @param spy The spy value
+    * @param jndiName The jndi name
     */
-   public WrappedResultSet(WrappedStatement statement, ResultSet resultSet)
+   public WrappedResultSet(WrappedStatement statement, ResultSet resultSet,
+                           boolean spy, String jndiName)
    {
       if (statement == null)
          throw new IllegalArgumentException("Null statement!");
+
       if (resultSet == null)
          throw new IllegalArgumentException("Null result set!");
+
       this.statement = statement;
       this.resultSet = resultSet;
+      this.spy = spy;
+      this.jndiName = jndiName;
    }
 
    /**
+    * Get the spy value
+    * @return The value
+    */
+   public boolean isSpy()
+   {
+      return spy;
+   }
+
+   /**
+    * Get the jndi name value
+    * @return The value
+    */
+   public String getJndiName()
+   {
+      return jndiName;
+   }
+
+   /**
     * {@inheritDoc}
     */
    public ResultSet getUnderlyingResultSet() throws SQLException
@@ -100,6 +141,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] absolute(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             row);
+
          return resultSet.absolute(row);
       }
       catch (Throwable t)
@@ -116,6 +162,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] afterLast()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          resultSet.afterLast();
       }
       catch (Throwable t)
@@ -132,6 +182,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] beforeFirst()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          resultSet.beforeFirst();
       }
       catch (Throwable t)
@@ -148,6 +202,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] cancelRowUpdates()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          resultSet.cancelRowUpdates();
       }
       catch (Throwable t)
@@ -164,6 +222,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] clearWarnings()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          resultSet.clearWarnings();
       }
       catch (Throwable t)
@@ -180,6 +242,10 @@
       if (closed.get())
          return;
  
+      if (isSpy())
+         spyLogger.debugf("%s [%s] close()",
+                          getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
       closed.set(true);
       statement.unregisterResultSet(this);
       internalClose();
@@ -196,6 +262,10 @@
          checkTransaction();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] deleteRow()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
             resultSet.deleteRow();
          }
          catch (Throwable t)
@@ -217,6 +287,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] findColumn(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          return resultSet.findColumn(columnName);
       }
       catch (Throwable t)
@@ -233,6 +308,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] first()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          return resultSet.first();
       }
       catch (Throwable t)
@@ -249,6 +328,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getArray(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             i);
+
          return resultSet.getArray(i);
       }
       catch (Throwable t)
@@ -265,6 +349,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getArray(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             colName);
+
          return resultSet.getArray(colName);
       }
       catch (Throwable t)
@@ -281,6 +370,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getAsciiStream(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
          return resultSet.getAsciiStream(columnIndex);
       }
       catch (Throwable t)
@@ -297,6 +391,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getAsciiStream(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          return resultSet.getAsciiStream(columnName);
       }
       catch (Throwable t)
@@ -313,6 +412,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBigDecimal(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
          return resultSet.getBigDecimal(columnIndex);
       }
       catch (Throwable t)
@@ -330,6 +434,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBigDecimal(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, scale);
+
          return resultSet.getBigDecimal(columnIndex, scale);
       }
       catch (Throwable t)
@@ -346,6 +455,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBigDecimal(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          return resultSet.getBigDecimal(columnName);
       }
       catch (Throwable t)
@@ -363,6 +477,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBigDecimal(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, scale);
+
          return resultSet.getBigDecimal(columnName, scale);
       }
       catch (Throwable t)
@@ -379,6 +498,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBinaryStream(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
          return resultSet.getBinaryStream(columnIndex);
       }
       catch (Throwable t)
@@ -395,6 +519,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBinaryStream(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          return resultSet.getBinaryStream(columnName);
       }
       catch (Throwable t)
@@ -411,6 +540,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBlob(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             i);
+
          return resultSet.getBlob(i);
       }
       catch (Throwable t)
@@ -427,6 +561,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBlob(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             colName);
+
          return resultSet.getBlob(colName);
       }
       catch (Throwable t)
@@ -443,6 +582,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBoolean(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
          return resultSet.getBoolean(columnIndex);
       }
       catch (Throwable t)
@@ -459,6 +603,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBoolean(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          return resultSet.getBoolean(columnName);
       }
       catch (Throwable t)
@@ -475,6 +624,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getByte(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
          return resultSet.getByte(columnIndex);
       }
       catch (Throwable t)
@@ -491,6 +645,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getByte(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          return resultSet.getByte(columnName);
       }
       catch (Throwable t)
@@ -507,6 +666,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBytes(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
          return resultSet.getBytes(columnIndex);
       }
       catch (Throwable t)
@@ -523,6 +687,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getBytes(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          return resultSet.getBytes(columnName);
       }
       catch (Throwable t)
@@ -539,6 +708,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getCharacterStream(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
          return resultSet.getCharacterStream(columnIndex);
       }
       catch (Throwable t)
@@ -555,6 +729,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getCharacterStream(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          return resultSet.getCharacterStream(columnName);
       }
       catch (Throwable t)
@@ -571,6 +750,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getClob(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             i);
+
          return resultSet.getClob(i);
       }
       catch (Throwable t)
@@ -587,6 +771,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getClob(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             colName);
+
          return resultSet.getClob(colName);
       }
       catch (Throwable t)
@@ -603,6 +792,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getConcurrency()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          return resultSet.getConcurrency();
       }
       catch (Throwable t)
@@ -619,6 +812,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getCursorName()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          return resultSet.getCursorName();
       }
       catch (Throwable t)
@@ -635,6 +832,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getDate(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
          return resultSet.getDate(columnIndex);
       }
       catch (Throwable t)
@@ -651,6 +853,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getDate(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, cal);
+
          return resultSet.getDate(columnIndex, cal);
       }
       catch (Throwable t)
@@ -667,6 +874,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getDate(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          return resultSet.getDate(columnName);
       }
       catch (Throwable t)
@@ -683,6 +895,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getDate(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, cal);
+
          return resultSet.getDate(columnName, cal);
       }
       catch (Throwable t)
@@ -699,6 +916,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getDouble(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
          return resultSet.getDouble(columnIndex);
       }
       catch (Throwable t)
@@ -715,6 +937,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getDouble(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          return resultSet.getDouble(columnName);
       }
       catch (Throwable t)
@@ -731,6 +958,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getFetchDirection()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          return resultSet.getFetchDirection();
       }
       catch (Throwable t)
@@ -747,6 +978,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getFetchSize()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          return resultSet.getFetchSize();
       }
       catch (Throwable t)
@@ -763,6 +998,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getFloat(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
          return resultSet.getFloat(columnIndex);
       }
       catch (Throwable t)
@@ -779,6 +1019,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getFloat(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          return resultSet.getFloat(columnName);
       }
       catch (Throwable t)
@@ -795,6 +1040,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getInt(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
          return resultSet.getInt(columnIndex);
       }
       catch (Throwable t)
@@ -811,6 +1061,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getInt(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          return resultSet.getInt(columnName);
       }
       catch (Throwable t)
@@ -827,6 +1082,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getLong(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
          return resultSet.getLong(columnIndex);
       }
       catch (Throwable t)
@@ -843,6 +1103,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getLong(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          return resultSet.getLong(columnName);
       }
       catch (Throwable t)
@@ -859,6 +1124,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getMetaData()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          return resultSet.getMetaData();
       }
       catch (Throwable t)
@@ -875,6 +1144,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getObject(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
          return resultSet.getObject(columnIndex);
       }
       catch (Throwable t)
@@ -892,6 +1166,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getObject(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             i, map);
+
          return resultSet.getObject(i, map);
       }
       catch (Throwable t)
@@ -908,6 +1187,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getObject(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          return resultSet.getObject(columnName);
       }
       catch (Throwable t)
@@ -925,6 +1209,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getObject(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             colName, map);
+
          return resultSet.getObject(colName, map);
       }
       catch (Throwable t)
@@ -941,6 +1230,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getRef(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             i);
+
          return resultSet.getRef(i);
       }
       catch (Throwable t)
@@ -957,6 +1251,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getRef(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             colName);
+
          return resultSet.getRef(colName);
       }
       catch (Throwable t)
@@ -973,6 +1272,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getRow()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          return resultSet.getRow();
       }
       catch (Throwable t)
@@ -989,6 +1292,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getShort(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
          return resultSet.getShort(columnIndex);
       }
       catch (Throwable t)
@@ -1005,6 +1313,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getShort(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          return resultSet.getShort(columnName);
       }
       catch (Throwable t)
@@ -1019,6 +1332,11 @@
    public Statement getStatement() throws SQLException
    {
       checkState();
+
+      if (isSpy())
+         spyLogger.debugf("%s [%s] getStatement()",
+                          getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
       return statement;
    }
 
@@ -1030,6 +1348,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getString(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
          return resultSet.getString(columnIndex);
       }
       catch (Throwable t)
@@ -1046,6 +1369,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getString(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          return resultSet.getString(columnName);
       }
       catch (Throwable t)
@@ -1062,6 +1390,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getTime(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
          return resultSet.getTime(columnIndex);
       }
       catch (Throwable t)
@@ -1078,6 +1411,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getTime(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, cal);
+
          return resultSet.getTime(columnIndex, cal);
       }
       catch (Throwable t)
@@ -1094,6 +1432,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getTime(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          return resultSet.getTime(columnName);
       }
       catch (Throwable t)
@@ -1110,6 +1453,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getTime(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, cal);
+
          return resultSet.getTime(columnName, cal);
       }
       catch (Throwable t)
@@ -1126,6 +1474,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getTimestamp(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
          return resultSet.getTimestamp(columnIndex);
       }
       catch (Throwable t)
@@ -1142,6 +1495,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getTimestamp(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, cal);
+
          return resultSet.getTimestamp(columnIndex, cal);
       }
       catch (Throwable t)
@@ -1158,6 +1516,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getTimestamp(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          return resultSet.getTimestamp(columnName);
       }
       catch (Throwable t)
@@ -1174,6 +1537,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getTimestamp(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, cal);
+
          return resultSet.getTimestamp(columnName, cal);
       }
       catch (Throwable t)
@@ -1190,6 +1558,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getType()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          return resultSet.getType();
       }
       catch (Throwable t)
@@ -1207,6 +1579,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getUnicodeStream(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
          return resultSet.getUnicodeStream(columnIndex);
       }
       catch (Throwable t)
@@ -1223,6 +1600,11 @@
    {
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getUnicodeStream(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          return resultSet.getUnicodeStream(columnName);
       }
       catch (Throwable t)
@@ -1239,6 +1621,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getURL(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
          return resultSet.getURL(columnIndex);
       }
       catch (Throwable t)
@@ -1255,6 +1642,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getURL(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          return resultSet.getURL(columnName);
       }
       catch (Throwable t)
@@ -1271,6 +1663,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getWarnings()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          return resultSet.getWarnings();
       }
       catch (Throwable t)
@@ -1290,6 +1686,10 @@
          checkTransaction();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] insertRow()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
             resultSet.insertRow();
          }
          catch (Throwable t)
@@ -1311,6 +1711,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] isAfterLast()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          return resultSet.isAfterLast();
       }
       catch (Throwable t)
@@ -1327,6 +1731,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] isBeforeFirst()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          return resultSet.isBeforeFirst();
       }
       catch (Throwable t)
@@ -1343,6 +1751,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] isFirst()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          return resultSet.isFirst();
       }
       catch (Throwable t)
@@ -1359,6 +1771,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] isLast()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          return resultSet.isLast();
       }
       catch (Throwable t)
@@ -1375,6 +1791,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] last()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          return resultSet.last();
       }
       catch (Throwable t)
@@ -1391,6 +1811,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] moveToCurrentRow()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          resultSet.moveToCurrentRow();
       }
       catch (Throwable t)
@@ -1407,6 +1831,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] moveToInsertRow()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          resultSet.moveToInsertRow();
       }
       catch (Throwable t)
@@ -1423,6 +1851,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] next()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          return resultSet.next();
       }
       catch (Throwable t)
@@ -1439,6 +1871,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] previous()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          return resultSet.previous();
       }
       catch (Throwable t)
@@ -1455,6 +1891,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] refreshRow()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          resultSet.refreshRow();
       }
       catch (Throwable t)
@@ -1471,6 +1911,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] relative(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             rows);
+
          return resultSet.relative(rows);
       }
       catch (Throwable t)
@@ -1487,6 +1932,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] rowDeleted()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          return resultSet.rowDeleted();
       }
       catch (Throwable t)
@@ -1503,6 +1952,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] rowInserted()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          return resultSet.rowInserted();
       }
       catch (Throwable t)
@@ -1519,6 +1972,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] rowUpdated()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          return resultSet.rowUpdated();
       }
       catch (Throwable t)
@@ -1535,6 +1992,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setFetchDirection(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             direction);
+
          resultSet.setFetchDirection(direction);
       }
       catch (Throwable t)
@@ -1551,6 +2013,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] setFetchSize(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             rows);
+
          resultSet.setFetchSize(rows);
       }
       catch (Throwable t)
@@ -1567,6 +2034,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateArray(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
          resultSet.updateArray(columnIndex, x);
       }
       catch (Throwable t)
@@ -1583,6 +2055,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateArray(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, x);
+
          resultSet.updateArray(columnName, x);
       }
       catch (Throwable t)
@@ -1599,6 +2076,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateAsciiStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x, length);
+
          resultSet.updateAsciiStream(columnIndex, x, length);
       }
       catch (Throwable t)
@@ -1615,6 +2097,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateAsciiStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, x, length);
+
          resultSet.updateAsciiStream(columnName, x, length);
       }
       catch (Throwable t)
@@ -1631,6 +2118,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateBigDecimal(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
          resultSet.updateBigDecimal(columnIndex, x);
       }
       catch (Throwable t)
@@ -1647,6 +2139,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateBigDecimal(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, x);
+
          resultSet.updateBigDecimal(columnName, x);
       }
       catch (Throwable t)
@@ -1663,6 +2160,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateBinaryStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x, length);
+
          resultSet.updateBinaryStream(columnIndex, x, length);
       }
       catch (Throwable t)
@@ -1679,6 +2181,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateBinaryStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, x, length);
+
          resultSet.updateBinaryStream(columnName, x, length);
       }
       catch (Throwable t)
@@ -1695,6 +2202,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateBlob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
          resultSet.updateBlob(columnIndex, x);
       }
       catch (Throwable t)
@@ -1711,6 +2223,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateBlob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, x);
+
          resultSet.updateBlob(columnName, x);
       }
       catch (Throwable t)
@@ -1727,6 +2244,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateBoolean(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
          resultSet.updateBoolean(columnIndex, x);
       }
       catch (Throwable t)
@@ -1743,6 +2265,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateBoolean(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, x);
+
          resultSet.updateBoolean(columnName, x);
       }
       catch (Throwable t)
@@ -1759,6 +2286,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateByte(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
          resultSet.updateByte(columnIndex, x);
       }
       catch (Throwable t)
@@ -1775,6 +2307,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateByte(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, x);
+
          resultSet.updateByte(columnName, x);
       }
       catch (Throwable t)
@@ -1791,6 +2328,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateBytes(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, Arrays.toString(x));
+
          resultSet.updateBytes(columnIndex, x);
       }
       catch (Throwable t)
@@ -1807,6 +2349,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateBytes(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, Arrays.toString(x));
+
          resultSet.updateBytes(columnName, x);
       }
       catch (Throwable t)
@@ -1823,6 +2370,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateCharacterStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x, length);
+
          resultSet.updateCharacterStream(columnIndex, x, length);
       }
       catch (Throwable t)
@@ -1839,6 +2391,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateCharacterStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, reader, length);
+
          resultSet.updateCharacterStream(columnName, reader, length);
       }
       catch (Throwable t)
@@ -1855,6 +2412,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateClob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
          resultSet.updateClob(columnIndex, x);
       }
       catch (Throwable t)
@@ -1871,6 +2433,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateClob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, x);
+
          resultSet.updateClob(columnName, x);
       }
       catch (Throwable t)
@@ -1887,6 +2454,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateDate(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
          resultSet.updateDate(columnIndex, x);
       }
       catch (Throwable t)
@@ -1903,6 +2475,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateDate(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, x);
+
          resultSet.updateDate(columnName, x);
       }
       catch (Throwable t)
@@ -1919,6 +2496,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateDouble(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
          resultSet.updateDouble(columnIndex, x);
       }
       catch (Throwable t)
@@ -1935,6 +2517,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateDouble(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, x);
+
          resultSet.updateDouble(columnName, x);
       }
       catch (Throwable t)
@@ -1951,6 +2538,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateFloat(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
          resultSet.updateFloat(columnIndex, x);
       }
       catch (Throwable t)
@@ -1967,6 +2559,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateFloat(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, x);
+
          resultSet.updateFloat(columnName, x);
       }
       catch (Throwable t)
@@ -1983,6 +2580,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateInt(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
          resultSet.updateInt(columnIndex, x);
       }
       catch (Throwable t)
@@ -1999,6 +2601,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateInt(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, x);
+
          resultSet.updateInt(columnName, x);
       }
       catch (Throwable t)
@@ -2015,6 +2622,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateLong(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
          resultSet.updateLong(columnIndex, x);
       }
       catch (Throwable t)
@@ -2031,6 +2643,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateLong(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, x);
+
          resultSet.updateLong(columnName, x);
       }
       catch (Throwable t)
@@ -2047,6 +2664,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateNull(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
          resultSet.updateNull(columnIndex);
       }
       catch (Throwable t)
@@ -2063,6 +2685,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateNull(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName);
+
          resultSet.updateNull(columnName);
       }
       catch (Throwable t)
@@ -2079,6 +2706,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateObject(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
          resultSet.updateObject(columnIndex, x);
       }
       catch (Throwable t)
@@ -2095,6 +2727,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateObject(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x, scale);
+
          resultSet.updateObject(columnIndex, x, scale);
       }
       catch (Throwable t)
@@ -2111,6 +2748,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateObject(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, x);
+
          resultSet.updateObject(columnName, x);
       }
       catch (Throwable t)
@@ -2127,6 +2769,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateObject(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, x, scale);
+
          resultSet.updateObject(columnName, x, scale);
       }
       catch (Throwable t)
@@ -2143,6 +2790,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateRef(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
          resultSet.updateRef(columnIndex, x);
       }
       catch (Throwable t)
@@ -2159,6 +2811,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateRef(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, x);
+
          resultSet.updateRef(columnName, x);
       }
       catch (Throwable t)
@@ -2178,6 +2835,10 @@
          checkTransaction();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] updateRow()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
             resultSet.updateRow();
          }
          catch (Throwable t)
@@ -2215,6 +2876,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateShort(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, x);
+
          resultSet.updateShort(columnName, x);
       }
       catch (Throwable t)
@@ -2231,6 +2897,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateString(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
          resultSet.updateString(columnIndex, x);
       }
       catch (Throwable t)
@@ -2247,6 +2918,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateString(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, x);
+
          resultSet.updateString(columnName, x);
       }
       catch (Throwable t)
@@ -2263,6 +2939,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateTime(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
          resultSet.updateTime(columnIndex, x);
       }
       catch (Throwable t)
@@ -2279,6 +2960,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateTime(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, x);
+
          resultSet.updateTime(columnName, x);
       }
       catch (Throwable t)
@@ -2295,6 +2981,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateTimestamp(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
          resultSet.updateTimestamp(columnIndex, x);
       }
       catch (Throwable t)
@@ -2311,6 +3002,11 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateTimestamp(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnName, x);
+
          resultSet.updateTimestamp(columnName, x);
       }
       catch (Throwable t)
@@ -2327,6 +3023,10 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] wasNull()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
          return resultSet.wasNull();
       }
       catch (Throwable t)
@@ -2338,6 +3038,1014 @@
    /**
     * {@inheritDoc}
     */
+   public int getHoldability() throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getHoldability()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+
+         return resultSet.getHoldability();
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public Reader getNCharacterStream(int columnIndex) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getNCharacterStream(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
+         return resultSet.getNCharacterStream(columnIndex);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public Reader getNCharacterStream(String columnLabel) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getNCharacterStream(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel);
+
+         return resultSet.getNCharacterStream(columnLabel);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public NClob getNClob(int columnIndex) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getNClob(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
+         return resultSet.getNClob(columnIndex);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public NClob getNClob(String columnLabel) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getNClob(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel);
+
+         return resultSet.getNClob(columnLabel);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public String getNString(int columnIndex) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getNString(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
+         return resultSet.getNString(columnIndex);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public String getNString(String columnLabel) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getNString(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel);
+
+         return resultSet.getNString(columnLabel);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public RowId getRowId(int columnIndex) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getRowId(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
+         return resultSet.getRowId(columnIndex);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public RowId getRowId(String columnLabel) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getRowId(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel);
+
+         return resultSet.getRowId(columnLabel);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public SQLXML getSQLXML(int columnIndex) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getSQLXML(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex);
+
+         return resultSet.getSQLXML(columnIndex);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public SQLXML getSQLXML(String columnLabel) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getSQLXML(%s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel);
+
+         return resultSet.getSQLXML(columnLabel);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public boolean isClosed() throws SQLException
+   {
+      if (isSpy())
+         spyLogger.debugf("%s [%s] isClosed()",
+                          getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET);
+      
+      ResultSet resultSet = getWrappedObject();
+      if (resultSet == null)
+         return true;
+      try
+      {
+         return resultSet.isClosed();
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateAsciiStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x, length);
+
+         resultSet.updateAsciiStream(columnIndex, x, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateAsciiStream(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
+         resultSet.updateAsciiStream(columnIndex, x);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateAsciiStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel, x, length);
+
+         resultSet.updateAsciiStream(columnLabel, x, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateAsciiStream(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel, x);
+
+         resultSet.updateAsciiStream(columnLabel, x);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateBinaryStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x, length);
+
+         resultSet.updateBinaryStream(columnIndex, x, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateBinaryStream(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
+         resultSet.updateBinaryStream(columnIndex, x);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateBinaryStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel, x, length);
+
+         resultSet.updateBinaryStream(columnLabel, x, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateBinaryStream(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel, x);
+
+         resultSet.updateBinaryStream(columnLabel, x);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateBlob(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, inputStream, length);
+
+         resultSet.updateBlob(columnIndex, inputStream, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateBlob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, inputStream);
+
+         resultSet.updateBlob(columnIndex, inputStream);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateBlob(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel, inputStream, length);
+
+         resultSet.updateBlob(columnLabel, inputStream, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateBlob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel, inputStream);
+
+         resultSet.updateBlob(columnLabel, inputStream);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateCharacterStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x, length);
+
+         resultSet.updateCharacterStream(columnIndex, x, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateCharacterStream(int columnIndex, Reader x) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateCharacterStream(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
+         resultSet.updateCharacterStream(columnIndex, x);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateCharacterStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel, reader, length);
+
+         resultSet.updateCharacterStream(columnLabel, reader, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateCharacterStream(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel, reader);
+
+         resultSet.updateCharacterStream(columnLabel, reader);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateClob(int columnIndex, Reader reader, long length) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateClob(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, reader, length);
+
+         resultSet.updateClob(columnIndex, reader, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateClob(int columnIndex, Reader reader) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateClob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, reader);
+
+         resultSet.updateClob(columnIndex, reader);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateClob(String columnLabel, Reader reader, long length) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateClob(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel, reader, length);
+
+         resultSet.updateClob(columnLabel, reader, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateClob(String columnLabel, Reader reader) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateClob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel, reader);
+
+         resultSet.updateClob(columnLabel, reader);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateNCharacterStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x, length);
+
+         resultSet.updateNCharacterStream(columnIndex, x, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateNCharacterStream(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
+         resultSet.updateNCharacterStream(columnIndex, x);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateNCharacterStream(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel, reader, length);
+
+         resultSet.updateNCharacterStream(columnLabel, reader, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateNCharacterStream(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel, reader);
+
+         resultSet.updateNCharacterStream(columnLabel, reader);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateNClob(int columnIndex, NClob clob) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateNClob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, clob);
+
+         resultSet.updateNClob(columnIndex, clob);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateNClob(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, reader, length);
+
+         resultSet.updateNClob(columnIndex, reader, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateNClob(int columnIndex, Reader reader) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateNClob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, reader);
+
+         resultSet.updateNClob(columnIndex, reader);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateNClob(String columnLabel, NClob clob) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateNClob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel, clob);
+
+         resultSet.updateNClob(columnLabel, clob);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateNClob(%s, %s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel, reader, length);
+
+         resultSet.updateNClob(columnLabel, reader, length);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateNClob(String columnLabel, Reader reader) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateNClob(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel, reader);
+
+         resultSet.updateNClob(columnLabel, reader);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateNString(int columnIndex, String string) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateNString(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, string);
+
+         resultSet.updateNString(columnIndex, string);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateNString(String columnLabel, String string) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateNString(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel, string);
+
+         resultSet.updateNString(columnLabel, string);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateRowId(int columnIndex, RowId x) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateRowId(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, x);
+
+         resultSet.updateRowId(columnIndex, x);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateRowId(String columnLabel, RowId x) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateRowId(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel, x);
+
+         resultSet.updateRowId(columnLabel, x);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateSQLXML(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnIndex, xmlObject);
+
+         resultSet.updateSQLXML(columnIndex, xmlObject);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException
+   {
+      ResultSet resultSet = getUnderlyingResultSet();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] updateSQLXML(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             columnLabel, xmlObject);
+
+         resultSet.updateSQLXML(columnLabel, xmlObject);
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
    protected ResultSet getWrappedObject() throws SQLException
    {
       return getUnderlyingResultSet();

Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedStatement.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedStatement.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrappedStatement.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -27,20 +27,26 @@
 import java.sql.SQLException;
 import java.sql.SQLWarning;
 import java.sql.Statement;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicBoolean;
 
+import org.jboss.logging.Logger;
+
 /**
  * A wrapper for a statement.
  *
  * @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:jesper.pedersen at jboss.org">Jesper Pedersen</a>
  * @version $Revision: 74335 $
  */
 public abstract class WrappedStatement extends JBossWrapper implements Statement, StatementAccess
 {
+   /** The spy logger */
+   protected static Logger spyLogger = Logger.getLogger(Constants.SPY_LOGGER_CATEGORY);
    private final WrappedConnection lc;
    private final Statement s;
 
@@ -50,15 +56,25 @@
    /** Whether we are closed */
    private AtomicBoolean closed = new AtomicBoolean(false);
 
+   /** Spy functionality */
+   private boolean spy;
+
+   /** The jndi name */
+   private String jndiName;
+
    /**
     * Constructor
     * @param lc The connection
     * @param s The statement
+    * @param spy The spy value
+    * @param jndiName The jndi name
     */
-   public WrappedStatement(final WrappedConnection lc, Statement s)
+   public WrappedStatement(final WrappedConnection lc, Statement s, boolean spy, String jndiName)
    {
       this.lc = lc;
       this.s = s;
+      this.spy = spy;
+      this.jndiName = jndiName;
       lc.registerStatement(this);
    }
 
@@ -80,12 +96,33 @@
    }
 
    /**
+    * Get the spy value
+    * @return The value
+    */
+   public boolean isSpy()
+   {
+      return spy;
+   }
+
+   /**
+    * Get the jndi name
+    * @return The value
+    */
+   public String getJndiName()
+   {
+      return jndiName;
+   }
+
+   /**
     * {@inheritDoc}
     */
    public void close() throws SQLException
    {
       if (closed.get())
          return;
+
+      if (isSpy())
+         spyLogger.debugf("%s [%s] close()", getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
          
       closed.set(true);
       lc.unregisterStatement(this);
@@ -104,6 +141,10 @@
          try
          {
             checkConfiguredQueryTimeout();
+
+            if (isSpy())
+               spyLogger.debugf("%s [%s] execute(%s)", getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT, sql);
+         
             return s.execute(sql);
          }
          catch (Throwable t)
@@ -129,6 +170,11 @@
          try
          {
             checkConfiguredQueryTimeout();
+
+            if (isSpy())
+               spyLogger.debugf("%s [%s] execute(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT, sql, autoGeneratedKeys);
+         
             return s.execute(sql, autoGeneratedKeys);
          }
          catch (Throwable t)
@@ -154,6 +200,12 @@
          try
          {
             checkConfiguredQueryTimeout();
+
+            if (isSpy())
+               spyLogger.debugf("%s [%s] execute(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT,
+                                sql, Arrays.toString(columnIndexes));
+         
             return s.execute(sql, columnIndexes);
          }
          catch (Throwable t)
@@ -179,6 +231,12 @@
          try
          {
             checkConfiguredQueryTimeout();
+
+            if (isSpy())
+               spyLogger.debugf("%s [%s] execute(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT,
+                                sql, Arrays.toString(columnNames));
+         
             return s.execute(sql, columnNames);
          }
          catch (Throwable t)
@@ -197,6 +255,9 @@
     */
    public Connection getConnection() throws SQLException
    {
+      if (isSpy())
+         spyLogger.debugf("%s [%s] getConnection()", getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+         
       return lc;
    }
 
@@ -211,6 +272,9 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getWarnings()", getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+         
             return s.getWarnings();
          }
          catch (Throwable t)
@@ -235,6 +299,9 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] clearWarnings()", getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+         
             s.clearWarnings();
          }
          catch (Throwable t)
@@ -260,6 +327,11 @@
          try
          {
             checkConfiguredQueryTimeout();
+
+            if (isSpy())
+               spyLogger.debugf("%s [%s] executeQuery(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT, sql);
+         
             ResultSet result = s.executeQuery(sql);
             return registerResultSet(result);
          }
@@ -286,6 +358,11 @@
          try
          {
             checkConfiguredQueryTimeout();
+
+            if (isSpy())
+               spyLogger.debugf("%s [%s] executeUpdate(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT, sql);
+         
             return s.executeUpdate(sql);
          }
          catch (Throwable t)
@@ -311,6 +388,11 @@
          try
          {
             checkConfiguredQueryTimeout();
+
+            if (isSpy())
+               spyLogger.debugf("%s [%s] executeUpdate(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT, sql, autoGeneratedKeys);
+         
             return s.executeUpdate(sql, autoGeneratedKeys);
          }
          catch (Throwable t)
@@ -336,6 +418,12 @@
          try
          {
             checkConfiguredQueryTimeout();
+
+            if (isSpy())
+               spyLogger.debugf("%s [%s] executeUpdate(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT,
+                                sql, Arrays.toString(columnIndexes));
+         
             return s.executeUpdate(sql, columnIndexes);
          }
          catch (Throwable t)
@@ -361,6 +449,12 @@
          try
          {
             checkConfiguredQueryTimeout();
+
+            if (isSpy())
+               spyLogger.debugf("%s [%s] executeUpdate(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT,
+                                sql, Arrays.toString(columnNames));
+         
             return s.executeUpdate(sql, columnNames);
          }
          catch (Throwable t)
@@ -385,6 +479,10 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getMaxFieldSize()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+         
             return s.getMaxFieldSize();
          }
          catch (Throwable t)
@@ -409,6 +507,10 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setMaxFieldSize(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT, max);
+         
             s.setMaxFieldSize(max);
          }
          catch (Throwable t)
@@ -433,6 +535,9 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getMaxRows()", getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+         
             return s.getMaxRows();
          }
          catch (Throwable t)
@@ -457,6 +562,10 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setMaxRows(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT, max);
+         
             s.setMaxRows(max);
          }
          catch (Throwable t)
@@ -481,6 +590,10 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setEscapeProcessing(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT, enable);
+         
             s.setEscapeProcessing(enable);
          }
          catch (Throwable t)
@@ -505,6 +618,9 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getQueryTimeout()", getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+         
             return s.getQueryTimeout();
          }
          catch (Throwable t)
@@ -529,6 +645,10 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setQueryTimeout(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT, timeout);
+         
             s.setQueryTimeout(timeout);
          }
          catch (Throwable t)
@@ -550,6 +670,9 @@
       checkState();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] cancel()", getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+         
          s.cancel();
       }
       catch (Throwable t)
@@ -569,6 +692,10 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setCursorName(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT, name);
+         
             s.setCursorName(name);
          }
          catch (Throwable t)
@@ -593,6 +720,9 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getResultSet()", getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+         
             ResultSet result = s.getResultSet();
             if (result == null)
                return null;
@@ -621,6 +751,9 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getUpdateCount()", getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+         
             return s.getUpdateCount();
          }
          catch (Throwable t)
@@ -645,6 +778,10 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getMoreResults()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+         
             return s.getMoreResults();
          }
          catch (Throwable t)
@@ -669,6 +806,10 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getMoreResults(%s)", 
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT, current);
+         
             return s.getMoreResults(current);
          }
          catch (Throwable t)
@@ -693,6 +834,10 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setFetchDirection(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT, direction);
+         
             s.setFetchDirection(direction);
          }
          catch (Throwable t)
@@ -717,6 +862,10 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getFetchDirection()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+         
             return s.getFetchDirection();
          }
          catch (Throwable t)
@@ -741,6 +890,10 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setFetchSize(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT, rows);
+         
             s.setFetchSize(rows);
          }
          catch (Throwable t)
@@ -765,6 +918,10 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getFetchSize()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+         
             return s.getFetchSize();
          }
          catch (Throwable t)
@@ -789,6 +946,10 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getResultSetConcurrency()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+         
             return s.getResultSetConcurrency();
          }
          catch (Throwable t)
@@ -813,6 +974,10 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getResultSetType()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+         
             return s.getResultSetType();
          }
          catch (Throwable t)
@@ -837,6 +1002,10 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] addBatch(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT, sql);
+         
             s.addBatch(sql);
          }
          catch (Throwable t)
@@ -861,6 +1030,10 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] clearBatch()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+         
             s.clearBatch();
          }
          catch (Throwable t)
@@ -886,6 +1059,11 @@
          try
          {
             checkConfiguredQueryTimeout();
+
+            if (isSpy())
+               spyLogger.debugf("%s [%s] executeBatch()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+         
             return s.executeBatch();
          }
          catch (Throwable t)
@@ -910,6 +1088,10 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getGeneratedKeys()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+         
             ResultSet resultSet = s.getGeneratedKeys();
             return registerResultSet(resultSet);
          }
@@ -935,6 +1117,10 @@
          checkState();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getResultSetHoldability()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+         
             return s.getResultSetHoldability();
          }
          catch (Throwable t)
@@ -951,6 +1137,90 @@
    /**
     * {@inheritDoc}
     */
+   public boolean isClosed() throws SQLException
+   {
+      lock();
+      try
+      {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] isClosed()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+
+         Statement wrapped = getWrappedObject();
+         if (wrapped == null)
+            return true;
+         return wrapped.isClosed();
+      }
+      catch (Throwable t)
+      {
+         throw checkException(t);
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public boolean isPoolable() throws SQLException
+   {
+      lock();
+      try
+      {
+         Statement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] isPoolable()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+
+            return statement.isPoolable();
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setPoolable(boolean poolable) throws SQLException
+   {
+      lock();
+      try
+      {
+         Statement statement = getUnderlyingStatement();
+         try
+         {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setPoolable(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT,
+                                poolable);
+
+            statement.setPoolable(poolable);
+         }
+         catch (Throwable t)
+         {
+            throw checkException(t);
+         }
+      }
+      finally
+      {
+         unlock();
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
    public Statement getUnderlyingStatement() throws SQLException
    {
       lock();
@@ -1046,9 +1316,11 @@
    /**
     * Wrap the result set
     * @param resultSet The result set
+    * @param spy The spy value
+    * @param jndiName The jndi name
     * @return The result
     */
-   protected abstract WrappedResultSet wrapResultSet(ResultSet resultSet);
+   protected abstract WrappedResultSet wrapResultSet(ResultSet resultSet, boolean spy, String jndiName);
    
    /**
     * Register a result set
@@ -1058,7 +1330,7 @@
    protected ResultSet registerResultSet(ResultSet resultSet)
    {
       if (resultSet != null)
-         resultSet = wrapResultSet(resultSet);
+         resultSet = wrapResultSet(resultSet, isSpy(), getJndiName());
       
       if (lc.getTrackStatements() == BaseWrapperManagedConnectionFactory.TRACK_STATEMENTS_FALSE_INT)
          return resultSet;

Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrapperDataSource.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrapperDataSource.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/WrapperDataSource.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -38,6 +38,7 @@
 import javax.sql.DataSource;
 import javax.transaction.RollbackException;
 
+import org.jboss.logging.Logger;
 import org.jboss.tm.TransactionTimeoutConfiguration;
 
 /**
@@ -51,6 +52,8 @@
 {
    private static final long serialVersionUID = 3570285419164793501L;
 
+   private static Logger spyLogger = Logger.getLogger(Constants.SPY_LOGGER_CATEGORY);
+
    private final BaseWrapperManagedConnectionFactory mcf;
    private final ConnectionManager cm;
 
@@ -116,6 +119,8 @@
       {
          WrappedConnection wc = (WrappedConnection) cm.allocateConnection(mcf, null);
          wc.setDataSource(this);
+         wc.setSpy(mcf.getSpy().booleanValue());
+         wc.setJndiName(mcf.getJndiName());
          return wc;
       }
       catch (ResourceException re)
@@ -134,6 +139,8 @@
       {
          WrappedConnection wc = (WrappedConnection) cm.allocateConnection(mcf, cri);
          wc.setDataSource(this);
+         wc.setSpy(mcf.getSpy().booleanValue());
+         wc.setJndiName(mcf.getJndiName());
          return wc;
       }
       catch (ResourceException re)

Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedCallableStatementJDK6.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedCallableStatementJDK6.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedCallableStatementJDK6.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -25,22 +25,14 @@
 import org.jboss.jca.adapters.jdbc.WrappedCallableStatement;
 import org.jboss.jca.adapters.jdbc.WrappedResultSet;
 
-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;
 
 /**
  * WrappedCallableStatementJDK6.
  * 
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
  * @version $Revision: 85945 $
  */
 public class WrappedCallableStatementJDK6 extends WrappedCallableStatement
@@ -51,869 +43,24 @@
     * Constructor
     * @param lc The connection
     * @param s The statement
+    * @param spy The spy value
+    * @param jndiName The jndi name
     */
-   public WrappedCallableStatementJDK6(WrappedConnectionJDK6 lc, CallableStatement s)
+   public WrappedCallableStatementJDK6(WrappedConnectionJDK6 lc, CallableStatement s,
+                                       boolean spy, String jndiName)
    {
-      super(lc, s);
+      super(lc, s, spy, jndiName);
    }
    
    /**
     * Wrap result set
     * @param resultSet The result set
+    * @param spy The spy value
+    * @param jndiName The jndi name
     * @return The result
     */
-   protected WrappedResultSet wrapResultSet(ResultSet resultSet)
+   protected WrappedResultSet wrapResultSet(ResultSet resultSet, boolean spy, String jndiName)
    {
-      return new WrappedResultSetJDK6(this, resultSet);
+      return new WrappedResultSetJDK6(this, resultSet, spy, jndiName);
    }
-
-   /**
-    * {@inheritDoc}
-    */
-   public boolean isClosed() throws SQLException
-   {
-      try
-      {
-         PreparedStatement wrapped = getWrappedObject();
-         if (wrapped == null)
-            return true;
-         return wrapped.isClosed();
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public boolean isPoolable() throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.isPoolable();
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setPoolable(boolean poolable) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setPoolable(poolable);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setAsciiStream(parameterIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setBinaryStream(parameterIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setBlob(parameterIndex, inputStream);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setCharacterStream(parameterIndex, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setClob(int parameterIndex, Reader reader) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setClob(parameterIndex, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNCharacterStream(parameterIndex, value);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setNClob(int parameterIndex, NClob value) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNClob(parameterIndex, value);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setNClob(int parameterIndex, Reader reader) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNClob(parameterIndex, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setNString(int parameterIndex, String value) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNString(parameterIndex, value);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setRowId(int parameterIndex, RowId x) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setRowId(parameterIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setSQLXML(parameterIndex, xmlObject);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public Reader getCharacterStream(int parameterIndex) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getCharacterStream(parameterIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public Reader getCharacterStream(String parameterName) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getCharacterStream(parameterName);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public Reader getNCharacterStream(int parameterIndex) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getNCharacterStream(parameterIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public Reader getNCharacterStream(String parameterName) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getCharacterStream(parameterName);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public NClob getNClob(int parameterIndex) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getNClob(parameterIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public NClob getNClob(String parameterName) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getNClob(parameterName);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public String getNString(int parameterIndex) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getNString(parameterIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public String getNString(String parameterName) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getNString(parameterName);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public RowId getRowId(int parameterIndex) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getRowId(parameterIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public RowId getRowId(String parameterName) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getRowId(parameterName);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public SQLXML getSQLXML(int parameterIndex) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getSQLXML(parameterIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public SQLXML getSQLXML(String parameterName) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getSQLXML(parameterName);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setAsciiStream(String parameterName, InputStream x) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setAsciiStream(parameterName, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setBinaryStream(String parameterName, InputStream x) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setBinaryStream(parameterName, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setBlob(String parameterName, Blob x) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setBlob(parameterName, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setBlob(String parameterName, InputStream inputStream) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setBlob(parameterName, inputStream);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setCharacterStream(String parameterName, Reader reader) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setCharacterStream(parameterName, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setClob(String parameterName, Clob x) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setClob(parameterName, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setClob(String parameterName, Reader reader) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setClob(parameterName, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setNCharacterStream(String parameterName, Reader value) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNCharacterStream(parameterName, value);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setNClob(String parameterName, NClob value) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNClob(parameterName, value);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setNClob(String parameterName, Reader reader) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNClob(parameterName, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setNString(String parameterName, String value) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNString(parameterName, value);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setRowId(String parameterName, RowId x) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setRowId(parameterName, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setSQLXML(parameterName, xmlObject);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
 }

Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedConnectionFactoryJDK6.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedConnectionFactoryJDK6.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedConnectionFactoryJDK6.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -50,11 +50,13 @@
    /**
     * Wrap connection
     * @param mc The managed connection
+    * @param spy The spy value
+    * @param jndiName The jndi name
     * @return The result
     */
-   public WrappedConnection createWrappedConnection(BaseWrapperManagedConnection mc)
+   public WrappedConnection createWrappedConnection(BaseWrapperManagedConnection mc, boolean spy, String jndiName)
    {
-      return new WrappedConnectionJDK6(mc);
+      return new WrappedConnectionJDK6(mc, spy, jndiName);
    }
 
    /**

Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedConnectionJDK6.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedConnectionJDK6.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedConnectionJDK6.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -28,19 +28,9 @@
 import org.jboss.jca.adapters.jdbc.WrappedPreparedStatement;
 import org.jboss.jca.adapters.jdbc.WrappedStatement;
 
-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;
 
 /**
  * WrappedConnectionJDK6.
@@ -57,341 +47,47 @@
     * Create a new WrappedConnectionJDK6.
     * 
     * @param mc the managed connection
+    * @param spy The spy value
+    * @param jndiName The jndi name
     */
-   public WrappedConnectionJDK6(BaseWrapperManagedConnection mc)
+   public WrappedConnectionJDK6(BaseWrapperManagedConnection mc, boolean spy, String jndiName)
    {
-      super(mc);
+      super(mc, spy, jndiName);
    }
 
    /**
     * Wrap statement
     * @param statement The statement
+    * @param spy The spy value
+    * @param jndiName The jndi name
     * @return The result
     */
-   protected WrappedStatement wrapStatement(Statement statement)
+   protected WrappedStatement wrapStatement(Statement statement, boolean spy, String jndiName)
    {
-      return new WrappedStatementJDK6(this, statement);
+      return new WrappedStatementJDK6(this, statement, spy, jndiName);
    }
 
    /**
     * Wrap prepared statement
     * @param statement The statement
+    * @param spy The spy value
+    * @param jndiName The jndi name
     * @return The result
     */
-   protected WrappedPreparedStatement wrapPreparedStatement(PreparedStatement statement)
+   protected WrappedPreparedStatement wrapPreparedStatement(PreparedStatement statement, boolean spy, String jndiName)
    {
-      return new WrappedPreparedStatementJDK6(this, statement);
+      return new WrappedPreparedStatementJDK6(this, statement, spy, jndiName);
    }
 
    /**
     * Wrap callable statement
     * @param statement The statement
+    * @param spy The spy value
+    * @param jndiName The jndi name
     * @return The result
     */
-   protected WrappedCallableStatement wrapCallableStatement(CallableStatement statement)
+   protected WrappedCallableStatement wrapCallableStatement(CallableStatement statement, boolean spy, String jndiName)
    {
-      return new WrappedCallableStatementJDK6(this, statement);
+      return new WrappedCallableStatementJDK6(this, statement, spy, jndiName);
    }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public Blob createBlob() throws SQLException
-   {
-      lock();
-      try
-      {
-         Connection c = getUnderlyingConnection();
-         try
-         {
-            return c.createBlob();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public Clob createClob() throws SQLException
-   {
-      lock();
-      try
-      {
-         Connection c = getUnderlyingConnection();
-         try
-         {
-            return c.createClob();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public NClob createNClob() throws SQLException
-   {
-      lock();
-      try
-      {
-         Connection c = getUnderlyingConnection();
-         try
-         {
-            return c.createNClob();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public SQLXML createSQLXML() throws SQLException
-   {
-      lock();
-      try
-      {
-         Connection c = getUnderlyingConnection();
-         try
-         {
-            return c.createSQLXML();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public Properties getClientInfo() throws SQLException
-   {
-      lock();
-      try
-      {
-         Connection c = getUnderlyingConnection();
-         try
-         {
-            return c.getClientInfo();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
 }

Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedPreparedStatementJDK6.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedPreparedStatementJDK6.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedPreparedStatementJDK6.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -25,19 +25,14 @@
 import org.jboss.jca.adapters.jdbc.WrappedPreparedStatement;
 import org.jboss.jca.adapters.jdbc.WrappedResultSet;
 
-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;
 
 /**
  * WrappedPreparedStatementJDK6.
  * 
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
  * @version $Revision: 85945 $
  */
 public class WrappedPreparedStatementJDK6 extends WrappedPreparedStatement
@@ -48,522 +43,24 @@
     * Constructor
     * @param lc The connection
     * @param s The prepared statement
+    * @param spy The spy value
+    * @param jndiName The jndi name
     */
-   public WrappedPreparedStatementJDK6(WrappedConnectionJDK6 lc, PreparedStatement s)
+   public WrappedPreparedStatementJDK6(WrappedConnectionJDK6 lc, PreparedStatement s,
+                                       boolean spy, String jndiName)
    {
-      super(lc, s);
+      super(lc, s, spy, jndiName);
    }
    
    /**
     * Wrap the result set
     * @param resultSet The result set
+    * @param spy The spy value
+    * @param jndiName The jndi name
     * @return The result
     */
-   protected WrappedResultSet wrapResultSet(ResultSet resultSet)
+   protected WrappedResultSet wrapResultSet(ResultSet resultSet, boolean spy, String jndiName)
    {
-      return new WrappedResultSetJDK6(this, resultSet);
+      return new WrappedResultSetJDK6(this, resultSet, spy, jndiName);
    }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public boolean isPoolable() throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            return statement.isPoolable();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setPoolable(boolean poolable) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setPoolable(poolable);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
 }

Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedResultSetJDK6.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedResultSetJDK6.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedResultSetJDK6.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -25,18 +25,13 @@
 import org.jboss.jca.adapters.jdbc.WrappedResultSet;
 import org.jboss.jca.adapters.jdbc.WrappedStatement;
 
-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;
 
 /**
  * WrappedResultSetJDK6.
  * 
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
  * @version $Revision: 85945 $
  */
 public class WrappedResultSetJDK6 extends WrappedResultSet
@@ -47,779 +42,12 @@
     * Constructor
     * @param statement The statement
     * @param resultSet The result set
+    * @param spy The spy value
+    * @param jndiName The jndi name
     */
-   public WrappedResultSetJDK6(WrappedStatement statement, ResultSet resultSet)
+   public WrappedResultSetJDK6(WrappedStatement statement, ResultSet resultSet,
+                               boolean spy, String jndiName)
    {
-      super(statement, resultSet);
+      super(statement, resultSet, spy, jndiName);
    }
-
-   /**
-    * {@inheritDoc}
-    */
-   public int getHoldability() throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getHoldability();
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public Reader getNCharacterStream(int columnIndex) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getNCharacterStream(columnIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public Reader getNCharacterStream(String columnLabel) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getNCharacterStream(columnLabel);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public NClob getNClob(int columnIndex) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getNClob(columnIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public NClob getNClob(String columnLabel) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getNClob(columnLabel);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public String getNString(int columnIndex) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getNString(columnIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public String getNString(String columnLabel) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getNString(columnLabel);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public RowId getRowId(int columnIndex) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getRowId(columnIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public RowId getRowId(String columnLabel) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getRowId(columnLabel);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public SQLXML getSQLXML(int columnIndex) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getSQLXML(columnIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public SQLXML getSQLXML(String columnLabel) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getSQLXML(columnLabel);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public boolean isClosed() throws SQLException
-   {
-      ResultSet resultSet = getWrappedObject();
-      if (resultSet == null)
-         return true;
-      try
-      {
-         return resultSet.isClosed();
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateAsciiStream(columnIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateAsciiStream(columnLabel, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateBinaryStream(columnIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateBinaryStream(columnLabel, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateBlob(columnIndex, inputStream);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateBlob(columnLabel, inputStream);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateCharacterStream(int columnIndex, Reader x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateCharacterStream(columnIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateCharacterStream(columnLabel, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateClob(int columnIndex, Reader reader) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateClob(columnIndex, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateClob(String columnLabel, Reader reader) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateClob(columnLabel, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNCharacterStream(columnIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNCharacterStream(columnLabel, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateNClob(int columnIndex, NClob clob) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNClob(columnIndex, clob);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateNClob(int columnIndex, Reader reader) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNClob(columnIndex, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateNClob(String columnLabel, NClob clob) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNClob(columnLabel, clob);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateNClob(String columnLabel, Reader reader) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNClob(columnLabel, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateNString(int columnIndex, String string) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNString(columnIndex, string);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateNString(String columnLabel, String string) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNString(columnLabel, string);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateRowId(int columnIndex, RowId x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateRowId(columnIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateRowId(String columnLabel, RowId x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateRowId(columnLabel, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateSQLXML(columnIndex, xmlObject);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateSQLXML(columnLabel, xmlObject);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
 }

Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedStatementJDK6.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedStatementJDK6.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk6/WrappedStatementJDK6.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -26,13 +26,13 @@
 import org.jboss.jca.adapters.jdbc.WrappedStatement;
 
 import java.sql.ResultSet;
-import java.sql.SQLException;
 import java.sql.Statement;
 
 /**
  * WrappedStatementJDK6.
  * 
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author <a href="jesper.pedersen at jboss.org">Jesper Pedersen</a>
  * @version $Revision: 85945 $
  */
 public class WrappedStatementJDK6 extends WrappedStatement
@@ -43,90 +43,23 @@
     * Constructor
     * @param lc The connection
     * @param s The statement
+    * @param spy The spy value
+    * @param jndiName The jndi name
     */
-   public WrappedStatementJDK6(WrappedConnectionJDK6 lc, Statement s)
+   public WrappedStatementJDK6(WrappedConnectionJDK6 lc, Statement s, boolean spy, String jndiName)
    {
-      super(lc, s);
+      super(lc, s, spy, jndiName);
    }
 
    /**
     * Wrap ResultSet
     * @param resultSet The ResultSet
+    * @param spy The spy value
+    * @param jndiName The jndi name
     * @return The result
     */
-   protected WrappedResultSet wrapResultSet(ResultSet resultSet)
+   protected WrappedResultSet wrapResultSet(ResultSet resultSet, boolean spy, String jndiName)
    {
-      return new WrappedResultSetJDK6(this, resultSet);
+      return new WrappedResultSetJDK6(this, resultSet, spy, jndiName);
    }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public boolean isPoolable() throws SQLException
-   {
-      lock();
-      try
-      {
-         Statement statement = getUnderlyingStatement();
-         try
-         {
-            return statement.isPoolable();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedCallableStatementJDK7.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedCallableStatementJDK7.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedCallableStatementJDK7.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -22,20 +22,13 @@
 
 package org.jboss.jca.adapters.jdbc.jdk7;
 
+import org.jboss.jca.adapters.jdbc.Constants;
 import org.jboss.jca.adapters.jdbc.WrappedCallableStatement;
 import org.jboss.jca.adapters.jdbc.WrappedResultSet;
 
-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;
 
 /**
  * WrappedCallableStatementJDK7.
@@ -50,880 +43,39 @@
     * Constructor
     * @param lc The connection
     * @param s The statement
+    * @param spy The spy value
+    * @param jndiName The jndi name
     */
-   public WrappedCallableStatementJDK7(WrappedConnectionJDK7 lc, CallableStatement s)
+   public WrappedCallableStatementJDK7(WrappedConnectionJDK7 lc, CallableStatement s,
+                                       boolean spy, String jndiName)
    {
-      super(lc, s);
+      super(lc, s, spy, jndiName);
    }
    
    /**
     * Wrap result set
     * @param resultSet The result set
+    * @param spy The spy value
+    * @param jndiName The jndi name
     * @return The result
     */
-   protected WrappedResultSet wrapResultSet(ResultSet resultSet)
+   protected WrappedResultSet wrapResultSet(ResultSet resultSet, boolean spy, String jndiName)
    {
-      return new WrappedResultSetJDK7(this, resultSet);
+      return new WrappedResultSetJDK7(this, resultSet, spy, jndiName);
    }
 
    /**
     * {@inheritDoc}
     */
-   public boolean isClosed() throws SQLException
-   {
-      try
-      {
-         PreparedStatement wrapped = getWrappedObject();
-         if (wrapped == null)
-            return true;
-         return wrapped.isClosed();
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public boolean isPoolable() throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.isPoolable();
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setPoolable(boolean poolable) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setPoolable(poolable);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setAsciiStream(parameterIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setBinaryStream(parameterIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setBlob(parameterIndex, inputStream);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setCharacterStream(parameterIndex, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setClob(int parameterIndex, Reader reader) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setClob(parameterIndex, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNCharacterStream(parameterIndex, value);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setNClob(int parameterIndex, NClob value) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNClob(parameterIndex, value);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setNClob(int parameterIndex, Reader reader) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNClob(parameterIndex, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setNString(int parameterIndex, String value) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNString(parameterIndex, value);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setRowId(int parameterIndex, RowId x) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setRowId(parameterIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
-   {
-      PreparedStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setSQLXML(parameterIndex, xmlObject);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public Reader getCharacterStream(int parameterIndex) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getCharacterStream(parameterIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public Reader getCharacterStream(String parameterName) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getCharacterStream(parameterName);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public Reader getNCharacterStream(int parameterIndex) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getNCharacterStream(parameterIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public Reader getNCharacterStream(String parameterName) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getCharacterStream(parameterName);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public NClob getNClob(int parameterIndex) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getNClob(parameterIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public NClob getNClob(String parameterName) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getNClob(parameterName);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public String getNString(int parameterIndex) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getNString(parameterIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public String getNString(String parameterName) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getNString(parameterName);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public RowId getRowId(int parameterIndex) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getRowId(parameterIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public RowId getRowId(String parameterName) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getRowId(parameterName);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public SQLXML getSQLXML(int parameterIndex) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getSQLXML(parameterIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public SQLXML getSQLXML(String parameterName) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         return statement.getSQLXML(parameterName);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setAsciiStream(String parameterName, InputStream x) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setAsciiStream(parameterName, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setBinaryStream(String parameterName, InputStream x) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setBinaryStream(parameterName, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setBlob(String parameterName, Blob x) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setBlob(parameterName, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setBlob(String parameterName, InputStream inputStream) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setBlob(parameterName, inputStream);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setCharacterStream(String parameterName, Reader reader) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setCharacterStream(parameterName, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setClob(String parameterName, Clob x) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setClob(parameterName, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setClob(String parameterName, Reader reader) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setClob(parameterName, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setNCharacterStream(String parameterName, Reader value) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNCharacterStream(parameterName, value);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setNClob(String parameterName, NClob value) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNClob(parameterName, value);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setNClob(String parameterName, Reader reader) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNClob(parameterName, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setNString(String parameterName, String value) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setNString(parameterName, value);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setRowId(String parameterName, RowId x) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setRowId(parameterName, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException
-   {
-      CallableStatement statement = getUnderlyingStatement();
-      try
-      {
-         statement.setSQLXML(parameterName, xmlObject);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
    public void closeOnCompletion() throws SQLException
    {
       CallableStatement statement = getUnderlyingStatement();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] closeOnCompletion()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT);
+
          statement.closeOnCompletion();
       }
       catch (Throwable t)
@@ -940,6 +92,10 @@
       CallableStatement statement = getUnderlyingStatement();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] isCloseOnCompletion()",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT);
+
          return statement.isCloseOnCompletion();
       }
       catch (Throwable t)
@@ -956,6 +112,11 @@
       CallableStatement statement = getUnderlyingStatement();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getObject(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterIndex, type);
+
          return statement.getObject(parameterIndex, type);
       }
       catch (Throwable t)
@@ -972,6 +133,11 @@
       CallableStatement statement = getUnderlyingStatement();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getObject(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_CALLABLE_STATEMENT,
+                             parameterName, type);
+
          return statement.getObject(parameterName, type);
       }
       catch (Throwable t)

Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedConnectionFactoryJDK7.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedConnectionFactoryJDK7.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedConnectionFactoryJDK7.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -49,11 +49,13 @@
    /**
     * Wrap connection
     * @param mc The managed connection
+    * @param spy The spy value
+    * @param jndiName The jndi name
     * @return The result
     */
-   public WrappedConnection createWrappedConnection(BaseWrapperManagedConnection mc)
+   public WrappedConnection createWrappedConnection(BaseWrapperManagedConnection mc, boolean spy, String jndiName)
    {
-      return new WrappedConnectionJDK7(mc);
+      return new WrappedConnectionJDK7(mc, spy, jndiName);
    }
 
    /**

Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedConnectionJDK7.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedConnectionJDK7.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedConnectionJDK7.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -23,24 +23,17 @@
 package org.jboss.jca.adapters.jdbc.jdk7;
 
 import org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection;
+import org.jboss.jca.adapters.jdbc.Constants;
 import org.jboss.jca.adapters.jdbc.WrappedCallableStatement;
 import org.jboss.jca.adapters.jdbc.WrappedConnection;
 import org.jboss.jca.adapters.jdbc.WrappedPreparedStatement;
 import org.jboss.jca.adapters.jdbc.WrappedStatement;
 
-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 java.util.concurrent.Executor;
 
 /**
@@ -57,347 +50,53 @@
     * Create a new WrappedConnectionJDK7.
     * 
     * @param mc the managed connection
+    * @param spy The spy value
+    * @param jndiName The jndi name
     */
-   public WrappedConnectionJDK7(BaseWrapperManagedConnection mc)
+   public WrappedConnectionJDK7(BaseWrapperManagedConnection mc, boolean spy, String jndiName)
    {
-      super(mc);
+      super(mc, spy, jndiName);
    }
 
    /**
     * Wrap statement
     * @param statement The statement
+    * @param spy The spy value
+    * @param jndiName The jndi name
     * @return The result
     */
-   protected WrappedStatement wrapStatement(Statement statement)
+   protected WrappedStatement wrapStatement(Statement statement, boolean spy, String jndiName)
    {
-      return new WrappedStatementJDK7(this, statement);
+      return new WrappedStatementJDK7(this, statement, spy, jndiName);
    }
 
    /**
     * Wrap prepared statement
     * @param statement The statement
+    * @param spy The spy value
+    * @param jndiName The jndi name
     * @return The result
     */
-   protected WrappedPreparedStatement wrapPreparedStatement(PreparedStatement statement)
+   protected WrappedPreparedStatement wrapPreparedStatement(PreparedStatement statement, boolean spy, String jndiName)
    {
-      return new WrappedPreparedStatementJDK7(this, statement);
+      return new WrappedPreparedStatementJDK7(this, statement, spy, jndiName);
    }
 
    /**
     * Wrap callable statement
     * @param statement The statement
+    * @param spy The spy value
+    * @param jndiName The jndi name
     * @return The result
     */
-   protected WrappedCallableStatement wrapCallableStatement(CallableStatement statement)
+   protected WrappedCallableStatement wrapCallableStatement(CallableStatement statement, boolean spy, String jndiName)
    {
-      return new WrappedCallableStatementJDK7(this, statement);
+      return new WrappedCallableStatementJDK7(this, statement, spy, jndiName);
    }
 
    /**
     * {@inheritDoc}
     */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public Blob createBlob() throws SQLException
-   {
-      lock();
-      try
-      {
-         Connection c = getUnderlyingConnection();
-         try
-         {
-            return c.createBlob();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public Clob createClob() throws SQLException
-   {
-      lock();
-      try
-      {
-         Connection c = getUnderlyingConnection();
-         try
-         {
-            return c.createClob();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public NClob createNClob() throws SQLException
-   {
-      lock();
-      try
-      {
-         Connection c = getUnderlyingConnection();
-         try
-         {
-            return c.createNClob();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public SQLXML createSQLXML() throws SQLException
-   {
-      lock();
-      try
-      {
-         Connection c = getUnderlyingConnection();
-         try
-         {
-            return c.createSQLXML();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public Properties getClientInfo() throws SQLException
-   {
-      lock();
-      try
-      {
-         Connection c = getUnderlyingConnection();
-         try
-         {
-            return c.getClientInfo();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
    public void setSchema(String schema) throws SQLException
    {
       lock();
@@ -406,6 +105,11 @@
          Connection c = getUnderlyingConnection();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setSchema(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION,
+                                schema);
+
             c.setSchema(schema);
          }
          catch (Throwable t)
@@ -430,6 +134,10 @@
          Connection c = getUnderlyingConnection();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getSchema()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
             return c.getSchema();
          }
          catch (Throwable t)
@@ -454,6 +162,11 @@
          Connection c = getUnderlyingConnection();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] abort(%s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION,
+                                executor);
+
             c.abort(executor);
          }
          catch (Throwable t)
@@ -478,6 +191,11 @@
          Connection c = getUnderlyingConnection();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] setNetworkTimeout(%s, %s)",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION,
+                                executor, milliseconds);
+
             c.setNetworkTimeout(executor, milliseconds);
          }
          catch (Throwable t)
@@ -502,6 +220,10 @@
          Connection c = getUnderlyingConnection();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] getNetworkTimeout()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_CONNECTION);
+
             return c.getNetworkTimeout();
          }
          catch (Throwable t)

Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedPreparedStatementJDK7.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedPreparedStatementJDK7.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedPreparedStatementJDK7.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -22,17 +22,13 @@
 
 package org.jboss.jca.adapters.jdbc.jdk7;
 
+import org.jboss.jca.adapters.jdbc.Constants;
 import org.jboss.jca.adapters.jdbc.WrappedPreparedStatement;
 import org.jboss.jca.adapters.jdbc.WrappedResultSet;
 
-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;
 
 /**
  * WrappedPreparedStatementJDK7.
@@ -47,528 +43,29 @@
     * Constructor
     * @param lc The connection
     * @param s The prepared statement
+    * @param spy The spy value
+    * @param jndiName The jndi name
     */
-   public WrappedPreparedStatementJDK7(WrappedConnectionJDK7 lc, PreparedStatement s)
+   public WrappedPreparedStatementJDK7(WrappedConnectionJDK7 lc, PreparedStatement s, boolean spy, String jndiName)
    {
-      super(lc, s);
+      super(lc, s, spy, jndiName);
    }
    
    /**
     * Wrap the result set
     * @param resultSet The result set
+    * @param spy The spy value
+    * @param jndiName The jndi name
     * @return The result
     */
-   protected WrappedResultSet wrapResultSet(ResultSet resultSet)
+   protected WrappedResultSet wrapResultSet(ResultSet resultSet, boolean spy, String jndiName)
    {
-      return new WrappedResultSetJDK7(this, resultSet);
+      return new WrappedResultSetJDK7(this, resultSet, spy, jndiName);
    }
 
    /**
     * {@inheritDoc}
     */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public boolean isPoolable() throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            return statement.isPoolable();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setPoolable(boolean poolable) throws SQLException
-   {
-      lock();
-      try
-      {
-         PreparedStatement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setPoolable(poolable);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
    public void closeOnCompletion() throws SQLException
    {
       lock();
@@ -577,6 +74,10 @@
          PreparedStatement statement = getUnderlyingStatement();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] closeOnCompletion()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT);
+
             statement.closeOnCompletion();
          }
          catch (Throwable t)
@@ -601,6 +102,10 @@
          PreparedStatement statement = getUnderlyingStatement();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] isCloseOnCompletion()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_PREPARED_STATEMENT);
+
             return statement.isCloseOnCompletion();
          }
          catch (Throwable t)

Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedResultSetJDK7.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedResultSetJDK7.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedResultSetJDK7.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -22,16 +22,12 @@
 
 package org.jboss.jca.adapters.jdbc.jdk7;
 
+import org.jboss.jca.adapters.jdbc.Constants;
 import org.jboss.jca.adapters.jdbc.WrappedResultSet;
 import org.jboss.jca.adapters.jdbc.WrappedStatement;
 
-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;
 
 /**
  * WrappedResultSetJDK7.
@@ -46,790 +42,28 @@
     * Constructor
     * @param statement The statement
     * @param resultSet The result set
+    * @param spy The spy value
+    * @param jndiName The jndi name
     */
-   public WrappedResultSetJDK7(WrappedStatement statement, ResultSet resultSet)
+   public WrappedResultSetJDK7(WrappedStatement statement, ResultSet resultSet,
+                               boolean spy, String jndiName)
    {
-      super(statement, resultSet);
+      super(statement, resultSet, spy, jndiName);
    }
 
    /**
     * {@inheritDoc}
     */
-   public int getHoldability() throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getHoldability();
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public Reader getNCharacterStream(int columnIndex) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getNCharacterStream(columnIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public Reader getNCharacterStream(String columnLabel) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getNCharacterStream(columnLabel);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public NClob getNClob(int columnIndex) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getNClob(columnIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public NClob getNClob(String columnLabel) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getNClob(columnLabel);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public String getNString(int columnIndex) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getNString(columnIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public String getNString(String columnLabel) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getNString(columnLabel);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public RowId getRowId(int columnIndex) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getRowId(columnIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public RowId getRowId(String columnLabel) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getRowId(columnLabel);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public SQLXML getSQLXML(int columnIndex) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getSQLXML(columnIndex);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public SQLXML getSQLXML(String columnLabel) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         return resultSet.getSQLXML(columnLabel);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public boolean isClosed() throws SQLException
-   {
-      ResultSet resultSet = getWrappedObject();
-      if (resultSet == null)
-         return true;
-      try
-      {
-         return resultSet.isClosed();
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateAsciiStream(columnIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateAsciiStream(columnLabel, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateBinaryStream(columnIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateBinaryStream(columnLabel, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateBlob(columnIndex, inputStream);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateBlob(columnLabel, inputStream);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateCharacterStream(int columnIndex, Reader x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateCharacterStream(columnIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateCharacterStream(columnLabel, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateClob(int columnIndex, Reader reader) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateClob(columnIndex, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateClob(String columnLabel, Reader reader) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateClob(columnLabel, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNCharacterStream(columnIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNCharacterStream(columnLabel, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateNClob(int columnIndex, NClob clob) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNClob(columnIndex, clob);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateNClob(int columnIndex, Reader reader) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNClob(columnIndex, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateNClob(String columnLabel, NClob clob) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNClob(columnLabel, clob);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   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);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateNClob(String columnLabel, Reader reader) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNClob(columnLabel, reader);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateNString(int columnIndex, String string) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNString(columnIndex, string);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateNString(String columnLabel, String string) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateNString(columnLabel, string);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateRowId(int columnIndex, RowId x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateRowId(columnIndex, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateRowId(String columnLabel, RowId x) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateRowId(columnLabel, x);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateSQLXML(columnIndex, xmlObject);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException
-   {
-      ResultSet resultSet = getUnderlyingResultSet();
-      try
-      {
-         resultSet.updateSQLXML(columnLabel, xmlObject);
-      }
-      catch (Throwable t)
-      {
-         throw checkException(t);
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
    public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException
    {
       ResultSet resultSet = getUnderlyingResultSet();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getObject(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             parameterIndex, type);
+
          return resultSet.getObject(parameterIndex, type);
       }
       catch (Throwable t)
@@ -846,6 +80,11 @@
       ResultSet resultSet = getUnderlyingResultSet();
       try
       {
+         if (isSpy())
+            spyLogger.debugf("%s [%s] getObject(%s, %s)",
+                             getJndiName(), Constants.SPY_LOGGER_PREFIX_RESULTSET,
+                             parameterName, type);
+
          return resultSet.getObject(parameterName, type);
       }
       catch (Throwable t)

Modified: projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedStatementJDK7.java
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedStatementJDK7.java	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/java/org/jboss/jca/adapters/jdbc/jdk7/WrappedStatementJDK7.java	2011-01-28 20:52:30 UTC (rev 110495)
@@ -22,6 +22,7 @@
 
 package org.jboss.jca.adapters.jdbc.jdk7;
 
+import org.jboss.jca.adapters.jdbc.Constants;
 import org.jboss.jca.adapters.jdbc.WrappedResultSet;
 import org.jboss.jca.adapters.jdbc.WrappedStatement;
 
@@ -42,96 +43,29 @@
     * Constructor
     * @param lc The connection
     * @param s The statement
+    * @param spy The spy value
+    * @param jndiName The jndi name
     */
-   public WrappedStatementJDK7(WrappedConnectionJDK7 lc, Statement s)
+   public WrappedStatementJDK7(WrappedConnectionJDK7 lc, Statement s, boolean spy, String jndiName)
    {
-      super(lc, s);
+      super(lc, s, spy, jndiName);
    }
 
    /**
     * Wrap ResultSet
     * @param resultSet The ResultSet
+    * @param spy The spy value
+    * @param jndiName The jndi name
     * @return The result
     */
-   protected WrappedResultSet wrapResultSet(ResultSet resultSet)
+   protected WrappedResultSet wrapResultSet(ResultSet resultSet, boolean spy, String jndiName)
    {
-      return new WrappedResultSetJDK7(this, resultSet);
+      return new WrappedResultSetJDK7(this, resultSet, spy, jndiName);
    }
 
    /**
     * {@inheritDoc}
     */
-   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();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public boolean isPoolable() throws SQLException
-   {
-      lock();
-      try
-      {
-         Statement statement = getUnderlyingStatement();
-         try
-         {
-            return statement.isPoolable();
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void setPoolable(boolean poolable) throws SQLException
-   {
-      lock();
-      try
-      {
-         Statement statement = getUnderlyingStatement();
-         try
-         {
-            statement.setPoolable(poolable);
-         }
-         catch (Throwable t)
-         {
-            throw checkException(t);
-         }
-      }
-      finally
-      {
-         unlock();
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
    public void closeOnCompletion() throws SQLException
    {
       lock();
@@ -140,6 +74,10 @@
          Statement statement = getUnderlyingStatement();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] closeOnCompletion()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+
             statement.closeOnCompletion();
          }
          catch (Throwable t)
@@ -164,6 +102,10 @@
          Statement statement = getUnderlyingStatement();
          try
          {
+            if (isSpy())
+               spyLogger.debugf("%s [%s] isCloseOnCompletion()",
+                                getJndiName(), Constants.SPY_LOGGER_PREFIX_STATEMENT);
+
             return statement.isCloseOnCompletion();
          }
          catch (Throwable t)

Modified: projects/jboss-jca/trunk/adapters/src/main/resources/jdbc/local/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/resources/jdbc/local/META-INF/ra.xml	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/resources/jdbc/local/META-INF/ra.xml	2011-01-28 20:52:30 UTC (rev 110495)
@@ -157,6 +157,16 @@
           <config-property-name>UseTryLock</config-property-name>
           <config-property-type>java.lang.Integer</config-property-type>
         </config-property>
+        <config-property>
+          <description>Enable spy functionality</description>
+          <config-property-name>Spy</config-property-name>
+          <config-property-type>java.lang.Boolean</config-property-type>
+        </config-property>
+        <config-property>
+          <description>The JNDI name of the datasource</description>
+          <config-property-name>JndiName</config-property-name>
+          <config-property-type>java.lang.String</config-property-type>
+        </config-property>
         <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
         <connectionfactory-impl-class>org.jboss.jca.adapters.jdbc.WrapperDataSource</connectionfactory-impl-class>
         <connection-interface>java.sql.Connection</connection-interface>

Modified: projects/jboss-jca/trunk/adapters/src/main/resources/jdbc/xa/META-INF/ra.xml
===================================================================
--- projects/jboss-jca/trunk/adapters/src/main/resources/jdbc/xa/META-INF/ra.xml	2011-01-28 19:40:27 UTC (rev 110494)
+++ projects/jboss-jca/trunk/adapters/src/main/resources/jdbc/xa/META-INF/ra.xml	2011-01-28 20:52:30 UTC (rev 110495)
@@ -157,6 +157,16 @@
           <config-property-name>UseTryLock</config-property-name>
           <config-property-type>java.lang.Integer</config-property-type>
         </config-property>
+        <config-property>
+          <description>Enable spy functionality</description>
+          <config-property-name>Spy</config-property-name>
+          <config-property-type>java.lang.Boolean</config-property-type>
+        </config-property>
+        <config-property>
+          <description>The JNDI name of the datasource</description>
+          <config-property-name>JndiName</config-property-name>
+          <config-property-type>java.lang.String</config-property-type>
+        </config-property>
         <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
         <connectionfactory-impl-class>org.jboss.jca.adapters.jdbc.WrapperDataSource</connectionfactory-impl-class>
         <connection-interface>java.sql.Connection</connection-interface>



More information about the jboss-cvs-commits mailing list