## org.firebirdsql.jdbc
Class FBProcedureCall

    java.lang.Object
      org.firebirdsql.jdbc.FBProcedureCall

All Implemented Interfaces:
  Cloneable

    public class FBProcedureCall

extends Object
implements Cloneable

Represents procedure call.

Field Summary
`static boolean` `OLD_CALLABLE_STATEMENT_COMPATIBILITY` `true` if the old callable statement compatibility mode should be used, otherwise - `false`.

Constructor Summary
`FBProcedureCall()`

Method Summary
`void` `addInputParam(FBProcedureParam param)` Add an input parameter to this procedure call.
`void` `addOutputParam(FBProcedureParam param)` Add an output parameter to this procedure call.
`FBProcedureParam` `addParam(int position, String param)` Add call parameter.
`Object` `clone()`
`boolean` `equals(Object obj)` Check if `obj` is equal to this instance.
`FBProcedureParam` `getInputParam(int index)` Get input parameter by the specified index.
`List` `getInputParams()` Get the list of input parameters for this procecedure call.
`String` `getName()` Get the name of the procedure to be called.
`FBProcedureParam` `getOutputParam(int index)` Get the output parameter at the specified index.
`List` `getOutputParams()` Get a list of output parameters for this procedure call.
`String` `getSQL(boolean select)` Get native SQL for the specified procedure call.
`int` `mapOutParamIndexToPosition(int index)` Map output parameter index to a column number of corresponding result set.
`int` `mapOutParamIndexToPosition(int index, boolean compatibilityMode)` Map output parameter index to a column number of corresponding result set.
`void` `registerOutParam(int index, int type)` Register output parameter.
`void` `setName(String name)` Set the name of the procedure to be called.

Methods inherited from class java.lang.Object
`finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### OLD_CALLABLE_STATEMENT_COMPATIBILITY

    public static final boolean OLD_CALLABLE_STATEMENT_COMPATIBILITY

  `true` if the old callable statement compatibility mode should be used, otherwise - `false`. Current value - `true`.

  See Also:
    Constant Field Values

Constructor Detail

### FBProcedureCall

    public FBProcedureCall()

Method Detail

### clone

    public Object clone()

  Overrides:
    `clone` in class `Object`

### getName

    public String getName()

  Get the name of the procedure to be called.

  Returns:
    The procedure name

### setName

    public void setName(String name)

  Set the name of the procedure to be called.

  Parameters:
    `name` - The name of the procedure

### getInputParam

    public FBProcedureParam getInputParam(int index)

  Get input parameter by the specified index.

  Parameters:
    `index` - index for which parameter has to be returned, first index is 1
  Returns:
    instance of `FBProcedureParam`.

### getOutputParam

    public FBProcedureParam getOutputParam(int index)

  Get the output parameter at the specified index.

  Parameters:
    `index` - The index of the parameter, first index is 1
  Returns:
    The parameter at the given index

### mapOutParamIndexToPosition

    public int mapOutParamIndexToPosition(int index)
                                   throws FBSQLException

  Map output parameter index to a column number of corresponding result set.

  Parameters:
    `index` - index to map.
  Returns:
    mapped column number or `index` if no output parameter with the specified index found (assuming that `OLD_CALLABLE_STATEMENT_COMPATIBILITY` constant is set to `true`, otherwise throws exception).
  Throws:
    `FBSQLException` - if compatibility mode is switched off and no parameter was found (see `OLD_CALLABLE_STATEMENT_COMPATIBILITY` constant).

### mapOutParamIndexToPosition

    public int mapOutParamIndexToPosition(int index,
                                          boolean compatibilityMode)
                                   throws FBSQLException

  Map output parameter index to a column number of corresponding result set.

  Parameters:
    `index` - index to map.
    `compatibilityMode` - `true` if we should run in old compatibility mode.
  Returns:
    mapped column number or `index` if no output parameter with the specified index found and `compatibilityMode` is set.
  Throws:
    `FBSQLException` - if compatibility mode is switched off and no parameter was found.

### getInputParams

    public List getInputParams()

  Get the list of input parameters for this procecedure call.

  Returns:
    A list of all input parameters

### getOutputParams

    public List getOutputParams()

  Get a list of output parameters for this procedure call.

  Returns:
    A list of all output parameters

### addInputParam

    public void addInputParam(FBProcedureParam param)

  Add an input parameter to this procedure call.

  Parameters:
    `param` - The parameter to be added

### addOutputParam

    public void addOutputParam(FBProcedureParam param)

  Add an output parameter to this procedure call.

  Parameters:
    `param` - The parameter to be added

### addParam

    public FBProcedureParam addParam(int position,
                                     String param)

  Add call parameter. This method adds new parameter to the procedure call and tries to automatically place the parameter into the right collection if it contains a hint whether it is input or output parameter.

  Parameters:
    `position` - position of the parameter in the procedure call.
    `param` - contents of the parameter.
  Returns:
    instance of the `FBProcedureParam` that was created to represent this parameter.

### registerOutParam

    public void registerOutParam(int index,
                                 int type)
                          throws SQLException

  Register output parameter. This method marks parameter with the specified index as output. Parameters marked as output cannot be used as input parameters.

  Parameters:
    `index` - index of the parameter to mark as output.
    `type` - SQL type of the parameter.
  Throws:
    `SQLException` - if something went wrong.

### getSQL

    public String getSQL(boolean select)
                  throws FBSQLException

  Get native SQL for the specified procedure call.

  Returns:
    native SQL that can be executed by the database server.
  Throws:
    `FBSQLException`

### equals

    public boolean equals(Object obj)

  Check if `obj` is equal to this instance.

  Overrides:
    `equals` in class `Object`
  Returns:
    `true` iff `obj` is instance of this class representing the same procedure with the same parameters.

Copyright © 2001-2010. All Rights Reserved.