Package org.apache.calcite.avatica
Class AvaticaSqlException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.sql.SQLException
-
- org.apache.calcite.avatica.AvaticaSqlException
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Iterable<java.lang.Throwable>
public class AvaticaSqlException extends java.sql.SQLExceptionA client-facingSQLExceptionwhich encapsulates errors from the remote Avatica server.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classAvaticaSqlException.PrintStreamOrWriterA class that encapsulates either a PrintStream or a PrintWriter.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringerrorMessageprivate java.lang.StringremoteServerprivate static longserialVersionUIDprivate java.util.List<java.lang.String>stackTraces
-
Constructor Summary
Constructors Constructor Description AvaticaSqlException(java.lang.String errorMessage, java.lang.String sqlState, int errorCode, java.util.List<java.lang.String> stackTraces, java.lang.String remoteServer)Construct the Exception with information from the server.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetErrorMessage()java.lang.StringgetRemoteServer()java.util.List<java.lang.String>getStackTraces()(package private) voidprintServerStackTrace(AvaticaSqlException.PrintStreamOrWriter streamOrWriter)voidprintStackTrace(java.io.PrintStream stream)voidprintStackTrace(java.io.PrintWriter writer)-
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, setStackTrace, toString
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
errorMessage
private final java.lang.String errorMessage
-
stackTraces
private final java.util.List<java.lang.String> stackTraces
-
remoteServer
private final java.lang.String remoteServer
-
-
Constructor Detail
-
AvaticaSqlException
public AvaticaSqlException(java.lang.String errorMessage, java.lang.String sqlState, int errorCode, java.util.List<java.lang.String> stackTraces, java.lang.String remoteServer)Construct the Exception with information from the server.- Parameters:
errorMessage- A human-readable error message.errorCode- An integer corresponding to a known error.stackTraces- Server-side stacktrace.remoteServer- The host:port where the Avatica server is located
-
-
Method Detail
-
getErrorMessage
public java.lang.String getErrorMessage()
-
getStackTraces
public java.util.List<java.lang.String> getStackTraces()
- Returns:
- The stacktraces for exceptions thrown on the Avatica server.
-
getRemoteServer
public java.lang.String getRemoteServer()
- Returns:
- The host:port for the remote Avatica server. May be null.
-
printStackTrace
public void printStackTrace(java.io.PrintStream stream)
- Overrides:
printStackTracein classjava.lang.Throwable
-
printStackTrace
public void printStackTrace(java.io.PrintWriter writer)
- Overrides:
printStackTracein classjava.lang.Throwable
-
printServerStackTrace
void printServerStackTrace(AvaticaSqlException.PrintStreamOrWriter streamOrWriter)
-
-