Class SqlException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.sql.SQLException
net.sf.jailer.database.SqlException
- All Implemented Interfaces:
Serializable,Iterable<Throwable>
Wraps
SQLExceptions and holds SQL statement.- Author:
- Ralf Wisser
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSqlException(String errorDialogTitle, String message, String sqlStatement, Throwable t) Constructor.SqlException(String errorDialogTitle, String message, String sqlStatement, Throwable t, String sqlState) Constructor.SqlException(String message, String sqlStatement, Throwable t) Constructor.SqlException(String message, String sqlStatement, Throwable t, String sqlLState) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns the SQL state associated with this exception.booleanReturns whether the error message is already formatted for display.voidsetFormatted(boolean isFormatted) Sets whether the error message is already formatted for display.Methods inherited from class java.sql.SQLException
getErrorCode, getNextException, 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
-
Field Details
-
message
-
errorDialogTitle
-
sqlStatement
-
-
Constructor Details
-
SqlException
-
SqlException
-
SqlException
-
SqlException
public SqlException(String errorDialogTitle, String message, String sqlStatement, Throwable t, String sqlState) Constructor.- Parameters:
errorDialogTitle- the title for the error dialog, ornullmessage- the error messagesqlStatement- the SQL statement that caused the exceptiont- the causesqlState- the SQL state string
-
-
Method Details
-
isFormatted
public boolean isFormatted()Returns whether the error message is already formatted for display.- Returns:
trueif the message is pre-formatted
-
setFormatted
public void setFormatted(boolean isFormatted) Sets whether the error message is already formatted for display.- Parameters:
isFormatted-trueif the message is pre-formatted
-
getSQLState
Returns the SQL state associated with this exception. Returns the SQL state from the wrapped cause if available.- Overrides:
getSQLStatein classSQLException- Returns:
- the SQL state string, or
nullif unavailable
-