com.f1j.data.query
Interface DatabaseQueryParamCollection


public interface DatabaseQueryParamCollection

A collection containing API for setting parameter types and values for parameterized SQL queries.

See Also:
DatabaseQuery.getParameterCollection(), DatabaseQueryParameter

Field Summary
static int FLAG_ADFALSE_PARAMETER
          Indicates that the parameter is an ad-hoc false parameter
static int FLAG_ADHOC_PARAMETER
          Indicates that the parameter is an ad-hoc true parameter
static int FLAG_NAMED_PARAMETER
          Indicates that the parameter is named.
 
Method Summary
 void addInputParameter(int index, int flags, int type, java.lang.String value, java.lang.String name)
          Adds an input parameter with the specified index, flags, type, and value to this collection.
 void addInputParameter(int index, int flags, int type, java.lang.String value, java.lang.String column, java.lang.String name)
          Adds an input parameter with the specified index, type, value, and column to this collection.
 void addInputParameter(int index, int type, java.lang.String value)
          Adds an input parameter with the specified index, flags, type, and value to this collection.
 void addInputParameter(int index, int type, java.lang.String value, java.lang.String name)
          Adds an input parameter with the specified index, type, and value to this collection.
 void clear()
          Removes all parameters from this collection.
 void clearOutputParameterInfo()
          Deprecated. As of Formula One 10, use clear() or removeParameter(int).
 DatabaseQueryParameter[] get()
          Returns an ordered array of the parameters contained in this collection.
 int getInputParameterCount()
          Returns the number of input parameters in this collection.
 DatabaseQueryParameter getNamedParameter(java.lang.String name)
          Returns the parameter with the specified name.
 DatabaseQueryParameter getOutputParameter()
          Deprecated. As of Formula One 10, use getNamedParameter(String) or getParameter(int).
 int getOutputParameterCount()
          Returns the number of output parameters in this collection.
 DatabaseQueryParameter getParameter(int index)
          Returns the parameter with the specified parameter index.
 boolean isContainsInputParameters()
          Returns whether this collection contains any input parameters.
 boolean isContainsOutputParameter()
          Deprecated. As of Formula One 10, use isContainsOutputParameters().
 boolean isContainsOutputParameters()
          Returns whether this collection contains output parameters.
 boolean isParameterRequired(java.lang.String paramName)
          Returns whether this collection requires the specified parameter.
 boolean isParameterUsed(java.lang.String paramName)
          Returns whether this collection uses the specified report parameter.
 void removeParameter(int index)
          Removes the parameter with the specified parameter index from this collection.
 void removeParameter(java.lang.String name)
          Removes the parameter with the specified parameter name from this collection
 void setOutputParameterInfo(int index, int type)
          Adds output parameter information to this collection.
 void setOutputParameterInfo(int index, int type, java.lang.String name)
          Adds output parameter information to this collection.
 

Field Detail

FLAG_NAMED_PARAMETER

public static final int FLAG_NAMED_PARAMETER
Indicates that the parameter is named.

FLAG_ADHOC_PARAMETER

public static final int FLAG_ADHOC_PARAMETER
Indicates that the parameter is an ad-hoc true parameter

FLAG_ADFALSE_PARAMETER

public static final int FLAG_ADFALSE_PARAMETER
Indicates that the parameter is an ad-hoc false parameter
Method Detail

addInputParameter

public void addInputParameter(int index,
                              int type,
                              java.lang.String value)
                       throws F1Exception
Adds an input parameter with the specified index, flags, type, and value to this collection. If an input parameter with the specified index already exists in this collection, it is overridden with the new type and value passed to this method. If the value parameter is null, the SQL value NULL will be inserted into the query at the specified index. The value argument should be a value that is valid for the type specified by the type argument. To specify a formula or cell reference, set the type argument to com.f1j.ss.Constants.eQueryParamFormula.

The type parameter can be any of the following SQL types:

Input Query Parameter SQL Types
java.sql.Types.CHAR java.sql.Types.VARCHAR java.sql.Types.LONGVARCHAR
java.sql.Types.NUMERIC java.sql.Types.DECIMAL java.sql.Types.INTEGER
java.sql.Types.SMALLINT java.sql.Types.FLOAT java.sql.Types.REAL
java.sql.Types.DOUBLE java.sql.Types.BIGINT java.sql.Types.TINYINT
java.sql.Types.TIMESTAMP java.sql.Types.DATE java.sql.Types.TIME
java.sql.Types.BIT

The type parameter can also be an Actuate type:

Input Query Parameter Actuate Types
com.f1j.ss.Constants.eQueryParamString- Actuate String Parameter
com.f1j.ss.Constants.eQueryParamInteger- Actuate Integer Parameter
com.f1j.ss.Constants.eQueryParamDouble- Actuate Double Parameter
com.f1j.ss.Constants.eQueryParamDate- Actuate Date Parameter
com.f1j.ss.Constants.eQueryParamCurrency- Actuate Currency Parameter
com.f1j.ss.Constants.eQueryParamFormula- Parameter type to use for a formula or cell reference
Parameters:
index - 0-based parameter index.
type - query parameter SQL type, see above for list of valid types.
value - value of the parameter, can be null.
Throws:
F1Exception - if can't add the parameter.
See Also:
addInputParameter(int index,int type, String value,String name)

addInputParameter

public void addInputParameter(int index,
                              int type,
                              java.lang.String value,
                              java.lang.String name)
                       throws F1Exception
Adds an input parameter with the specified index, type, and value to this collection. If an input parameter with the specified index already exists in this collection, it is overridden with the new type and value passed to this method. If the value parameter is null, the SQL value NULL is inserted into the query at the specified index. The value argument should be a value that is valid for the type specified by the type argument. To specify a formula or cell reference, set the type argument to com.f1j.ss.Constants.eQueryParamFormula.

The type parameter can be any of the following:

Input Query Parameter Types
java.sql.Types.CHAR java.sql.Types.VARCHAR java.sql.Types.LONGVARCHAR
java.sql.Types.NUMERIC java.sql.Types.DECIMAL java.sql.Types.INTEGER
java.sql.Types.SMALLINT java.sql.Types.FLOAT java.sql.Types.REAL
java.sql.Types.DOUBLE java.sql.Types.BIGINT java.sql.Types.TINYINT
java.sql.Types.TIMESTAMP java.sql.Types.DATE java.sql.Types.TIME
java.sql.Types.BIT

The type parameter can also be an Actuate type:

Input Query Parameter Actuate Types
com.f1j.ss.Constants.eQueryParamString- Actuate String Parameter
com.f1j.ss.Constants.eQueryParamInteger- Actuate Integer Parameter
com.f1j.ss.Constants.eQueryParamDouble- Actuate Double Parameter
com.f1j.ss.Constants.eQueryParamDate- Actuate Date Parameter
com.f1j.ss.Constants.eQueryParamCurrency- Actuate Currency Parameter
com.f1j.ss.Constants.eQueryParamFormula- Parameter type to use for a formula or cell reference
Parameters:
index - 0-based parameter index
type - query parameter SQL type, see above for list of valid types
value - value of the parameter, can be null
name - display name of parameter, can be null
Throws:
F1Exception - if can't add the parameter.
See Also:
addInputParameter(int index,int type,String value)

addInputParameter

public void addInputParameter(int index,
                              int flags,
                              int type,
                              java.lang.String value,
                              java.lang.String name)
                       throws F1Exception
Adds an input parameter with the specified index, flags, type, and value to this collection. If an input parameter with the specified index already exists in this collection, it is overridden with the new type and value passed to this method. If the value parameter is null, the SQL value NULL is inserted into the query at the specified index. The value argument should be a value that is valid for the type specified by the type argument. To specify a formula or cell reference, set the type argument to com.f1j.ss.Constants.eQueryParamFormula.

The type parameter can be any of the following:

Input Query Parameter Types
java.sql.Types.CHAR java.sql.Types.VARCHAR java.sql.Types.LONGVARCHAR
java.sql.Types.NUMERIC java.sql.Types.DECIMAL java.sql.Types.INTEGER
java.sql.Types.SMALLINT java.sql.Types.FLOAT java.sql.Types.REAL
java.sql.Types.DOUBLE java.sql.Types.BIGINT java.sql.Types.TINYINT
java.sql.Types.TIMESTAMP java.sql.Types.DATE java.sql.Types.TIME
java.sql.Types.BIT

The type parameter can also be an Actuate type:

Input Query Parameter Actuate Types
com.f1j.ss.Constants.eQueryParamString- Actuate String Parameter
com.f1j.ss.Constants.eQueryParamInteger- Actuate Integer Parameter
com.f1j.ss.Constants.eQueryParamDouble- Actuate Double Parameter
com.f1j.ss.Constants.eQueryParamDate- Actuate Date Parameter
com.f1j.ss.Constants.eQueryParamCurrency- Actuate Currency Parameter
com.f1j.ss.Constants.eQueryParamFormula- Parameter type to use for a formula or cell reference
Parameters:
index - 0-based parameter index
flags - extra flags beyond the input/output flags.
type - query parameter SQL type, see above for list of valid types
value - value of the parameter, can be null
name - display name of parameter, can be null
Throws:
F1Exception - if can't add the parameter.
See Also:
addInputParameter(int index,int type,String value)

addInputParameter

public void addInputParameter(int index,
                              int flags,
                              int type,
                              java.lang.String value,
                              java.lang.String column,
                              java.lang.String name)
                       throws F1Exception
Adds an input parameter with the specified index, type, value, and column to this collection. If an input parameter with the specified index already exists in this collection, it is overridden with the new type and value passed to this method. If the value parameter is null, the SQL value NULL is inserted into the query at the specified index. The value argument should be a value that is valid for the type specified by the type argument. To specify a formula or cell reference, set the type argument to com.f1j.ss.Constants.eQueryParamFormula.

The type parameter can be any of the following:

Input Query Parameter Types
java.sql.Types.CHAR java.sql.Types.VARCHAR java.sql.Types.LONGVARCHAR
java.sql.Types.NUMERIC java.sql.Types.DECIMAL java.sql.Types.INTEGER
java.sql.Types.SMALLINT java.sql.Types.FLOAT java.sql.Types.REAL
java.sql.Types.DOUBLE java.sql.Types.BIGINT java.sql.Types.TINYINT
java.sql.Types.TIMESTAMP java.sql.Types.DATE java.sql.Types.TIME
java.sql.Types.BIT

The type parameter can also be an Actuate type:

Input Query Parameter Actuate Types
com.f1j.ss.Constants.eQueryParamString- Actuate String Parameter
com.f1j.ss.Constants.eQueryParamInteger- Actuate Integer Parameter
com.f1j.ss.Constants.eQueryParamDouble- Actuate Double Parameter
com.f1j.ss.Constants.eQueryParamDate- Actuate Date Parameter
com.f1j.ss.Constants.eQueryParamCurrency- Actuate Currency Parameter
com.f1j.ss.Constants.eQueryParamFormula- Parameter type to use for a formula or cell reference
Parameters:
index - 0-based parameter index
flags - indicates the parameter type (Unnamed, Named, Adhoc, Input, Output)
type - query parameter SQL type, see above for list of valid types
value - value of the parameter, can be null
column - column
name - display name of parameter, can be null
Throws:
F1Exception - if parameter couldn't be added.
See Also:
addInputParameter(int index,int type,String value)

clear

public void clear()
Removes all parameters from this collection.
See Also:
removeParameter(int)

clearOutputParameterInfo

public void clearOutputParameterInfo()
Deprecated. As of Formula One 10, use clear() or removeParameter(int).
Clears any existing output parameter information.
See Also:
clear(), removeParameter(int)

get

public DatabaseQueryParameter[] get()
Returns an ordered array of the parameters contained in this collection. Parameters are arranged by index value.
Returns:
ordered array of parameters. See tables at the addInputParameter and setOutputParameterInfo methods.
See Also:
getParameter(int)

getInputParameterCount

public int getInputParameterCount()
Returns the number of input parameters in this collection.
Returns:
an integer indicating the number of parameters.
See Also:
addInputParameter(int, int, java.lang.String), isContainsInputParameters()

getOutputParameterCount

public int getOutputParameterCount()
Returns the number of output parameters in this collection.
Returns:
an integer indicating the number of parameters.
See Also:
addInputParameter(int, int, java.lang.String), isContainsInputParameters()

getOutputParameter

public DatabaseQueryParameter getOutputParameter()
Deprecated. As of Formula One 10, use getNamedParameter(String) or getParameter(int).
Returns the output parameter.
Returns:
the output parameter, or null if no output parameter info exists. See table at the setOutputParameterInfo method.
See Also:
setOutputParameterInfo(int, int), isContainsOutputParameters()

getNamedParameter

public DatabaseQueryParameter getNamedParameter(java.lang.String name)
Returns the parameter with the specified name.
Parameters:
name - the name of the parameter to find and return.
Returns:
the parameter with the specified name, or null.

getParameter

public DatabaseQueryParameter getParameter(int index)
Returns the parameter with the specified parameter index.
Parameters:
index - 0-based parameter index.
Returns:
parameter object with the specified index, or null if no parameter exists with that index.
See Also:
removeParameter(int)

isContainsInputParameters

public boolean isContainsInputParameters()
Returns whether this collection contains any input parameters.
Returns:
boolean. true = collection contains input parameters.
See Also:
addInputParameter(int, int, java.lang.String)

isContainsOutputParameter

public boolean isContainsOutputParameter()
Deprecated. As of Formula One 10, use isContainsOutputParameters().
Returns whether this collection contains an output parameter.
Returns:
boolean. true = collection contains an output parameter.
See Also:
setOutputParameterInfo(int, int)

isContainsOutputParameters

public boolean isContainsOutputParameters()
Returns whether this collection contains output parameters.
Returns:
boolean. true = collection contains output parameters.
See Also:
setOutputParameterInfo(int, int)

isParameterUsed

public boolean isParameterUsed(java.lang.String paramName)
Returns whether this collection uses the specified report parameter.
Parameters:
paramName - The name of the parameter.
Returns:
boolean true = collection uses the specified parameter.

isParameterRequired

public boolean isParameterRequired(java.lang.String paramName)
Returns whether this collection requires the specified parameter.
Parameters:
paramName - The name of the parameter.
Returns:
boolean true = collection requires the specified parameter.

removeParameter

public void removeParameter(int index)
Removes the parameter with the specified parameter index from this collection.
Parameters:
index - 0-based index of the parameter to be removed.
See Also:
getParameter(int)

removeParameter

public void removeParameter(java.lang.String name)
Removes the parameter with the specified parameter name from this collection
Parameters:
name - name of the parameter to be removed.
See Also:
getNamedParameter(java.lang.String)

setOutputParameterInfo

public void setOutputParameterInfo(int index,
                                   int type)
Adds output parameter information to this collection.

The type parameter can be any of the following:

Allowed Output Parameter Types
java.sql.Types.CHAR java.sql.Types.VARCHAR java.sql.Types.LONGVARCHAR
java.sql.Types.VARBINARY java.sql.Types.BINARY java.sql.Types.LONGVARBINARY
oracle.jdbc.OracleTypes.CURSOR
Parameters:
index - 0-based index of the output parameter.
type - type of the output parameter. See table above for a list of valid types.

setOutputParameterInfo

public void setOutputParameterInfo(int index,
                                   int type,
                                   java.lang.String name)
Adds output parameter information to this collection.

The type parameter can be any of the following:

Allowed Output Parameter Types
java.sql.Types.CHAR java.sql.Types.VARCHAR java.sql.Types.LONGVARCHAR
java.sql.Types.VARBINARY java.sql.Types.BINARY java.sql.Types.LONGVARBINARY
oracle.jdbc.OracleTypes.CURSOR
Parameters:
index - 0-based index of the output parameter.
type - type of the output parameter, see above for list of valid types.
name - display name of this parameter, can be null.
See Also:
setOutputParameterInfo(int index,int type)