Package org.olap4j

Class OlapException

All Implemented Interfaces:
Serializable, Iterable<Throwable>
Direct Known Subclasses:
XmlaOlap4jInvalidStateException

public class OlapException extends SQLException

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:
  • Constructor Details

    • OlapException

      public OlapException(String reason, String sqlState, int vendorCode)
      Constructs an OlapException object with a given reason, SQLState and vendorCode.
      Parameters:
      reason - a description of the exception
      sqlState - an XOPEN or SQL 99 code identifying the exception
      vendorCode - a database vendor-specific exception code
    • OlapException

      public OlapException(String reason, String sqlState)
      Constructs an OlapException object with the given reason and SQLState; the vendorCode field defaults to 0.
      Parameters:
      reason - a description of the exception
      sqlState - an XOPEN or SQL 99 code identifying the exception
    • OlapException

      public OlapException(String reason)
      Constructs an OlapException object with a reason; the sqlState field defaults to null, and the vendorCode field defaults to 0.
      Parameters:
      reason - a description of the exception
    • OlapException

      public OlapException()
      Constructs an OlapException object; the reason field defaults to null, the sqlState field defaults to null, and the vendorCode field defaults to 0.
    • OlapException

      public OlapException(Throwable cause)
      Constructs an OlapException object with a given cause. The SQLState is initialized to null and the vendor code is initialized to 0. The reason is initialized to null if cause==null or to cause.toString() if cause!=null.

      Parameters:
      cause - the underlying reason for this OlapException (which is saved for later retrieval by the getCause() method); may be null indicating the cause is non-existent or unknown.
    • OlapException

      public OlapException(String reason, Throwable cause)
      Constructs an OlapException object with a given reason and cause.
      Parameters:
      reason - the detail message (which is saved for later retrieval by the Throwable.getMessage() method).
      cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
    • OlapException

      public OlapException(String reason, String sqlState, Throwable cause)
      Constructs an OlapException object with a given reason, SQLState and cause. The vendor code is initialized to 0.
      Parameters:
      reason - a description of the exception.
      sqlState - an XOPEN or SQL:2003 code identifying the exception
      cause - the underlying reason for this OlapException (which is saved for later retrieval by the getCause() method); may be null indicating the cause is non-existent or unknown.
    • OlapException

      public OlapException(String reason, String sqlState, int vendorCode, Throwable cause)
      Constructs an OlapException object with a given reason, SQLState, vendorCode and cause.
      Parameters:
      reason - a description of the exception
      sqlState - an XOPEN or SQL:2003 code identifying the exception
      vendorCode - a database vendor-specific exception code
      cause - the underlying reason for this OlapException (which is saved for later retrieval by the getCause() method); may be null indicating the cause is non-existent or unknown.
  • Method Details

    • 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(Object context)
      Sets the context where the exception occurred.
      Parameters:
      context - Context where the exception occurred
      Throws:
      IllegalArgumentException - If context is not a Cell or a Position
    • getContext

      public Object getContext()
      Returns the context where the exception occurred. Typically a Cell or a Position, or null.
      Returns:
      context where the exception occurred, or null