Coverage report

  %line %branch
net.sf.infrared.aspects.jdbc.p6spy.InfraREDP6CallableStatement
0% 
0% 

 1  
 /* 
 2  
  * Copyright 2005 Tavant Technologies and Contributors
 3  
  * 
 4  
  * Licensed under the Apache License, Version 2.0 (the "License")
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  *     http://www.apache.org/licenses/LICENSE-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  * 
 16  
  *
 17  
  *
 18  
  * Original Author:  prashant.nair (Tavant Technologies)
 19  
  * Contributor(s):   binil.thomas;
 20  
  *
 21  
  */
 22  
 package net.sf.infrared.aspects.jdbc.p6spy;
 23  
 
 24  
 import java.io.InputStream;
 25  
 import java.io.Reader;
 26  
 import java.math.BigDecimal;
 27  
 import java.net.URL;
 28  
 import java.sql.Array;
 29  
 import java.sql.Blob;
 30  
 import java.sql.CallableStatement;
 31  
 import java.sql.Clob;
 32  
 import java.sql.Date;
 33  
 import java.sql.Ref;
 34  
 import java.sql.SQLException;
 35  
 import java.sql.Time;
 36  
 import java.sql.Timestamp;
 37  
 import java.util.Calendar;
 38  
 import java.util.Map;
 39  
 
 40  
 import net.sf.infrared.agent.MonitorFactory;
 41  
 import net.sf.infrared.base.model.ExecutionContext;
 42  
 import net.sf.infrared.base.model.ExecutionTimer;
 43  
 
 44  
 import com.p6spy.engine.spy.P6Connection;
 45  
 
 46  
 /**
 47  
  * 
 48  
  * @author prashant.nair
 49  
  * @author binil.thomas
 50  
  */
 51  
 public class InfraREDP6CallableStatement 
 52  
         extends InfraREDP6PreparedStatement implements CallableStatement {
 53  
 
 54  
     private CallableStatement passThru;
 55  
 
 56  
     private String callableQuery;
 57  
 
 58  
     private ExecutionContext ctx;
 59  
 
 60  
     public InfraREDP6CallableStatement(InfraREDP6Factory infraP6Factory, 
 61  
             CallableStatement real, P6Connection conn, String sql) {
 62  0
         super(infraP6Factory, real, conn, sql);
 63  0
         this.passThru = real;
 64  0
         this.factory = infraP6Factory;
 65  0
         this.callableQuery = sql;
 66  0
         this.conn = conn;
 67  0
         this.ctx = infraP6Factory.getExecuteContext(sql);
 68  0
     }
 69  
 
 70  
     public boolean execute() throws SQLException {
 71  0
         if (factory.isJDBCMonitoringEnabled()) {
 72  0
             ExecutionTimer timer = new ExecutionTimer(ctx);
 73  0
             MonitorFactory.getFacade().recordExecutionBegin(timer);
 74  
             try {
 75  0
                 return passThru.execute();
 76  
             } finally {
 77  0
                 MonitorFactory.getFacade().recordExecutionEnd(timer);
 78  
             }
 79  
         } else {
 80  0
             return passThru.execute();
 81  
         }
 82  
     }
 83  
 
 84  
     public void registerOutParameter(int parameterIndex, class="keyword">int sqlType) throws SQLException {
 85  0
         passThru.registerOutParameter(parameterIndex, sqlType);
 86  0
     }
 87  
 
 88  
     public void registerOutParameter(int parameterIndex, class="keyword">int sqlType, class="keyword">int scale)
 89  
             throws SQLException {
 90  0
         passThru.registerOutParameter(parameterIndex, sqlType, scale);
 91  0
     }
 92  
 
 93  
     public boolean wasNull() throws SQLException {
 94  0
         return passThru.wasNull();
 95  
     }
 96  
 
 97  
     public String getString(int parameterIndex) throws SQLException {
 98  0
         return passThru.getString(parameterIndex);
 99  
     }
 100  
 
 101  
     public boolean getBoolean(int parameterIndex) throws SQLException {
 102  0
         return passThru.getBoolean(parameterIndex);
 103  
     }
 104  
 
 105  
     public byte getByte(int parameterIndex) throws SQLException {
 106  0
         return passThru.getByte(parameterIndex);
 107  
     }
 108  
 
 109  
     public short getShort(int parameterIndex) throws SQLException {
 110  0
         return passThru.getShort(parameterIndex);
 111  
     }
 112  
 
 113  
     public int getInt(class="keyword">int parameterIndex) throws SQLException {
 114  0
         return passThru.getInt(parameterIndex);
 115  
     }
 116  
 
 117  
     public long getLong(int parameterIndex) throws SQLException {
 118  0
         return passThru.getLong(parameterIndex);
 119  
     }
 120  
 
 121  
     public float getFloat(int parameterIndex) throws SQLException {
 122  0
         return passThru.getFloat(parameterIndex);
 123  
     }
 124  
 
 125  
     public double getDouble(int parameterIndex) throws SQLException {
 126  0
         return passThru.getDouble(parameterIndex);
 127  
     }
 128  
 
 129  
     public BigDecimal getBigDecimal(int parameterIndex, class="keyword">int scale) throws SQLException {
 130  0
         return passThru.getBigDecimal(parameterIndex, scale);
 131  
     }
 132  
 
 133  
     public byte[] getBytes(int parameterIndex) throws SQLException {
 134  0
         return passThru.getBytes(parameterIndex);
 135  
     }
 136  
 
 137  
     public Date getDate(int parameterIndex) throws SQLException {
 138  0
         return passThru.getDate(parameterIndex);
 139  
     }
 140  
 
 141  
     public Time getTime(int parameterIndex) throws SQLException {
 142  0
         return passThru.getTime(parameterIndex);
 143  
     }
 144  
 
 145  
     public Timestamp getTimestamp(int parameterIndex) throws SQLException {
 146  0
         return passThru.getTimestamp(parameterIndex);
 147  
     }
 148  
 
 149  
     public Object getObject(int parameterIndex) throws SQLException {
 150  0
         return passThru.getObject(parameterIndex);
 151  
     }
 152  
 
 153  
     public BigDecimal getBigDecimal(int parameterIndex) throws SQLException {
 154  0
         return passThru.getBigDecimal(parameterIndex);
 155  
     }
 156  
 
 157  
     public Object getObject(int i, Map map) throws SQLException {
 158  0
         return passThru.getObject(i, map);
 159  
     }
 160  
 
 161  
     public Ref getRef(int i) throws SQLException {
 162  0
         return passThru.getRef(i);
 163  
     }
 164  
 
 165  
     public Blob getBlob(int i) throws SQLException {
 166  0
         return passThru.getBlob(i);
 167  
     }
 168  
 
 169  
     public Clob getClob(int i) throws SQLException {
 170  0
         return passThru.getClob(i);
 171  
     }
 172  
 
 173  
     public Array getArray(int i) throws SQLException {
 174  0
         return passThru.getArray(i);
 175  
     }
 176  
 
 177  
     public Date getDate(int parameterIndex, Calendar cal) throws SQLException {
 178  0
         return passThru.getDate(parameterIndex, cal);
 179  
     }
 180  
 
 181  
     public Time getTime(int parameterIndex, Calendar cal) throws SQLException {
 182  0
         return passThru.getTime(parameterIndex, cal);
 183  
     }
 184  
 
 185  
     public Timestamp getTimestamp(int parameterIndex, Calendar cal) throws SQLException {
 186  0
         return passThru.getTimestamp(parameterIndex, cal);
 187  
     }
 188  
 
 189  
     public void registerOutParameter(int paramIndex, class="keyword">int sqlType, String typeName)
 190  
             throws SQLException {
 191  0
         passThru.registerOutParameter(paramIndex, sqlType, typeName);
 192  0
     }
 193  
 
 194  
     public void registerOutParameter(String parameterName, int sqlType) throws SQLException {
 195  0
         passThru.registerOutParameter(parameterName, sqlType);
 196  0
     }
 197  
 
 198  
     public void registerOutParameter(String parameterName, int sqlType, class="keyword">int scale)
 199  
             throws SQLException {
 200  0
         passThru.registerOutParameter(parameterName, sqlType, scale);
 201  0
     }
 202  
 
 203  
     public void registerOutParameter(String parameterName, int sqlType, String typeName)
 204  
             throws SQLException {
 205  0
         passThru.registerOutParameter(parameterName, sqlType, typeName);
 206  0
     }
 207  
 
 208  
     public URL getURL(int parameterIndex) throws SQLException {
 209  0
         return passThru.getURL(parameterIndex);
 210  
     }
 211  
 
 212  
     public void setURL(String parameterName, URL val) throws SQLException {
 213  0
         passThru.setURL(parameterName, val);
 214  0
     }
 215  
 
 216  
     public void setNull(String parameterName, int sqlType) throws SQLException {
 217  0
         passThru.setNull(parameterName, sqlType);
 218  0
     }
 219  
 
 220  
     public void setBoolean(String parameterName, boolean x) throws SQLException {
 221  0
         passThru.setBoolean(parameterName, x);
 222  0
     }
 223  
 
 224  
     public void setByte(String parameterName, byte x) throws SQLException {
 225  0
         passThru.setByte(parameterName, x);
 226  0
     }
 227  
 
 228  
     public void setShort(String parameterName, short x) throws SQLException {
 229  0
         passThru.setShort(parameterName, x);
 230  0
     }
 231  
 
 232  
     public void setInt(String parameterName, int x) throws SQLException {
 233  0
         passThru.setInt(parameterName, x);
 234  0
     }
 235  
 
 236  
     public void setLong(String parameterName, long x) throws SQLException {
 237  0
         passThru.setLong(parameterName, x);
 238  0
     }
 239  
 
 240  
     public void setFloat(String parameterName, float x) throws SQLException {
 241  0
         passThru.setFloat(parameterName, x);
 242  0
     }
 243  
 
 244  
     public void setDouble(String parameterName, double x) throws SQLException {
 245  0
         passThru.setDouble(parameterName, x);
 246  0
     }
 247  
 
 248  
     public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException {
 249  0
         passThru.setBigDecimal(parameterName, x);
 250  0
     }
 251  
 
 252  
     public void setString(String parameterName, String x) throws SQLException {
 253  0
         passThru.setString(parameterName, x);
 254  0
     }
 255  
 
 256  
     public void setBytes(String parameterName, byte x[]) throws SQLException {
 257  0
         passThru.setBytes(parameterName, x);
 258  0
     }
 259  
 
 260  
     public void setDate(String parameterName, Date x) throws SQLException {
 261  0
         passThru.setDate(parameterName, x);
 262  0
     }
 263  
 
 264  
     public void setTime(String parameterName, Time x) throws SQLException {
 265  0
         passThru.setTime(parameterName, x);
 266  0
     }
 267  
 
 268  
     public void setTimestamp(String parameterName, Timestamp x) throws SQLException {
 269  0
         passThru.setTimestamp(parameterName, x);
 270  0
     }
 271  
 
 272  
     public void setAsciiStream(String parameterName, 
 273  
             InputStream x, int length) throws SQLException {
 274  0
         passThru.setAsciiStream(parameterName, x, length);
 275  0
     }
 276  
 
 277  
     public void setBinaryStream(String parameterName, InputStream x, int length)
 278  
             throws SQLException {
 279  0
         passThru.setBinaryStream(parameterName, x, length);
 280  0
     }
 281  
 
 282  
     public void setObject(String parameterName, Object x, int targetSqlType, class="keyword">int scale)
 283  
             throws SQLException {
 284  0
         passThru.setObject(parameterName, x, targetSqlType, scale);
 285  0
     }
 286  
 
 287  
     public void setObject(String parameterName, Object x, int targetSqlType) throws SQLException {
 288  0
         passThru.setObject(parameterName, x, targetSqlType);
 289  0
     }
 290  
 
 291  
     public void setObject(String parameterName, Object x) throws SQLException {
 292  0
         passThru.setObject(parameterName, x);
 293  0
     }
 294  
 
 295  
     public void setCharacterStream(String parameterName, Reader reader, int length)
 296  
             throws SQLException {
 297  0
         passThru.setCharacterStream(parameterName, reader, length);
 298  0
     }
 299  
 
 300  
     public void setDate(String parameterName, Date x, Calendar cal) throws SQLException {
 301  0
         passThru.setDate(parameterName, x, cal);
 302  0
     }
 303  
 
 304  
     public void setTime(String parameterName, Time x, Calendar cal) throws SQLException {
 305  0
         passThru.setTime(parameterName, x, cal);
 306  0
     }
 307  
 
 308  
     public void setTimestamp(String parameterName, Timestamp x, Calendar cal) throws SQLException {
 309  0
         passThru.setTimestamp(parameterName, x, cal);
 310  0
     }
 311  
 
 312  
     public void setNull(String parameterName, int sqlType, String typeName) throws SQLException {
 313  0
         passThru.setNull(parameterName, sqlType, typeName);
 314  0
     }
 315  
 
 316  
     public String getString(String parameterName) throws SQLException {
 317  0
         return passThru.getString(parameterName);
 318  
     }
 319  
 
 320  
     public boolean getBoolean(String parameterName) throws SQLException {
 321  0
         return passThru.getBoolean(parameterName);
 322  
     }
 323  
 
 324  
     public byte getByte(String parameterName) throws SQLException {
 325  0
         return passThru.getByte(parameterName);
 326  
     }
 327  
 
 328  
     public short getShort(String parameterName) throws SQLException {
 329  0
         return passThru.getShort(parameterName);
 330  
     }
 331  
 
 332  
     public int getInt(String parameterName) throws SQLException {
 333  0
         return passThru.getInt(parameterName);
 334  
     }
 335  
 
 336  
     public long getLong(String parameterName) throws SQLException {
 337  0
         return passThru.getLong(parameterName);
 338  
     }
 339  
 
 340  
     public float getFloat(String parameterName) throws SQLException {
 341  0
         return passThru.getFloat(parameterName);
 342  
     }
 343  
 
 344  
     public double getDouble(String parameterName) throws SQLException {
 345  0
         return passThru.getDouble(parameterName);
 346  
     }
 347  
 
 348  
     public byte[] getBytes(String parameterName) throws SQLException {
 349  0
         return passThru.getBytes(parameterName);
 350  
     }
 351  
 
 352  
     public Date getDate(String parameterName) throws SQLException {
 353  0
         return passThru.getDate(parameterName);
 354  
     }
 355  
 
 356  
     public Time getTime(String parameterName) throws SQLException {
 357  0
         return passThru.getTime(parameterName);
 358  
     }
 359  
 
 360  
     public Timestamp getTimestamp(String parameterName) throws SQLException {
 361  0
         return passThru.getTimestamp(parameterName);
 362  
     }
 363  
 
 364  
     public Object getObject(String parameterName) throws SQLException {
 365  0
         return passThru.getObject(parameterName);
 366  
     }
 367  
 
 368  
     public BigDecimal getBigDecimal(String parameterName) throws SQLException {
 369  0
         return passThru.getBigDecimal(parameterName);
 370  
     }
 371  
 
 372  
     public Object getObject(String parameterName, Map map) throws SQLException {
 373  0
         return passThru.getObject(parameterName, map);
 374  
     }
 375  
 
 376  
     public Ref getRef(String parameterName) throws SQLException {
 377  0
         return passThru.getRef(parameterName);
 378  
     }
 379  
 
 380  
     public Blob getBlob(String parameterName) throws SQLException {
 381  0
         return passThru.getBlob(parameterName);
 382  
     }
 383  
 
 384  
     public Clob getClob(String parameterName) throws SQLException {
 385  0
         return passThru.getClob(parameterName);
 386  
     }
 387  
 
 388  
     public Array getArray(String parameterName) throws SQLException {
 389  0
         return passThru.getArray(parameterName);
 390  
     }
 391  
 
 392  
     public Date getDate(String parameterName, Calendar cal) throws SQLException {
 393  0
         return passThru.getDate(parameterName, cal);
 394  
     }
 395  
 
 396  
     public Time getTime(String parameterName, Calendar cal) throws SQLException {
 397  0
         return passThru.getTime(parameterName, cal);
 398  
     }
 399  
 
 400  
     public Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLException {
 401  0
         return passThru.getTimestamp(parameterName, cal);
 402  
     }
 403  
 
 404  
     public URL getURL(String parameterName) throws SQLException {
 405  0
         return passThru.getURL(parameterName);
 406  
     }
 407  
 
 408  
 }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.