Package org.olap4j
Class OlapException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.sql.SQLException
org.olap4j.OlapException
- All Implemented Interfaces:
Serializable,Iterable<Throwable>
- Direct Known Subclasses:
XmlaOlap4jInvalidStateException
An exception describing an error accessing an OLAP database.
Since olap4j extends JDBC, it is natural that OlapException
should extend JDBC's SQLException. The implementation by an olap4j
driver of a JDBC method which is declared to throw a SQLException may, if the
driver chooses, throw instead an OlapException.
OlapException provides some additional information to help an OLAP client identify the location of the error. This information is
- Since:
- Oct 23, 2006
- Author:
- jhyde
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDescription of the position of a syntax or validation error in the source MDX string. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs anOlapExceptionobject; thereasonfield defaults to null, thesqlStatefield defaults tonull, and thevendorCodefield defaults to 0.OlapException(String reason) Constructs anOlapExceptionobject with a reason; thesqlStatefield defaults tonull, and thevendorCodefield defaults to 0.OlapException(String reason, String sqlState) Constructs anOlapExceptionobject with the given reason and SQLState; thevendorCodefield defaults to 0.OlapException(String reason, String sqlState, int vendorCode) Constructs anOlapExceptionobject with a givenreason,SQLStateandvendorCode.OlapException(String reason, String sqlState, int vendorCode, Throwable cause) Constructs anOlapExceptionobject with a givenreason,SQLState,vendorCodeandcause.OlapException(String reason, String sqlState, Throwable cause) Constructs anOlapExceptionobject with a givenreason,SQLStateandcause.OlapException(String reason, Throwable cause) Constructs anOlapExceptionobject with a givenreasonandcause.OlapException(Throwable cause) Constructs anOlapExceptionobject with a givencause. -
Method Summary
Modifier and TypeMethodDescriptionReturns the context where the exception occurred.Returns the textual region where the exception occurred, or null if no region can be identified.voidsetContext(Object context) Sets the context where the exception occurred.voidsetRegion(OlapException.Region region) Sets the textual region where the exception occurred.Methods inherited from class java.sql.SQLException
getErrorCode, getNextException, getSQLState, iterator, setNextExceptionMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
OlapException
Constructs anOlapExceptionobject with a givenreason,SQLStateandvendorCode.- Parameters:
reason- a description of the exceptionsqlState- an XOPEN or SQL 99 code identifying the exceptionvendorCode- a database vendor-specific exception code
-
OlapException
Constructs anOlapExceptionobject with the given reason and SQLState; thevendorCodefield defaults to 0.- Parameters:
reason- a description of the exceptionsqlState- an XOPEN or SQL 99 code identifying the exception
-
OlapException
Constructs anOlapExceptionobject with a reason; thesqlStatefield defaults tonull, and thevendorCodefield defaults to 0.- Parameters:
reason- a description of the exception
-
OlapException
public OlapException()Constructs anOlapExceptionobject; thereasonfield defaults to null, thesqlStatefield defaults tonull, and thevendorCodefield defaults to 0. -
OlapException
Constructs anOlapExceptionobject with a givencause. TheSQLStateis initialized tonulland the vendor code is initialized to 0. Thereasonis initialized tonullifcause==nullor tocause.toString()ifcause!=null.- Parameters:
cause- the underlying reason for thisOlapException(which is saved for later retrieval by thegetCause()method); may be null indicating the cause is non-existent or unknown.
-
OlapException
Constructs anOlapExceptionobject with a givenreasonandcause.- Parameters:
reason- the detail message (which is saved for later retrieval by theThrowable.getMessage()method).cause- the cause (which is saved for later retrieval by theThrowable.getCause()method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
-
OlapException
Constructs anOlapExceptionobject with a givenreason,SQLStateandcause. The vendor code is initialized to 0.- Parameters:
reason- a description of the exception.sqlState- an XOPEN or SQL:2003 code identifying the exceptioncause- the underlying reason for thisOlapException(which is saved for later retrieval by thegetCause()method); may be null indicating the cause is non-existent or unknown.
-
OlapException
Constructs anOlapExceptionobject with a givenreason,SQLState,vendorCodeandcause.- Parameters:
reason- a description of the exceptionsqlState- an XOPEN or SQL:2003 code identifying the exceptionvendorCode- a database vendor-specific exception codecause- the underlying reason for thisOlapException(which is saved for later retrieval by thegetCause()method); may be null indicating the cause is non-existent or unknown.
-
-
Method Details
-
setRegion
Sets the textual region where the exception occurred.- Parameters:
region- Textual region
-
getRegion
Returns the textual region where the exception occurred, or null if no region can be identified.- Returns:
- Region where the exception occurred
-
setContext
Sets the context where the exception occurred.- Parameters:
context- Context where the exception occurred- Throws:
IllegalArgumentException- If context is not aCellor aPosition
-
getContext
- Returns:
- context where the exception occurred, or null
-