org.sixdml.command
Interface SixdmlPreparedStatement


public interface SixdmlPreparedStatement

 SixdmlPreparedStatement.java

 This class is used to store and execute pre-compiled SiXDML statements over the database. It is assumed 
 that implementers of this interface will have the query specified in their constructor. 

 Created: Sun Feb 24 01:31:41 2002
 

Version:
1.0
Author:
Dare Obasanjo
See Also:
SixdmlStatementService.prepareStatement(String)

Method Summary
 Document execute()
          Executes a SiXDML statement against the database and returns the results as an XML DOM object.
 void execute(DefaultHandler handler)
          Executes a SiXDML statement against the database and feeds the results to a SAX handler.
 void execute(OutputStream outputStream)
          Executes a SiXDML statement against the database and writes the results to the specified OutputStream.
 void execute(Writer writer)
          Executes a SiXDML statement against the database and writes the results using the specified writer.
 void setObject(int paramIndex, Object value)
          Sets the value of the designated parameter with the given object.
 

Method Detail

setObject

public void setObject(int paramIndex,
                      Object value)
               throws XMLDBException,
                      SixdmlException
Sets the value of the designated parameter with the given object. Implementations are encouraged to create more specific versions of this method such as setInt, setNode, setString, and so on.

Parameters:
paramIndex - the index of the parameter whose value is being set. The value for the first parameter is 1, the second 2, etc
value - the object containing the input parameter value
Throws:
IndexOutOfBoundsException - if the index range is invalid
SixdmlException - if the statement is invalid.
XMLDBException - if a database error occurs

execute

public Document execute()
                 throws XMLDBException,
                        SixdmlException
Executes a SiXDML statement against the database and returns the results as an XML DOM object. This method is best used if the results of the statement are not large.
Returns:
the results of the statement as a DOM object.
Throws:
SixdmlException - if the statement is invalid.
XMLDBException - if a database error occurs

execute

public void execute(DefaultHandler handler)
             throws XMLDBException,
                    SixdmlException
Executes a SiXDML statement against the database and feeds the results to a SAX handler. This method is best used if the results of the statement are large and the database supports streaming of the results.
Parameters:
handler - a SAX handler which operates on the results of the statement.
Throws:
SixdmlException - if the statement is invalid.
XMLDBException - if a database error occurs

execute

public void execute(OutputStream outputStream)
             throws XMLDBException,
                    SixdmlException
Executes a SiXDML statement against the database and writes the results to the specified OutputStream. This method is best used when the results of the statement are not XML.
Parameters:
outputStream - the stream to write the results to
Throws:
SixdmlException - if the statement is invalid.
XMLDBException - if a database error occurs

execute

public void execute(Writer writer)
             throws XMLDBException,
                    SixdmlException
Executes a SiXDML statement against the database and writes the results using the specified writer. This method is best used when the results of the statement are not XML.
Parameters:
writer - the writer to send results to
Throws:
SixdmlException - if the statement is invalid.
XMLDBException - if a database error occurs