Class allaire.dcf.recordset.Query
All Packages Class Hierarchy This Package Previous Next Index
Class allaire.dcf.recordset.Query
java.lang.Object
|
+----allaire.dcf.recordset.Query
- public class Query
- extends Object
A class that executes Cold Fusion templates on remote servers.
The templates typically contain one or more SQL queries
which are returned in text format and then parsed into Recordset
objects for use by the client object.
- See Also:
- Recordset
-
Query(String)
- Create a new query object which is linked to a template
on a remote server.
-
addParam(String, String)
- Add a named parameter to the query (the parameter will be
URL encoded and appended to the URL submitted to the
remote server).
-
execute()
- Execute the template on the remote server using the specified
parameters.
-
getRecordset()
- Gets the recordset fetched by the query from the remote
template.
-
getRecordset(String)
- Gets a named recordset fetched by the query from
the remote template.
-
getRecordsets()
- Gets all of the Recordsets fetched by the query from
the remote server.
-
resetParams()
- Reset the parameter list to empty.
Query
public Query(String strTemplateURL)
- Create a new query object which is linked to a template
on a remote server. Constructing a Query object does not
cause the Query to be executed (this is accomplished using
the execute() method).
- Parameters:
- strTemplateURL - The fully qualified URL of the
template be used by the Query.
addParam
public void addParam(String strName,
String strValue)
- Add a named parameter to the query (the parameter will be
URL encoded and appended to the URL submitted to the
remote server).
- Parameters:
- strName - The name of the parameter.
- strValue - The value of the parameter.
resetParams
public void resetParams()
- Reset the parameter list to empty. This erases all parameters
previously added using the addParam() method.
execute
public void execute() throws Exception
- Execute the template on the remote server using the specified
parameters. All Recordsets returned by the template will be
parsed and made available using the getRecordset member functions.
- Throws: Exception
- Throws an exception if one of several types
of error occurs including:
- A malformed URL was used to construct the Query.
- A network I/O error occurs.
- A database or syntax error occurs in the template.
- The Recordset syntax in the template is invalid.
getRecordset
public Recordset getRecordset() throws Exception
- Gets the recordset fetched by the query from the remote
template. Use this version of getRecordset when the template
returns a single (typically unnamed) Recordset.
- Returns:
- The Recordset fetched by the query.
- Throws: Exception
- Throws an exception if no Recordset
was returned by the query.
getRecordset
public Recordset getRecordset(String strName) throws Exception
- Gets a named recordset fetched by the query from
the remote template. Use this version of getRecordset when
the template returns multiple, named Recordsets. Note
that Recordset names are case-sensitive.
- Parameters:
- strName - The name of the Recordset to retreive.
- Returns:
- The Recordset with the specified name.
- Throws: Exception
- Throws an exception if no Recordset
with the passed name was returned by the Query.
getRecordsets
public Dictionary getRecordsets()
- Gets all of the Recordsets fetched by the query from
the remote server.
- Returns:
- A Dictionary (keyed by Recordset name) containing
all of the Recordsets returned by the Query.
All Packages Class Hierarchy This Package Previous Next Index