code: public static String getSql(Object jdbcWrapper) {
          if (jdbcWrapper instanceof WSJdbcPreparedStatement) // also includes WSJdbcCallableStatement
              return ((WSJdbcPreparedStatement) jdbcWrapper).sql;
          else if (jdbcWrapper instanceof WSJdbcResultSet)
              return ((WSJdbcResultSet) jdbcWrapper).sql;
          else
              return null;
      }
docs: Utility method to obtain the SQL command associated with a JDBC resource.
  
  @param jdbcWrapper proxy for a JDBC resource.
  @return SQL command associated with the JDBC resource. Null if not a PreparedStatement, CallableStatement, or ResultSet.