DelegatingCallableStatement.java

  1. /*
  2.  * Licensed to the Apache Software Foundation (ASF) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * The ASF licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *      http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.apache.commons.dbcp2;

  18. import java.io.InputStream;
  19. import java.io.Reader;
  20. import java.math.BigDecimal;
  21. import java.net.URL;
  22. import java.sql.Array;
  23. import java.sql.Blob;
  24. import java.sql.CallableStatement;
  25. import java.sql.Clob;
  26. import java.sql.Date;
  27. import java.sql.NClob;
  28. import java.sql.Ref;
  29. import java.sql.RowId;
  30. import java.sql.SQLException;
  31. import java.sql.SQLType;
  32. import java.sql.SQLXML;
  33. import java.sql.Time;
  34. import java.sql.Timestamp;
  35. import java.util.Calendar;
  36. import java.util.Map;

  37. /**
  38.  * A base delegating implementation of {@link CallableStatement}.
  39.  * <p>
  40.  * All of the methods from the {@link CallableStatement} interface simply call the corresponding method on the
  41.  * "delegate" provided in my constructor.
  42.  * </p>
  43.  * <p>
  44.  * Extends AbandonedTrace to implement Statement tracking and logging of code which created the Statement. Tracking the
  45.  * Statement ensures that the Connection which created it can close any open Statement's on Connection close.
  46.  * </p>
  47.  *
  48.  * @since 2.0
  49.  */
  50. public class DelegatingCallableStatement extends DelegatingPreparedStatement implements CallableStatement {

  51.     /**
  52.      * Creates a wrapper for the Statement which traces this Statement to the Connection which created it and the code
  53.      * which created it.
  54.      *
  55.      * @param connection
  56.      *            the {@link DelegatingConnection} that created this statement
  57.      * @param statement
  58.      *            the {@link CallableStatement} to delegate all calls to
  59.      */
  60.     public DelegatingCallableStatement(final DelegatingConnection<?> connection, final CallableStatement statement) {
  61.         super(connection, statement);
  62.     }

  63.     @Override
  64.     public Array getArray(final int parameterIndex) throws SQLException {
  65.         checkOpen();
  66.         try {
  67.             return getDelegateCallableStatement().getArray(parameterIndex);
  68.         } catch (final SQLException e) {
  69.             handleException(e);
  70.             return null;
  71.         }
  72.     }

  73.     @Override
  74.     public Array getArray(final String parameterName) throws SQLException {
  75.         checkOpen();
  76.         try {
  77.             return getDelegateCallableStatement().getArray(parameterName);
  78.         } catch (final SQLException e) {
  79.             handleException(e);
  80.             return null;
  81.         }
  82.     }

  83.     @Override
  84.     public BigDecimal getBigDecimal(final int parameterIndex) throws SQLException {
  85.         checkOpen();
  86.         try {
  87.             return getDelegateCallableStatement().getBigDecimal(parameterIndex);
  88.         } catch (final SQLException e) {
  89.             handleException(e);
  90.             return null;
  91.         }
  92.     }

  93.     /** @deprecated Use {@link #getBigDecimal(int)} or {@link #getBigDecimal(String)} */
  94.     @Override
  95.     @Deprecated
  96.     public BigDecimal getBigDecimal(final int parameterIndex, final int scale) throws SQLException {
  97.         checkOpen();
  98.         try {
  99.             return getDelegateCallableStatement().getBigDecimal(parameterIndex, scale);
  100.         } catch (final SQLException e) {
  101.             handleException(e);
  102.             return null;
  103.         }
  104.     }

  105.     @Override
  106.     public BigDecimal getBigDecimal(final String parameterName) throws SQLException {
  107.         checkOpen();
  108.         try {
  109.             return getDelegateCallableStatement().getBigDecimal(parameterName);
  110.         } catch (final SQLException e) {
  111.             handleException(e);
  112.             return null;
  113.         }
  114.     }

  115.     @Override
  116.     public Blob getBlob(final int parameterIndex) throws SQLException {
  117.         checkOpen();
  118.         try {
  119.             return getDelegateCallableStatement().getBlob(parameterIndex);
  120.         } catch (final SQLException e) {
  121.             handleException(e);
  122.             return null;
  123.         }
  124.     }

  125.     @Override
  126.     public Blob getBlob(final String parameterName) throws SQLException {
  127.         checkOpen();
  128.         try {
  129.             return getDelegateCallableStatement().getBlob(parameterName);
  130.         } catch (final SQLException e) {
  131.             handleException(e);
  132.             return null;
  133.         }
  134.     }

  135.     @Override
  136.     public boolean getBoolean(final int parameterIndex) throws SQLException {
  137.         checkOpen();
  138.         try {
  139.             return getDelegateCallableStatement().getBoolean(parameterIndex);
  140.         } catch (final SQLException e) {
  141.             handleException(e);
  142.             return false;
  143.         }
  144.     }

  145.     @Override
  146.     public boolean getBoolean(final String parameterName) throws SQLException {
  147.         checkOpen();
  148.         try {
  149.             return getDelegateCallableStatement().getBoolean(parameterName);
  150.         } catch (final SQLException e) {
  151.             handleException(e);
  152.             return false;
  153.         }
  154.     }

  155.     @Override
  156.     public byte getByte(final int parameterIndex) throws SQLException {
  157.         checkOpen();
  158.         try {
  159.             return getDelegateCallableStatement().getByte(parameterIndex);
  160.         } catch (final SQLException e) {
  161.             handleException(e);
  162.             return 0;
  163.         }
  164.     }

  165.     @Override
  166.     public byte getByte(final String parameterName) throws SQLException {
  167.         checkOpen();
  168.         try {
  169.             return getDelegateCallableStatement().getByte(parameterName);
  170.         } catch (final SQLException e) {
  171.             handleException(e);
  172.             return 0;
  173.         }
  174.     }

  175.     @Override
  176.     public byte[] getBytes(final int parameterIndex) throws SQLException {
  177.         checkOpen();
  178.         try {
  179.             return getDelegateCallableStatement().getBytes(parameterIndex);
  180.         } catch (final SQLException e) {
  181.             handleException(e);
  182.             return null;
  183.         }
  184.     }

  185.     @Override
  186.     public byte[] getBytes(final String parameterName) throws SQLException {
  187.         checkOpen();
  188.         try {
  189.             return getDelegateCallableStatement().getBytes(parameterName);
  190.         } catch (final SQLException e) {
  191.             handleException(e);
  192.             return null;
  193.         }
  194.     }

  195.     @Override
  196.     public Reader getCharacterStream(final int parameterIndex) throws SQLException {
  197.         checkOpen();
  198.         try {
  199.             return getDelegateCallableStatement().getCharacterStream(parameterIndex);
  200.         } catch (final SQLException e) {
  201.             handleException(e);
  202.             return null;
  203.         }
  204.     }

  205.     @Override
  206.     public Reader getCharacterStream(final String parameterName) throws SQLException {
  207.         checkOpen();
  208.         try {
  209.             return getDelegateCallableStatement().getCharacterStream(parameterName);
  210.         } catch (final SQLException e) {
  211.             handleException(e);
  212.             return null;
  213.         }
  214.     }

  215.     @Override
  216.     public Clob getClob(final int parameterIndex) throws SQLException {
  217.         checkOpen();
  218.         try {
  219.             return getDelegateCallableStatement().getClob(parameterIndex);
  220.         } catch (final SQLException e) {
  221.             handleException(e);
  222.             return null;
  223.         }
  224.     }

  225.     @Override
  226.     public Clob getClob(final String parameterName) throws SQLException {
  227.         checkOpen();
  228.         try {
  229.             return getDelegateCallableStatement().getClob(parameterName);
  230.         } catch (final SQLException e) {
  231.             handleException(e);
  232.             return null;
  233.         }
  234.     }

  235.     @Override
  236.     public Date getDate(final int parameterIndex) throws SQLException {
  237.         checkOpen();
  238.         try {
  239.             return getDelegateCallableStatement().getDate(parameterIndex);
  240.         } catch (final SQLException e) {
  241.             handleException(e);
  242.             return null;
  243.         }
  244.     }

  245.     @Override
  246.     public Date getDate(final int parameterIndex, final Calendar cal) throws SQLException {
  247.         checkOpen();
  248.         try {
  249.             return getDelegateCallableStatement().getDate(parameterIndex, cal);
  250.         } catch (final SQLException e) {
  251.             handleException(e);
  252.             return null;
  253.         }
  254.     }

  255.     @Override
  256.     public Date getDate(final String parameterName) throws SQLException {
  257.         checkOpen();
  258.         try {
  259.             return getDelegateCallableStatement().getDate(parameterName);
  260.         } catch (final SQLException e) {
  261.             handleException(e);
  262.             return null;
  263.         }
  264.     }

  265.     @Override
  266.     public Date getDate(final String parameterName, final Calendar cal) throws SQLException {
  267.         checkOpen();
  268.         try {
  269.             return getDelegateCallableStatement().getDate(parameterName, cal);
  270.         } catch (final SQLException e) {
  271.             handleException(e);
  272.             return null;
  273.         }
  274.     }

  275.     private CallableStatement getDelegateCallableStatement() {
  276.         return (CallableStatement) getDelegate();
  277.     }

  278.     @Override
  279.     public double getDouble(final int parameterIndex) throws SQLException {
  280.         checkOpen();
  281.         try {
  282.             return getDelegateCallableStatement().getDouble(parameterIndex);
  283.         } catch (final SQLException e) {
  284.             handleException(e);
  285.             return 0;
  286.         }
  287.     }

  288.     @Override
  289.     public double getDouble(final String parameterName) throws SQLException {
  290.         checkOpen();
  291.         try {
  292.             return getDelegateCallableStatement().getDouble(parameterName);
  293.         } catch (final SQLException e) {
  294.             handleException(e);
  295.             return 0;
  296.         }
  297.     }

  298.     @Override
  299.     public float getFloat(final int parameterIndex) throws SQLException {
  300.         checkOpen();
  301.         try {
  302.             return getDelegateCallableStatement().getFloat(parameterIndex);
  303.         } catch (final SQLException e) {
  304.             handleException(e);
  305.             return 0;
  306.         }
  307.     }

  308.     @Override
  309.     public float getFloat(final String parameterName) throws SQLException {
  310.         checkOpen();
  311.         try {
  312.             return getDelegateCallableStatement().getFloat(parameterName);
  313.         } catch (final SQLException e) {
  314.             handleException(e);
  315.             return 0;
  316.         }
  317.     }

  318.     @Override
  319.     public int getInt(final int parameterIndex) throws SQLException {
  320.         checkOpen();
  321.         try {
  322.             return getDelegateCallableStatement().getInt(parameterIndex);
  323.         } catch (final SQLException e) {
  324.             handleException(e);
  325.             return 0;
  326.         }
  327.     }

  328.     @Override
  329.     public int getInt(final String parameterName) throws SQLException {
  330.         checkOpen();
  331.         try {
  332.             return getDelegateCallableStatement().getInt(parameterName);
  333.         } catch (final SQLException e) {
  334.             handleException(e);
  335.             return 0;
  336.         }
  337.     }

  338.     @Override
  339.     public long getLong(final int parameterIndex) throws SQLException {
  340.         checkOpen();
  341.         try {
  342.             return getDelegateCallableStatement().getLong(parameterIndex);
  343.         } catch (final SQLException e) {
  344.             handleException(e);
  345.             return 0;
  346.         }
  347.     }

  348.     @Override
  349.     public long getLong(final String parameterName) throws SQLException {
  350.         checkOpen();
  351.         try {
  352.             return getDelegateCallableStatement().getLong(parameterName);
  353.         } catch (final SQLException e) {
  354.             handleException(e);
  355.             return 0;
  356.         }
  357.     }

  358.     @Override
  359.     public Reader getNCharacterStream(final int parameterIndex) throws SQLException {
  360.         checkOpen();
  361.         try {
  362.             return getDelegateCallableStatement().getNCharacterStream(parameterIndex);
  363.         } catch (final SQLException e) {
  364.             handleException(e);
  365.             return null;
  366.         }
  367.     }

  368.     @Override
  369.     public Reader getNCharacterStream(final String parameterName) throws SQLException {
  370.         checkOpen();
  371.         try {
  372.             return getDelegateCallableStatement().getNCharacterStream(parameterName);
  373.         } catch (final SQLException e) {
  374.             handleException(e);
  375.             return null;
  376.         }
  377.     }

  378.     @Override
  379.     public NClob getNClob(final int parameterIndex) throws SQLException {
  380.         checkOpen();
  381.         try {
  382.             return getDelegateCallableStatement().getNClob(parameterIndex);
  383.         } catch (final SQLException e) {
  384.             handleException(e);
  385.             return null;
  386.         }
  387.     }

  388.     @Override
  389.     public NClob getNClob(final String parameterName) throws SQLException {
  390.         checkOpen();
  391.         try {
  392.             return getDelegateCallableStatement().getNClob(parameterName);
  393.         } catch (final SQLException e) {
  394.             handleException(e);
  395.             return null;
  396.         }
  397.     }

  398.     @Override
  399.     public String getNString(final int parameterIndex) throws SQLException {
  400.         checkOpen();
  401.         try {
  402.             return getDelegateCallableStatement().getNString(parameterIndex);
  403.         } catch (final SQLException e) {
  404.             handleException(e);
  405.             return null;
  406.         }
  407.     }

  408.     @Override
  409.     public String getNString(final String parameterName) throws SQLException {
  410.         checkOpen();
  411.         try {
  412.             return getDelegateCallableStatement().getNString(parameterName);
  413.         } catch (final SQLException e) {
  414.             handleException(e);
  415.             return null;
  416.         }
  417.     }

  418.     @Override
  419.     public Object getObject(final int parameterIndex) throws SQLException {
  420.         checkOpen();
  421.         try {
  422.             return getDelegateCallableStatement().getObject(parameterIndex);
  423.         } catch (final SQLException e) {
  424.             handleException(e);
  425.             return null;
  426.         }
  427.     }

  428.     @Override
  429.     public <T> T getObject(final int parameterIndex, final Class<T> type) throws SQLException {
  430.         checkOpen();
  431.         try {
  432.             return getDelegateCallableStatement().getObject(parameterIndex, type);
  433.         } catch (final SQLException e) {
  434.             handleException(e);
  435.             return null;
  436.         }
  437.     }

  438.     @Override
  439.     public Object getObject(final int i, final Map<String, Class<?>> map) throws SQLException {
  440.         checkOpen();
  441.         try {
  442.             return getDelegateCallableStatement().getObject(i, map);
  443.         } catch (final SQLException e) {
  444.             handleException(e);
  445.             return null;
  446.         }
  447.     }

  448.     @Override
  449.     public Object getObject(final String parameterName) throws SQLException {
  450.         checkOpen();
  451.         try {
  452.             return getDelegateCallableStatement().getObject(parameterName);
  453.         } catch (final SQLException e) {
  454.             handleException(e);
  455.             return null;
  456.         }
  457.     }

  458.     @Override
  459.     public <T> T getObject(final String parameterName, final Class<T> type) throws SQLException {
  460.         checkOpen();
  461.         try {
  462.             return getDelegateCallableStatement().getObject(parameterName, type);
  463.         } catch (final SQLException e) {
  464.             handleException(e);
  465.             return null;
  466.         }
  467.     }

  468.     @Override
  469.     public Object getObject(final String parameterName, final Map<String, Class<?>> map) throws SQLException {
  470.         checkOpen();
  471.         try {
  472.             return getDelegateCallableStatement().getObject(parameterName, map);
  473.         } catch (final SQLException e) {
  474.             handleException(e);
  475.             return null;
  476.         }
  477.     }

  478.     @Override
  479.     public Ref getRef(final int parameterIndex) throws SQLException {
  480.         checkOpen();
  481.         try {
  482.             return getDelegateCallableStatement().getRef(parameterIndex);
  483.         } catch (final SQLException e) {
  484.             handleException(e);
  485.             return null;
  486.         }
  487.     }

  488.     @Override
  489.     public Ref getRef(final String parameterName) throws SQLException {
  490.         checkOpen();
  491.         try {
  492.             return getDelegateCallableStatement().getRef(parameterName);
  493.         } catch (final SQLException e) {
  494.             handleException(e);
  495.             return null;
  496.         }
  497.     }

  498.     @Override
  499.     public RowId getRowId(final int parameterIndex) throws SQLException {
  500.         checkOpen();
  501.         try {
  502.             return getDelegateCallableStatement().getRowId(parameterIndex);
  503.         } catch (final SQLException e) {
  504.             handleException(e);
  505.             return null;
  506.         }
  507.     }

  508.     @Override
  509.     public RowId getRowId(final String parameterName) throws SQLException {
  510.         checkOpen();
  511.         try {
  512.             return getDelegateCallableStatement().getRowId(parameterName);
  513.         } catch (final SQLException e) {
  514.             handleException(e);
  515.             return null;
  516.         }
  517.     }

  518.     @Override
  519.     public short getShort(final int parameterIndex) throws SQLException {
  520.         checkOpen();
  521.         try {
  522.             return getDelegateCallableStatement().getShort(parameterIndex);
  523.         } catch (final SQLException e) {
  524.             handleException(e);
  525.             return 0;
  526.         }
  527.     }

  528.     @Override
  529.     public short getShort(final String parameterName) throws SQLException {
  530.         checkOpen();
  531.         try {
  532.             return getDelegateCallableStatement().getShort(parameterName);
  533.         } catch (final SQLException e) {
  534.             handleException(e);
  535.             return 0;
  536.         }
  537.     }

  538.     @Override
  539.     public SQLXML getSQLXML(final int parameterIndex) throws SQLException {
  540.         checkOpen();
  541.         try {
  542.             return getDelegateCallableStatement().getSQLXML(parameterIndex);
  543.         } catch (final SQLException e) {
  544.             handleException(e);
  545.             return null;
  546.         }
  547.     }

  548.     @Override
  549.     public SQLXML getSQLXML(final String parameterName) throws SQLException {
  550.         checkOpen();
  551.         try {
  552.             return getDelegateCallableStatement().getSQLXML(parameterName);
  553.         } catch (final SQLException e) {
  554.             handleException(e);
  555.             return null;
  556.         }
  557.     }

  558.     @Override
  559.     public String getString(final int parameterIndex) throws SQLException {
  560.         checkOpen();
  561.         try {
  562.             return getDelegateCallableStatement().getString(parameterIndex);
  563.         } catch (final SQLException e) {
  564.             handleException(e);
  565.             return null;
  566.         }
  567.     }

  568.     @Override
  569.     public String getString(final String parameterName) throws SQLException {
  570.         checkOpen();
  571.         try {
  572.             return getDelegateCallableStatement().getString(parameterName);
  573.         } catch (final SQLException e) {
  574.             handleException(e);
  575.             return null;
  576.         }
  577.     }

  578.     @Override
  579.     public Time getTime(final int parameterIndex) throws SQLException {
  580.         checkOpen();
  581.         try {
  582.             return getDelegateCallableStatement().getTime(parameterIndex);
  583.         } catch (final SQLException e) {
  584.             handleException(e);
  585.             return null;
  586.         }
  587.     }

  588.     @Override
  589.     public Time getTime(final int parameterIndex, final Calendar cal) throws SQLException {
  590.         checkOpen();
  591.         try {
  592.             return getDelegateCallableStatement().getTime(parameterIndex, cal);
  593.         } catch (final SQLException e) {
  594.             handleException(e);
  595.             return null;
  596.         }
  597.     }

  598.     @Override
  599.     public Time getTime(final String parameterName) throws SQLException {
  600.         checkOpen();
  601.         try {
  602.             return getDelegateCallableStatement().getTime(parameterName);
  603.         } catch (final SQLException e) {
  604.             handleException(e);
  605.             return null;
  606.         }
  607.     }

  608.     @Override
  609.     public Time getTime(final String parameterName, final Calendar cal) throws SQLException {
  610.         checkOpen();
  611.         try {
  612.             return getDelegateCallableStatement().getTime(parameterName, cal);
  613.         } catch (final SQLException e) {
  614.             handleException(e);
  615.             return null;
  616.         }
  617.     }

  618.     @Override
  619.     public Timestamp getTimestamp(final int parameterIndex) throws SQLException {
  620.         checkOpen();
  621.         try {
  622.             return getDelegateCallableStatement().getTimestamp(parameterIndex);
  623.         } catch (final SQLException e) {
  624.             handleException(e);
  625.             return null;
  626.         }
  627.     }

  628.     @Override
  629.     public Timestamp getTimestamp(final int parameterIndex, final Calendar cal) throws SQLException {
  630.         checkOpen();
  631.         try {
  632.             return getDelegateCallableStatement().getTimestamp(parameterIndex, cal);
  633.         } catch (final SQLException e) {
  634.             handleException(e);
  635.             return null;
  636.         }
  637.     }

  638.     @Override
  639.     public Timestamp getTimestamp(final String parameterName) throws SQLException {
  640.         checkOpen();
  641.         try {
  642.             return getDelegateCallableStatement().getTimestamp(parameterName);
  643.         } catch (final SQLException e) {
  644.             handleException(e);
  645.             return null;
  646.         }
  647.     }

  648.     @Override
  649.     public Timestamp getTimestamp(final String parameterName, final Calendar cal) throws SQLException {
  650.         checkOpen();
  651.         try {
  652.             return getDelegateCallableStatement().getTimestamp(parameterName, cal);
  653.         } catch (final SQLException e) {
  654.             handleException(e);
  655.             return null;
  656.         }
  657.     }

  658.     @Override
  659.     public URL getURL(final int parameterIndex) throws SQLException {
  660.         checkOpen();
  661.         try {
  662.             return getDelegateCallableStatement().getURL(parameterIndex);
  663.         } catch (final SQLException e) {
  664.             handleException(e);
  665.             return null;
  666.         }
  667.     }

  668.     @Override
  669.     public URL getURL(final String parameterName) throws SQLException {
  670.         checkOpen();
  671.         try {
  672.             return getDelegateCallableStatement().getURL(parameterName);
  673.         } catch (final SQLException e) {
  674.             handleException(e);
  675.             return null;
  676.         }
  677.     }

  678.     @Override
  679.     public void registerOutParameter(final int parameterIndex, final int sqlType) throws SQLException {
  680.         checkOpen();
  681.         try {
  682.             getDelegateCallableStatement().registerOutParameter(parameterIndex, sqlType);
  683.         } catch (final SQLException e) {
  684.             handleException(e);
  685.         }
  686.     }

  687.     @Override
  688.     public void registerOutParameter(final int parameterIndex, final int sqlType, final int scale) throws SQLException {
  689.         checkOpen();
  690.         try {
  691.             getDelegateCallableStatement().registerOutParameter(parameterIndex, sqlType, scale);
  692.         } catch (final SQLException e) {
  693.             handleException(e);
  694.         }
  695.     }

  696.     @Override
  697.     public void registerOutParameter(final int paramIndex, final int sqlType, final String typeName)
  698.             throws SQLException {
  699.         checkOpen();
  700.         try {
  701.             getDelegateCallableStatement().registerOutParameter(paramIndex, sqlType, typeName);
  702.         } catch (final SQLException e) {
  703.             handleException(e);
  704.         }
  705.     }

  706.     /**
  707.      * @since 2.5.0
  708.      */
  709.     @Override
  710.     public void registerOutParameter(final int parameterIndex, final SQLType sqlType) throws SQLException {
  711.         checkOpen();
  712.         try {
  713.             getDelegateCallableStatement().registerOutParameter(parameterIndex, sqlType);
  714.         } catch (final SQLException e) {
  715.             handleException(e);
  716.         }
  717.     }

  718.     /**
  719.      * @since 2.5.0
  720.      */
  721.     @Override
  722.     public void registerOutParameter(final int parameterIndex, final SQLType sqlType, final int scale)
  723.             throws SQLException {
  724.         checkOpen();
  725.         try {
  726.             getDelegateCallableStatement().registerOutParameter(parameterIndex, sqlType, scale);
  727.         } catch (final SQLException e) {
  728.             handleException(e);
  729.         }
  730.     }

  731.     /**
  732.      * @since 2.5.0
  733.      */
  734.     @Override
  735.     public void registerOutParameter(final int parameterIndex, final SQLType sqlType, final String typeName)
  736.             throws SQLException {
  737.         checkOpen();
  738.         try {
  739.             getDelegateCallableStatement().registerOutParameter(parameterIndex, sqlType, typeName);
  740.         } catch (final SQLException e) {
  741.             handleException(e);
  742.         }
  743.     }

  744.     @Override
  745.     public void registerOutParameter(final String parameterName, final int sqlType) throws SQLException {
  746.         checkOpen();
  747.         try {
  748.             getDelegateCallableStatement().registerOutParameter(parameterName, sqlType);
  749.         } catch (final SQLException e) {
  750.             handleException(e);
  751.         }
  752.     }

  753.     @Override
  754.     public void registerOutParameter(final String parameterName, final int sqlType, final int scale)
  755.             throws SQLException {
  756.         checkOpen();
  757.         try {
  758.             getDelegateCallableStatement().registerOutParameter(parameterName, sqlType, scale);
  759.         } catch (final SQLException e) {
  760.             handleException(e);
  761.         }
  762.     }

  763.     @Override
  764.     public void registerOutParameter(final String parameterName, final int sqlType, final String typeName)
  765.             throws SQLException {
  766.         checkOpen();
  767.         try {
  768.             getDelegateCallableStatement().registerOutParameter(parameterName, sqlType, typeName);
  769.         } catch (final SQLException e) {
  770.             handleException(e);
  771.         }
  772.     }

  773.     /**
  774.      * @since 2.5.0
  775.      */
  776.     @Override
  777.     public void registerOutParameter(final String parameterName, final SQLType sqlType) throws SQLException {
  778.         checkOpen();
  779.         try {
  780.             getDelegateCallableStatement().registerOutParameter(parameterName, sqlType);
  781.         } catch (final SQLException e) {
  782.             handleException(e);
  783.         }
  784.     }

  785.     /**
  786.      * @since 2.5.0
  787.      */
  788.     @Override
  789.     public void registerOutParameter(final String parameterName, final SQLType sqlType, final int scale)
  790.             throws SQLException {
  791.         checkOpen();
  792.         try {
  793.             getDelegateCallableStatement().registerOutParameter(parameterName, sqlType, scale);
  794.         } catch (final SQLException e) {
  795.             handleException(e);
  796.         }
  797.     }

  798.     /**
  799.      * @since 2.5.0
  800.      */
  801.     @Override
  802.     public void registerOutParameter(final String parameterName, final SQLType sqlType, final String typeName)
  803.             throws SQLException {
  804.         checkOpen();
  805.         try {
  806.             getDelegateCallableStatement().registerOutParameter(parameterName, sqlType, typeName);
  807.         } catch (final SQLException e) {
  808.             handleException(e);
  809.         }
  810.     }

  811.     @Override
  812.     public void setAsciiStream(final String parameterName, final InputStream inputStream) throws SQLException {
  813.         checkOpen();
  814.         try {
  815.             getDelegateCallableStatement().setAsciiStream(parameterName, inputStream);
  816.         } catch (final SQLException e) {
  817.             handleException(e);
  818.         }
  819.     }

  820.     @Override
  821.     public void setAsciiStream(final String parameterName, final InputStream x, final int length) throws SQLException {
  822.         checkOpen();
  823.         try {
  824.             getDelegateCallableStatement().setAsciiStream(parameterName, x, length);
  825.         } catch (final SQLException e) {
  826.             handleException(e);
  827.         }
  828.     }

  829.     @Override
  830.     public void setAsciiStream(final String parameterName, final InputStream inputStream, final long length)
  831.             throws SQLException {
  832.         checkOpen();
  833.         try {
  834.             getDelegateCallableStatement().setAsciiStream(parameterName, inputStream, length);
  835.         } catch (final SQLException e) {
  836.             handleException(e);
  837.         }
  838.     }

  839.     @Override
  840.     public void setBigDecimal(final String parameterName, final BigDecimal x) throws SQLException {
  841.         checkOpen();
  842.         try {
  843.             getDelegateCallableStatement().setBigDecimal(parameterName, x);
  844.         } catch (final SQLException e) {
  845.             handleException(e);
  846.         }
  847.     }

  848.     @Override
  849.     public void setBinaryStream(final String parameterName, final InputStream inputStream) throws SQLException {
  850.         checkOpen();
  851.         try {
  852.             getDelegateCallableStatement().setBinaryStream(parameterName, inputStream);
  853.         } catch (final SQLException e) {
  854.             handleException(e);
  855.         }
  856.     }

  857.     @Override
  858.     public void setBinaryStream(final String parameterName, final InputStream x, final int length) throws SQLException {
  859.         checkOpen();
  860.         try {
  861.             getDelegateCallableStatement().setBinaryStream(parameterName, x, length);
  862.         } catch (final SQLException e) {
  863.             handleException(e);
  864.         }
  865.     }

  866.     @Override
  867.     public void setBinaryStream(final String parameterName, final InputStream inputStream, final long length)
  868.             throws SQLException {
  869.         checkOpen();
  870.         try {
  871.             getDelegateCallableStatement().setBinaryStream(parameterName, inputStream, length);
  872.         } catch (final SQLException e) {
  873.             handleException(e);
  874.         }
  875.     }

  876.     @Override
  877.     public void setBlob(final String parameterName, final Blob blob) throws SQLException {
  878.         checkOpen();
  879.         try {
  880.             getDelegateCallableStatement().setBlob(parameterName, blob);
  881.         } catch (final SQLException e) {
  882.             handleException(e);
  883.         }
  884.     }

  885.     @Override
  886.     public void setBlob(final String parameterName, final InputStream inputStream) throws SQLException {
  887.         checkOpen();
  888.         try {
  889.             getDelegateCallableStatement().setBlob(parameterName, inputStream);
  890.         } catch (final SQLException e) {
  891.             handleException(e);
  892.         }
  893.     }

  894.     @Override
  895.     public void setBlob(final String parameterName, final InputStream inputStream, final long length)
  896.             throws SQLException {
  897.         checkOpen();
  898.         try {
  899.             getDelegateCallableStatement().setBlob(parameterName, inputStream, length);
  900.         } catch (final SQLException e) {
  901.             handleException(e);
  902.         }
  903.     }

  904.     @Override
  905.     public void setBoolean(final String parameterName, final boolean x) throws SQLException {
  906.         checkOpen();
  907.         try {
  908.             getDelegateCallableStatement().setBoolean(parameterName, x);
  909.         } catch (final SQLException e) {
  910.             handleException(e);
  911.         }
  912.     }

  913.     @Override
  914.     public void setByte(final String parameterName, final byte x) throws SQLException {
  915.         checkOpen();
  916.         try {
  917.             getDelegateCallableStatement().setByte(parameterName, x);
  918.         } catch (final SQLException e) {
  919.             handleException(e);
  920.         }
  921.     }

  922.     @Override
  923.     public void setBytes(final String parameterName, final byte[] x) throws SQLException {
  924.         checkOpen();
  925.         try {
  926.             getDelegateCallableStatement().setBytes(parameterName, x);
  927.         } catch (final SQLException e) {
  928.             handleException(e);
  929.         }
  930.     }

  931.     @Override
  932.     public void setCharacterStream(final String parameterName, final Reader reader) throws SQLException {
  933.         checkOpen();
  934.         try {
  935.             getDelegateCallableStatement().setCharacterStream(parameterName, reader);
  936.         } catch (final SQLException e) {
  937.             handleException(e);
  938.         }
  939.     }

  940.     @Override
  941.     public void setCharacterStream(final String parameterName, final Reader reader, final int length)
  942.             throws SQLException {
  943.         checkOpen();
  944.         getDelegateCallableStatement().setCharacterStream(parameterName, reader, length);
  945.     }

  946.     @Override
  947.     public void setCharacterStream(final String parameterName, final Reader reader, final long length)
  948.             throws SQLException {
  949.         checkOpen();
  950.         try {
  951.             getDelegateCallableStatement().setCharacterStream(parameterName, reader, length);
  952.         } catch (final SQLException e) {
  953.             handleException(e);
  954.         }
  955.     }

  956.     @Override
  957.     public void setClob(final String parameterName, final Clob clob) throws SQLException {
  958.         checkOpen();
  959.         try {
  960.             getDelegateCallableStatement().setClob(parameterName, clob);
  961.         } catch (final SQLException e) {
  962.             handleException(e);
  963.         }
  964.     }

  965.     @Override
  966.     public void setClob(final String parameterName, final Reader reader) throws SQLException {
  967.         checkOpen();
  968.         try {
  969.             getDelegateCallableStatement().setClob(parameterName, reader);
  970.         } catch (final SQLException e) {
  971.             handleException(e);
  972.         }
  973.     }

  974.     @Override
  975.     public void setClob(final String parameterName, final Reader reader, final long length) throws SQLException {
  976.         checkOpen();
  977.         try {
  978.             getDelegateCallableStatement().setClob(parameterName, reader, length);
  979.         } catch (final SQLException e) {
  980.             handleException(e);
  981.         }
  982.     }

  983.     @Override
  984.     public void setDate(final String parameterName, final Date x) throws SQLException {
  985.         checkOpen();
  986.         try {
  987.             getDelegateCallableStatement().setDate(parameterName, x);
  988.         } catch (final SQLException e) {
  989.             handleException(e);
  990.         }
  991.     }

  992.     @Override
  993.     public void setDate(final String parameterName, final Date x, final Calendar cal) throws SQLException {
  994.         checkOpen();
  995.         try {
  996.             getDelegateCallableStatement().setDate(parameterName, x, cal);
  997.         } catch (final SQLException e) {
  998.             handleException(e);
  999.         }
  1000.     }

  1001.     @Override
  1002.     public void setDouble(final String parameterName, final double x) throws SQLException {
  1003.         checkOpen();
  1004.         try {
  1005.             getDelegateCallableStatement().setDouble(parameterName, x);
  1006.         } catch (final SQLException e) {
  1007.             handleException(e);
  1008.         }
  1009.     }

  1010.     @Override
  1011.     public void setFloat(final String parameterName, final float x) throws SQLException {
  1012.         checkOpen();
  1013.         try {
  1014.             getDelegateCallableStatement().setFloat(parameterName, x);
  1015.         } catch (final SQLException e) {
  1016.             handleException(e);
  1017.         }
  1018.     }

  1019.     @Override
  1020.     public void setInt(final String parameterName, final int x) throws SQLException {
  1021.         checkOpen();
  1022.         try {
  1023.             getDelegateCallableStatement().setInt(parameterName, x);
  1024.         } catch (final SQLException e) {
  1025.             handleException(e);
  1026.         }
  1027.     }

  1028.     @Override
  1029.     public void setLong(final String parameterName, final long x) throws SQLException {
  1030.         checkOpen();
  1031.         try {
  1032.             getDelegateCallableStatement().setLong(parameterName, x);
  1033.         } catch (final SQLException e) {
  1034.             handleException(e);
  1035.         }
  1036.     }

  1037.     @Override
  1038.     public void setNCharacterStream(final String parameterName, final Reader reader) throws SQLException {
  1039.         checkOpen();
  1040.         try {
  1041.             getDelegateCallableStatement().setNCharacterStream(parameterName, reader);
  1042.         } catch (final SQLException e) {
  1043.             handleException(e);
  1044.         }
  1045.     }

  1046.     @Override
  1047.     public void setNCharacterStream(final String parameterName, final Reader reader, final long length)
  1048.             throws SQLException {
  1049.         checkOpen();
  1050.         try {
  1051.             getDelegateCallableStatement().setNCharacterStream(parameterName, reader, length);
  1052.         } catch (final SQLException e) {
  1053.             handleException(e);
  1054.         }
  1055.     }

  1056.     @Override
  1057.     public void setNClob(final String parameterName, final NClob value) throws SQLException {
  1058.         checkOpen();
  1059.         try {
  1060.             getDelegateCallableStatement().setNClob(parameterName, value);
  1061.         } catch (final SQLException e) {
  1062.             handleException(e);
  1063.         }
  1064.     }

  1065.     @Override
  1066.     public void setNClob(final String parameterName, final Reader reader) throws SQLException {
  1067.         checkOpen();
  1068.         try {
  1069.             getDelegateCallableStatement().setNClob(parameterName, reader);
  1070.         } catch (final SQLException e) {
  1071.             handleException(e);
  1072.         }
  1073.     }

  1074.     @Override
  1075.     public void setNClob(final String parameterName, final Reader reader, final long length) throws SQLException {
  1076.         checkOpen();
  1077.         try {
  1078.             getDelegateCallableStatement().setNClob(parameterName, reader, length);
  1079.         } catch (final SQLException e) {
  1080.             handleException(e);
  1081.         }
  1082.     }

  1083.     @Override
  1084.     public void setNString(final String parameterName, final String value) throws SQLException {
  1085.         checkOpen();
  1086.         try {
  1087.             getDelegateCallableStatement().setNString(parameterName, value);
  1088.         } catch (final SQLException e) {
  1089.             handleException(e);
  1090.         }
  1091.     }

  1092.     @Override
  1093.     public void setNull(final String parameterName, final int sqlType) throws SQLException {
  1094.         checkOpen();
  1095.         try {
  1096.             getDelegateCallableStatement().setNull(parameterName, sqlType);
  1097.         } catch (final SQLException e) {
  1098.             handleException(e);
  1099.         }
  1100.     }

  1101.     @Override
  1102.     public void setNull(final String parameterName, final int sqlType, final String typeName) throws SQLException {
  1103.         checkOpen();
  1104.         try {
  1105.             getDelegateCallableStatement().setNull(parameterName, sqlType, typeName);
  1106.         } catch (final SQLException e) {
  1107.             handleException(e);
  1108.         }
  1109.     }

  1110.     @Override
  1111.     public void setObject(final String parameterName, final Object x) throws SQLException {
  1112.         checkOpen();
  1113.         try {
  1114.             getDelegateCallableStatement().setObject(parameterName, x);
  1115.         } catch (final SQLException e) {
  1116.             handleException(e);
  1117.         }
  1118.     }

  1119.     @Override
  1120.     public void setObject(final String parameterName, final Object x, final int targetSqlType) throws SQLException {
  1121.         checkOpen();
  1122.         try {
  1123.             getDelegateCallableStatement().setObject(parameterName, x, targetSqlType);
  1124.         } catch (final SQLException e) {
  1125.             handleException(e);
  1126.         }
  1127.     }

  1128.     @Override
  1129.     public void setObject(final String parameterName, final Object x, final int targetSqlType, final int scale)
  1130.             throws SQLException {
  1131.         checkOpen();
  1132.         try {
  1133.             getDelegateCallableStatement().setObject(parameterName, x, targetSqlType, scale);
  1134.         } catch (final SQLException e) {
  1135.             handleException(e);
  1136.         }
  1137.     }

  1138.     /**
  1139.      * @since 2.5.0
  1140.      */
  1141.     @Override
  1142.     public void setObject(final String parameterName, final Object x, final SQLType targetSqlType) throws SQLException {
  1143.         checkOpen();
  1144.         try {
  1145.             getDelegateCallableStatement().setObject(parameterName, x, targetSqlType);
  1146.         } catch (final SQLException e) {
  1147.             handleException(e);
  1148.         }
  1149.     }

  1150.     /**
  1151.      * @since 2.5.0
  1152.      */
  1153.     @Override
  1154.     public void setObject(final String parameterName, final Object x, final SQLType targetSqlType,
  1155.             final int scaleOrLength) throws SQLException {
  1156.         checkOpen();
  1157.         try {
  1158.             getDelegateCallableStatement().setObject(parameterName, x, targetSqlType, scaleOrLength);
  1159.         } catch (final SQLException e) {
  1160.             handleException(e);
  1161.         }
  1162.     }

  1163.     @Override
  1164.     public void setRowId(final String parameterName, final RowId value) throws SQLException {
  1165.         checkOpen();
  1166.         try {
  1167.             getDelegateCallableStatement().setRowId(parameterName, value);
  1168.         } catch (final SQLException e) {
  1169.             handleException(e);
  1170.         }
  1171.     }

  1172.     @Override
  1173.     public void setShort(final String parameterName, final short x) throws SQLException {
  1174.         checkOpen();
  1175.         try {
  1176.             getDelegateCallableStatement().setShort(parameterName, x);
  1177.         } catch (final SQLException e) {
  1178.             handleException(e);
  1179.         }
  1180.     }

  1181.     @Override
  1182.     public void setSQLXML(final String parameterName, final SQLXML value) throws SQLException {
  1183.         checkOpen();
  1184.         try {
  1185.             getDelegateCallableStatement().setSQLXML(parameterName, value);
  1186.         } catch (final SQLException e) {
  1187.             handleException(e);
  1188.         }
  1189.     }

  1190.     @Override
  1191.     public void setString(final String parameterName, final String x) throws SQLException {
  1192.         checkOpen();
  1193.         try {
  1194.             getDelegateCallableStatement().setString(parameterName, x);
  1195.         } catch (final SQLException e) {
  1196.             handleException(e);
  1197.         }
  1198.     }

  1199.     @Override
  1200.     public void setTime(final String parameterName, final Time x) throws SQLException {
  1201.         checkOpen();
  1202.         try {
  1203.             getDelegateCallableStatement().setTime(parameterName, x);
  1204.         } catch (final SQLException e) {
  1205.             handleException(e);
  1206.         }
  1207.     }

  1208.     @Override
  1209.     public void setTime(final String parameterName, final Time x, final Calendar cal) throws SQLException {
  1210.         checkOpen();
  1211.         try {
  1212.             getDelegateCallableStatement().setTime(parameterName, x, cal);
  1213.         } catch (final SQLException e) {
  1214.             handleException(e);
  1215.         }
  1216.     }

  1217.     @Override
  1218.     public void setTimestamp(final String parameterName, final Timestamp x) throws SQLException {
  1219.         checkOpen();
  1220.         try {
  1221.             getDelegateCallableStatement().setTimestamp(parameterName, x);
  1222.         } catch (final SQLException e) {
  1223.             handleException(e);
  1224.         }
  1225.     }

  1226.     @Override
  1227.     public void setTimestamp(final String parameterName, final Timestamp x, final Calendar cal) throws SQLException {
  1228.         checkOpen();
  1229.         try {
  1230.             getDelegateCallableStatement().setTimestamp(parameterName, x, cal);
  1231.         } catch (final SQLException e) {
  1232.             handleException(e);
  1233.         }
  1234.     }

  1235.     @Override
  1236.     public void setURL(final String parameterName, final URL val) throws SQLException {
  1237.         checkOpen();
  1238.         try {
  1239.             getDelegateCallableStatement().setURL(parameterName, val);
  1240.         } catch (final SQLException e) {
  1241.             handleException(e);
  1242.         }
  1243.     }

  1244.     @Override
  1245.     public boolean wasNull() throws SQLException {
  1246.         checkOpen();
  1247.         try {
  1248.             return getDelegateCallableStatement().wasNull();
  1249.         } catch (final SQLException e) {
  1250.             handleException(e);
  1251.             return false;
  1252.         }
  1253.     }

  1254. }