## org.h2.jdbc
Class JdbcSQLException

    java.lang.Object
      java.lang.Throwable
          java.lang.Exception
              java.sql.SQLException
                  org.h2.jdbc.JdbcSQLException

All Implemented Interfaces:
  java.io.Serializable, java.lang.Iterable<java.lang.Throwable>

    public class JdbcSQLException

extends java.sql.SQLException

Represents a database exception.

See Also:
  Serialized Form

Field Summary
`static java.lang.String` `HIDE_SQL` If the SQL statement contains this text, then it is never added to the SQL exception.

Constructor Summary
`JdbcSQLException(java.lang.String message, java.lang.String sql, java.lang.String state, int errorCode, java.lang.Throwable cause, java.lang.String stackTrace)` Creates a SQLException.

Method Summary
`java.lang.String` `getMessage()` Get the detail error message.
`java.lang.Throwable` `getOriginalCause()` INTERNAL
`java.lang.String` `getOriginalMessage()` INTERNAL
`java.lang.String` `getSQL()` Returns the SQL statement.
`void` `printStackTrace()` Prints the stack trace to the standard error stream.
`void` `printStackTrace(java.io.PrintStream s)` Prints the stack trace to the specified print stream.
`void` `printStackTrace(java.io.PrintWriter s)` Prints the stack trace to the specified print writer.
`void` `setSQL(java.lang.String sql)` INTERNAL
`java.lang.String` `toString()` Returns the class name, the message, and in the server mode, the stack trace of the server

Methods inherited from class java.sql.SQLException
`getErrorCode, getNextException, getSQLState, iterator, setNextException`

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### HIDE_SQL

    public static final java.lang.String HIDE_SQL

  If the SQL statement contains this text, then it is never added to the SQL exception. Hiding the SQL statement may be important if it contains a passwords, such as a CREATE LINKED TABLE statement.

  See Also:
    Constant Field Values

Constructor Detail

### JdbcSQLException

    public JdbcSQLException(java.lang.String message,
                            java.lang.String sql,
                            java.lang.String state,
                            int errorCode,
                            java.lang.Throwable cause,
                            java.lang.String stackTrace)

  Creates a SQLException.

  Parameters:
    `message` - the reason
    `sql` - the SQL statement
    `state` - the SQL state
    `errorCode` - the error code
    `cause` - the exception that was the reason for this exception
    `stackTrace` - the stack trace

Method Detail

### getMessage

    public java.lang.String getMessage()

  Get the detail error message.

  Overrides:
    `getMessage` in class `java.lang.Throwable`
  Returns:
    the message

### getOriginalMessage

    public java.lang.String getOriginalMessage()

  INTERNAL

### printStackTrace

    public void printStackTrace()

  Prints the stack trace to the standard error stream.

  Overrides:
    `printStackTrace` in class `java.lang.Throwable`

### printStackTrace

    public void printStackTrace(java.io.PrintWriter s)

  Prints the stack trace to the specified print writer.

  Overrides:
    `printStackTrace` in class `java.lang.Throwable`
  Parameters:
    `s` - the print writer

### printStackTrace

    public void printStackTrace(java.io.PrintStream s)

  Prints the stack trace to the specified print stream.

  Overrides:
    `printStackTrace` in class `java.lang.Throwable`
  Parameters:
    `s` - the print stream

### getOriginalCause

    public java.lang.Throwable getOriginalCause()

  INTERNAL

### getSQL

    public java.lang.String getSQL()

  Returns the SQL statement. SQL statements that contain '--hide--' are not listed.

  Returns:
    the SQL statement

### setSQL

    public void setSQL(java.lang.String sql)

  INTERNAL

### toString

    public java.lang.String toString()

  Returns the class name, the message, and in the server mode, the stack trace of the server

  Overrides:
    `toString` in class `java.lang.Throwable`
  Returns:
    the string representation