|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface PreparedOlapStatement
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.
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. |
boolean |
isSet(int parameterIndex)
Returns whether the value of the designated parameter is set. |
void |
unset(int parameterIndex)
Unsets the value of the designated parameter. |
| 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 |
|---|
addListener, executeOlapQuery, executeOlapQuery, getConnection |
| Methods inherited from interface java.sql.Wrapper |
|---|
isWrapperFor, unwrap |
| Methods inherited from interface org.olap4j.OlapWrapper |
|---|
isWrapperFor, unwrap |
| Method Detail |
|---|
CellSet executeQuery()
throws OlapException
PreparedOlapStatement object
and returns the CellSet object generated by the query.
executeQuery in interface PreparedStatementCellSet object that contains the data produced
by the query; never null
OlapException - if a database access error occurs
OlapParameterMetaData getParameterMetaData()
throws OlapException
PreparedOlapStatement object's parameters.
getParameterMetaData in interface PreparedStatementOlapParameterMetaData object that contains
information about the number, types and properties of this
PreparedOlapStatement object's parameters
OlapException - if a database access error occursOlapParameterMetaData
CellSetMetaData getMetaData()
throws SQLException
CellSetMetaData object that contains
information about the axes and cells of the CellSet object
that will be returned when this PreparedOlapStatement object
is executed.
getMetaData in interface PreparedStatementCellSet's axes
and cells
OlapException - if a database access error occurs
SQLExceptionCube getCube()
boolean isSet(int parameterIndex)
throws SQLException
Note that you cannot tell whether the parameter is set by looking to
see whether the value is null, because null is a valid
parameter value. When a parameter is not set, its value is derived by
evaluating its default expression.
To set the value call one of the setXxx methods. To
unset the value, call unset(int).
parameterIndex - the first parameter is 1, the second is 2, ...
SQLException - if a database access error occurs
void unset(int parameterIndex)
throws SQLException
parameterIndex - the first parameter is 1, the second is 2, ...
SQLException - if a database access error occursisSet(int)
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||