Package org.olap4j
Class OlapException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.sql.SQLException
-
- org.olap4j.OlapException
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable<java.lang.Throwable>
- Direct Known Subclasses:
XmlaOlap4jInvalidStateException
public class OlapException extends java.sql.SQLException
An exception describing an error accessing an OLAP database.
Since olap4j extends JDBC, it is natural that
OlapException
should extend JDBC'sSQLException
. 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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OlapException.Region
Description of the position of a syntax or validation error in the source MDX string.
-
Constructor Summary
Constructors Constructor Description OlapException()
Constructs anOlapException
object; thereason
field defaults to null, thesqlState
field defaults tonull
, and thevendorCode
field defaults to 0.OlapException(java.lang.String reason)
Constructs anOlapException
object with a reason; thesqlState
field defaults tonull
, and thevendorCode
field defaults to 0.OlapException(java.lang.String reason, java.lang.String sqlState)
Constructs anOlapException
object with the given reason and SQLState; thevendorCode
field defaults to 0.OlapException(java.lang.String reason, java.lang.String sqlState, int vendorCode)
Constructs anOlapException
object with a givenreason
,SQLState
andvendorCode
.OlapException(java.lang.String reason, java.lang.String sqlState, int vendorCode, java.lang.Throwable cause)
Constructs anOlapException
object with a givenreason
,SQLState
,vendorCode
andcause
.OlapException(java.lang.String reason, java.lang.String sqlState, java.lang.Throwable cause)
Constructs anOlapException
object with a givenreason
,SQLState
andcause
.OlapException(java.lang.String reason, java.lang.Throwable cause)
Constructs anOlapException
object with a givenreason
andcause
.OlapException(java.lang.Throwable cause)
Constructs anOlapException
object with a givencause
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getContext()
Returns the context where the exception occurred.OlapException.Region
getRegion()
Returns the textual region where the exception occurred, or null if no region can be identified.void
setContext(java.lang.Object context)
Sets the context where the exception occurred.void
setRegion(OlapException.Region region)
Sets the textual region where the exception occurred.-
Methods inherited from class java.sql.SQLException
getErrorCode, getNextException, getSQLState, iterator, setNextException
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
OlapException
public OlapException(java.lang.String reason, java.lang.String sqlState, int vendorCode)
Constructs anOlapException
object with a givenreason
,SQLState
andvendorCode
.- Parameters:
reason
- a description of the exceptionsqlState
- an XOPEN or SQL 99 code identifying the exceptionvendorCode
- a database vendor-specific exception code
-
OlapException
public OlapException(java.lang.String reason, java.lang.String sqlState)
Constructs anOlapException
object with the given reason and SQLState; thevendorCode
field defaults to 0.- Parameters:
reason
- a description of the exceptionsqlState
- an XOPEN or SQL 99 code identifying the exception
-
OlapException
public OlapException(java.lang.String reason)
Constructs anOlapException
object with a reason; thesqlState
field defaults tonull
, and thevendorCode
field defaults to 0.- Parameters:
reason
- a description of the exception
-
OlapException
public OlapException()
Constructs anOlapException
object; thereason
field defaults to null, thesqlState
field defaults tonull
, and thevendorCode
field defaults to 0.
-
OlapException
public OlapException(java.lang.Throwable cause)
Constructs anOlapException
object with a givencause
. TheSQLState
is initialized tonull
and the vendor code is initialized to 0. Thereason
is initialized tonull
ifcause==null
or 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
public OlapException(java.lang.String reason, java.lang.Throwable cause)
Constructs anOlapException
object with a givenreason
andcause
.- 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
public OlapException(java.lang.String reason, java.lang.String sqlState, java.lang.Throwable cause)
Constructs anOlapException
object with a givenreason
,SQLState
andcause
. 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
public OlapException(java.lang.String reason, java.lang.String sqlState, int vendorCode, java.lang.Throwable cause)
Constructs anOlapException
object with a givenreason
,SQLState
,vendorCode
andcause
.- 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 Detail
-
setRegion
public void setRegion(OlapException.Region region)
Sets the textual region where the exception occurred.- Parameters:
region
- Textual region
-
getRegion
public OlapException.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
public void setContext(java.lang.Object context)
Sets the context where the exception occurred.
-
getContext
public java.lang.Object getContext()
- Returns:
- context where the exception occurred, or null
-
-