public class QueryException extends Exception
Constructor and Description |
---|
QueryException(String message)
Creates a default query exception with errorCode -1 and sqlState HY0000.
|
QueryException(String message,
ExceptionCode exceptionCode)
Creates a query exception with a message.
|
QueryException(String message,
int errorCode,
SqlStates sqlState)
Creates a query exception with a message.
|
QueryException(String message,
int errorCode,
SqlStates sqlState,
Throwable cause)
Creates a query exception with a message and a cause.
|
QueryException(String message,
int errorCode,
String sqlState)
Creates a query exception with a message.
|
QueryException(String message,
int errorCode,
String sqlState,
Throwable cause)
Creates a query exception with a message and a cause.
|
Modifier and Type | Method and Description |
---|---|
int |
getErrorCode()
returns the error code.
|
String |
getMessage() |
QueryException |
getNextException() |
String |
getSqlState()
Gets the sql state.
|
boolean |
isPrepareError()
Indicate if Exception is due to query not preparable.
|
void |
setMessage(String message) |
void |
setNextException(QueryException ex)
Adds an
QueryException object to the end of the chain. |
void |
setSqlState(String sqlState)
Sets the sql state.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public QueryException(String message)
message
- the message to setpublic QueryException(String message, int errorCode, String sqlState)
message
- the messageerrorCode
- the error codesqlState
- the sqlstatepublic QueryException(String message, int errorCode, SqlStates sqlState)
message
- the messageerrorCode
- the error codesqlState
- the sqlstatepublic QueryException(String message, ExceptionCode exceptionCode)
message
- the messageexceptionCode
- exceptionCodepublic QueryException(String message, int errorCode, String sqlState, Throwable cause)
message
- the exception messageerrorCode
- the error codesqlState
- the sql statecause
- the cause of the exceptionpublic String getMessage()
getMessage
in class Throwable
public void setMessage(String message)
public boolean isPrepareError()
public final int getErrorCode()
public final String getSqlState()
public void setSqlState(String sqlState)
sqlState
- sqlStatepublic void setNextException(QueryException ex)
QueryException
object to the end of the chain.ex
- the new exception that will be added to the end of
the QueryException
chainpublic QueryException getNextException()
Copyright © 2017. All rights reserved.