org.exolab.castor.jdo
public interface OQLQuery extends Query
If the query specified parameters these parameters must be set (bound) before executing the query. Execution of the query will result in an enumeration of all the objects found by the query. The query can be re-executed by binding new parameters and calling the OQLQuery method a second time. A query can be re-execute while objects are still retrieved from a previous execution.
For example:
Query oql; QueryResults results; // Construct a new query and bind the id value oql = db.getQuery( "SELECT ... WHERE id=$1" ); oql.bind( 5 ); results = oql.execute(); // Iterate over all the results and print them while ( results.hasMore() ) { System.out.println( results.next(); ); } results.close(); oql.close();
Version: $Revision: 5951 $ $Date: 2004-10-01 14:44:12 -0600 (Fri, 01 Oct 2004) $
See Also: Query
Method Summary | |
---|---|
void | create(String query)
Creates an OQL query from the supplied statement.
|
Parameters: query An OQL query statement
Throws: PersistenceException