public class FBProcedureCall
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static boolean |
OLD_CALLABLE_STATEMENT_COMPATIBILITY
true if the old callable statement compatibility mode should
be used, otherwise - false . |
Constructor and Description |
---|
FBProcedureCall() |
Modifier and Type | Method and Description |
---|---|
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,
java.lang.String param)
Add call parameter.
|
void |
checkParameters()
Checks if all parameters have been set.
|
java.lang.Object |
clone() |
boolean |
equals(java.lang.Object obj)
Check if
obj is equal to this instance. |
FBProcedureParam |
getInputParam(int index)
Get input parameter by the specified index.
|
java.util.List<FBProcedureParam> |
getInputParams()
Get the list of input parameters for this procedure call.
|
java.lang.String |
getName()
Get the name of the procedure to be called.
|
FBProcedureParam |
getOutputParam(int index)
Get the output parameter at the specified index.
|
java.util.List<FBProcedureParam> |
getOutputParams()
Get a list of output parameters for this procedure call.
|
java.lang.String |
getSQL(boolean select)
Get native SQL for the specified procedure call.
|
int |
hashCode() |
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(java.lang.String name)
Set the name of the procedure to be called.
|
public static final boolean OLD_CALLABLE_STATEMENT_COMPATIBILITY
true
if the old callable statement compatibility mode should
be used, otherwise - false
. Current value - true
.public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String getName()
public void setName(java.lang.String name)
name
- The name of the procedurepublic FBProcedureParam getInputParam(int index)
index
- index for which parameter has to be returned, first
index is 1FBProcedureParam
.public FBProcedureParam getOutputParam(int index)
index
- The index of the parameter, first index is 1public int mapOutParamIndexToPosition(int index) throws FBSQLException
index
- index to map.index
if no output parameter
with the specified index found (assuming that OLD_CALLABLE_STATEMENT_COMPATIBILITY
constant is set to true
, otherwise throws exception).FBSQLException
- if compatibility mode is switched off and no
parameter was found (see OLD_CALLABLE_STATEMENT_COMPATIBILITY
constant).public int mapOutParamIndexToPosition(int index, boolean compatibilityMode) throws FBSQLException
index
- index to map.compatibilityMode
- true
if we should run in old
compatibility mode.index
if no output parameter
with the specified index found and compatibilityMode
is set.FBSQLException
- if compatibility mode is switched off and no
parameter was found.public java.util.List<FBProcedureParam> getInputParams()
public java.util.List<FBProcedureParam> getOutputParams()
public void addInputParam(FBProcedureParam param)
param
- The parameter to be addedpublic void addOutputParam(FBProcedureParam param)
param
- The parameter to be addedpublic FBProcedureParam addParam(int position, java.lang.String param)
position
- position of the parameter in the procedure call.param
- contents of the parameter.FBProcedureParam
that was created to
represent this parameter.public void registerOutParam(int index, int type) throws java.sql.SQLException
index
- index of the parameter to mark as output.type
- SQL type of the parameter.java.sql.SQLException
- if something went wrong.public java.lang.String getSQL(boolean select) throws FBSQLException
FBSQLException
public void checkParameters() throws java.sql.SQLException
java.sql.SQLException
- When some parameters don't have values, and are not registered as an out parameter.public boolean equals(java.lang.Object obj)
obj
is equal to this instance.equals
in class java.lang.Object
true
iff obj
is instance of this class
representing the same procedure with the same parameters.public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2001-2019 Jaybird (Firebird JDBC/JCA) team. All rights reserved.