org.exolab.castor.jdo
Interface OQLQuery

All Superinterfaces:
Query

public interface OQLQuery
extends Query

An OQL query object. Obtained from the database and used to construct and execute a query on that database. All query operations are bound to the database transaction. Closing the database or the transaction will effectively close the 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 Query.execute() 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=$" );
 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: 1.2 $ $Date: 2003/06/19 04:26:53 $
Author:
Assaf Arkin
See Also:
Query

Method Summary
 void create(java.lang.String query)
          Creates an OQL query from the supplied statement.
 
Methods inherited from interface org.exolab.castor.jdo.Query
bind, bind, bind, bind, bind, bind, bind, close, execute, execute, execute, execute
 

Method Detail

create

public void create(java.lang.String query)
            throws QueryException
Creates an OQL query from the supplied statement.

Parameters:
query - An OQL query statement
Throws:
QueryException - The query syntax is invalid


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com