org.olap4j
Interface PreparedOlapStatement

All Superinterfaces:
OlapStatement, OlapWrapper, java.sql.PreparedStatement, java.sql.Statement, java.sql.Wrapper

public interface PreparedOlapStatement
extends java.sql.PreparedStatement, OlapStatement

An object that represents a precompiled OLAP statement.

An OLAP statement is precompiled and stored in a PreparedOlapStatement object. This object can then be used to efficiently execute this statement multiple times.

A PreparedOlapStatement is generally created using OlapConnection.prepareOlapStatement(String).

Note: The setter methods (setShort, setString, and so on) for setting IN parameter values must specify types that are compatible with the defined type of the input parameter. For instance, if the IN parameter has type INTEGER, then the method setInt should be used.

If a parameter has Member type, use the PreparedStatement.setObject(int, Object) method to set it. A OlapException will be thrown if the object is not an instance of Member or does not belong to the correct Hierarchy.

The method getParameterMetaData() returns a description of the parameters, as in JDBC. The result is an OlapParameterMetaData.

Unlike JDBC, it is not necessary to assign a value to every parameter. This is because OLAP parameters have a default value. Parameters have their default value until they are set, and then retain their new values for each subsequent execution of this PreparedOlapStatement.

Since:
Aug 22, 2006
Version:
$Id: PreparedOlapStatement.java 229 2009-05-08 19:11:29Z jhyde $
Author:
jhyde
See Also:
OlapConnection.prepareOlapStatement(String), CellSet

Field Summary
 
Fields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
 
Method Summary
 CellSet executeQuery()
          Executes the MDX query in this PreparedOlapStatement object and returns the CellSet object generated by the query.
 Cube getCube()
          Returns the cube (or virtual cube) which this statement is based upon.
 CellSetMetaData getMetaData()
          Retrieves a CellSetMetaData object that contains information about the axes and cells of the CellSet object that will be returned when this PreparedOlapStatement object is executed.
 OlapParameterMetaData getParameterMetaData()
          Retrieves the number, types and properties of this PreparedOlapStatement object's parameters.
 
Methods inherited from interface java.sql.PreparedStatement
addBatch, clearParameters, execute, executeUpdate, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL
 
Methods inherited from interface org.olap4j.OlapStatement
executeOlapQuery, executeOlapQuery
 
Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
 
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
 
Methods inherited from interface org.olap4j.OlapWrapper
isWrapperFor, unwrap
 

Method Detail

executeQuery

CellSet executeQuery()
                     throws OlapException
Executes the MDX query in this PreparedOlapStatement object and returns the CellSet object generated by the query.

Specified by:
executeQuery in interface java.sql.PreparedStatement
Returns:
an CellSet object that contains the data produced by the query; never null
Throws:
OlapException - if a database access error occurs

getParameterMetaData

OlapParameterMetaData getParameterMetaData()
                                           throws OlapException
Retrieves the number, types and properties of this PreparedOlapStatement object's parameters.

Specified by:
getParameterMetaData in interface java.sql.PreparedStatement
Returns:
an OlapParameterMetaData object that contains information about the number, types and properties of this PreparedOlapStatement object's parameters
Throws:
OlapException - if a database access error occurs
See Also:
OlapParameterMetaData

getMetaData

CellSetMetaData getMetaData()
                            throws java.sql.SQLException
Retrieves a CellSetMetaData object that contains information about the axes and cells of the CellSet object that will be returned when this PreparedOlapStatement object is executed.

Specified by:
getMetaData in interface java.sql.PreparedStatement
Returns:
the description of this CellSet's axes and cells
Throws:
OlapException - if a database access error occurs
java.sql.SQLException

getCube

Cube getCube()
Returns the cube (or virtual cube) which this statement is based upon.

Returns:
cube this statement is based upon

SourceForge.net_Logo