com.f1j.data.query
Interface DatabaseQueryParameter


public interface DatabaseQueryParameter

Represents a database query parameter for a parameterized SQL query. Can represent both input and output parameters.

See Also:
DatabaseQuery.getParameterCollection(), DatabaseQueryParamCollection

Field Summary
static short eAdHocFalse
          Ad-Hoc Constant - Ad-Hoc condition that resolves as false when not present.
static short eAdHocTrue
          Ad-Hoc Constant - Ad-Hoc condition that resolves as true when not present.
 
Method Summary
 java.lang.String getColumn()
          Returns the name of the column associated with this parameter.
 int getIndex()
          Returns the 0-based index of this query parameter.
 java.lang.String getName()
          Returns the name of this query parameter.
 int getType()
          Returns the parameter type of the specified index.
 java.lang.String getValue()
          Returns the value of this parameter.
 boolean isAdHocParameter()
          Indicates if this query parameter is an AdHoc parameter.
 boolean isAdHocTrue()
          Indicates if this adhoc query parameter defaults to true.
 boolean isInputParameter()
          Indicates if this query parameter is an input parameter.
 boolean isNamedParameter()
          Indicates if this query parameter is identified by it's name rather than it's position.
 boolean isOutputParameter()
          Indicates if this query parameter is the output parameter.
 void setValue(java.lang.String s)
          Sets the value of this parameter.
 

Field Detail

eAdHocTrue

public static final short eAdHocTrue
Ad-Hoc Constant - Ad-Hoc condition that resolves as true when not present.

eAdHocFalse

public static final short eAdHocFalse
Ad-Hoc Constant - Ad-Hoc condition that resolves as false when not present.
Method Detail

getColumn

public java.lang.String getColumn()
Returns the name of the column associated with this parameter. Only useful for ad-hoc parameters.
Returns:
name of associated column.

getIndex

public int getIndex()
Returns the 0-based index of this query parameter. Indicates which parameter in the SQL query this object refers to.
Returns:
0-based index of query parameter
See Also:
DatabaseQueryParamCollection.addInputParameter(int, int, java.lang.String), DatabaseQueryParamCollection.setOutputParameterInfo(int, int)

getName

public java.lang.String getName()
Returns the name of this query parameter. This name is not used for anything but display purposes.
Returns:
name of query parameter
See Also:
DatabaseQueryParamCollection.addInputParameter(int, int, java.lang.String), DatabaseQueryParamCollection.setOutputParameterInfo(int, int)

getType

public int getType()
Returns the parameter type of the specified index. Can be one of the following:

Parameterized Query Data 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
Output Parameter Types Only:
java.sql.Types.VARBINARY java.sql.Types.BINARY java.sql.Types.LONGVARBINARY
oracle.jdbc.OracleTypes.CURSOR
Returns:
query parameter type
See Also:
DatabaseQueryParamCollection.addInputParameter(int, int, java.lang.String), DatabaseQueryParamCollection.setOutputParameterInfo(int, int)

getValue

public java.lang.String getValue()
Returns the value of this parameter.
Returns:
a string representing the cell location (e.g., A1), or a name assigned using the addInputParameter method, or a value input with the setOutputParameterInfo method.
See Also:
DatabaseQueryParamCollection.addInputParameter(int, int, java.lang.String)

setValue

public void setValue(java.lang.String s)
Sets the value of this parameter.
Parameters:
s - A string representation of the value of this parameter.
See Also:
DatabaseQueryParamCollection.addInputParameter(int, int, java.lang.String)

isAdHocParameter

public boolean isAdHocParameter()
Indicates if this query parameter is an AdHoc parameter.
Returns:
boolean. true = this query parameter is an adhoc parameter.

isAdHocTrue

public boolean isAdHocTrue()
Indicates if this adhoc query parameter defaults to true.
Returns:
boolean true = this ahdoc query parameter defaults to true.

isOutputParameter

public boolean isOutputParameter()
Indicates if this query parameter is the output parameter.
Returns:
boolean. true = this query parameter is the output parameter.
See Also:
isInputParameter(), DatabaseQueryParamCollection.setOutputParameterInfo(int, int)

isInputParameter

public boolean isInputParameter()
Indicates if this query parameter is an input parameter.
Returns:
boolean. true = this query parameter is an input parameter.
See Also:
isOutputParameter(), DatabaseQueryParamCollection.addInputParameter(int, int, java.lang.String)

isNamedParameter

public boolean isNamedParameter()
Indicates if this query parameter is identified by it's name rather than it's position.
Returns:
boolean. true = this query parameter is identified by name.