|
Esri Geoportal Server 1.0
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.gpt.framework.sql.ExpressionBinder
public class ExpressionBinder
Aids in the process of binding variables to SQL expressions.
Constructor Summary | |
---|---|
ExpressionBinder()
Default constructor. |
Method Summary | |
---|---|
void |
addBinding(String field,
String binding,
boolean forceUpper,
boolean forceLike)
Adds a bound field filter to the expression. |
void |
addBinding(String field,
String operator,
Object binding)
Adds a bound field filter to the expression. |
void |
addBindings(String field,
String[] bindings,
boolean forceUpper,
boolean forceLike)
Adds a collection of bound field filters to the expression. |
void |
addBindings(String field,
String operator,
Object[] bindings)
Adds a collection of bound field filters to the expression. |
void |
addClause(String expression,
Object[] bindings)
Adds a sub-clause expression. |
int |
applyBindings(PreparedStatement statement,
int startIndex)
Binds variables to a JDBC prepared statement. |
List<Object> |
getBindings()
Gets a list of objects bound to the expression. |
String |
getExpression(boolean includeWhereKeyword)
Gets the SQL where clause expression. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExpressionBinder()
Method Detail |
---|
public void addBinding(String field, String operator, Object binding)
field
- the field nameoperator
- the operator examples: =, !=, >, >=, <, <=, LIKE, ...binding
- the variable to bindpublic void addBinding(String field, String binding, boolean forceUpper, boolean forceLike)
field
- the field namebinding
- the variable to bindforceUpper
- force an upper case comparisonforceLike
- for a LIKE operatorpublic void addBindings(String field, String operator, Object[] bindings)
field
- the field nameoperator
- the operator examples: =, !=, >, >=, <, <=, LIKE, ...bindings
- the array of variables to bindpublic void addBindings(String field, String[] bindings, boolean forceUpper, boolean forceLike)
field
- the field namebindings
- the array of variables to bindforceUpper
- force an upper case comparisonforceLike
- for a LIKE operatorpublic void addClause(String expression, Object[] bindings)
expression
- the sub-clause expressionbindings
- the array of variables bound to the clausepublic int applyBindings(PreparedStatement statement, int startIndex) throws SQLException
statement
- the prepared statementstartIndex
- the starting index for bound statement variables
SQLException
- if an exception occurs while bindingpublic List<Object> getBindings()
public String getExpression(boolean includeWhereKeyword)
includeWhereKeyword
- if true, prefix with "WHERE" if the expression is not empty
|
Esri Geoportal Server 1.0
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |