Package net.snowflake.client.jdbc

## Class SnowflakeSQLException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.sql.SQLException
      - - net.snowflake.client.jdbc.SnowflakeSQLException

All Implemented Interfaces:
  `Serializable`, `Iterable<Throwable>`

Direct Known Subclasses:
  `SnowflakeReauthenticationRequest`, `SnowflakeSQLLoggedException`

    public class SnowflakeSQLException
    extends SQLException

See Also:
  Serialized Form

### Constructor Summary

Constructors
`SnowflakeSQLException​(String reason)`
`SnowflakeSQLException​(String sqlState, int vendorCode)` Deprecated.
`SnowflakeSQLException​(String sqlState, int vendorCode, Object... params)` Deprecated.
`SnowflakeSQLException​(String reason, String sqlState)` Deprecated.
`SnowflakeSQLException​(String queryId, String sqlState, int vendorCode)`
`SnowflakeSQLException​(String queryId, String sqlState, int vendorCode, Object... params)`
`SnowflakeSQLException​(String queryId, String reason, String sqlState)`
`SnowflakeSQLException​(String queryId, String reason, String sqlState, int vendorCode)` This constructor should only be used for error from Global service.
`SnowflakeSQLException​(String queryId, Throwable ex, String sqlState, int vendorCode, Object... params)`
`SnowflakeSQLException​(String queryId, ErrorCode errorCode, Object... params)`
`SnowflakeSQLException​(Throwable ex, String message)`
`SnowflakeSQLException​(Throwable ex, String sqlState, int vendorCode)`
`SnowflakeSQLException​(Throwable ex, String sqlState, int vendorCode, Object... params)` Deprecated. use `SnowflakeSQLException(String, Throwable, String, int, Object...)`
`SnowflakeSQLException​(Throwable ex, ErrorCode errorCode, Object... params)`
`SnowflakeSQLException​(SFException e)`
`SnowflakeSQLException​(ErrorCode errorCode, int retryCount, boolean issocketTimeoutNoBackoff, long elapsedSeconds)`
`SnowflakeSQLException​(ErrorCode errorCode, Object... params)`

### Method Summary

All Methods Instance Methods Concrete Methods
`long` `getElapsedSeconds()`
`String` `getQueryId()`
`int` `getRetryCount()`
`boolean` `issocketTimeoutNoBackoff()`

### 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, printStackTrace, printStackTrace, setStackTrace, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

### Constructor Detail

#### SnowflakeSQLException

    public SnowflakeSQLException​(String queryId,
                                 String reason,
                                 String sqlState,
                                 int vendorCode)

This constructor should only be used for error from Global service. Since Global service has already built the error message, we use it as is. For any errors local to JDBC driver, we should use one of the constructors below to build the error message.

Parameters:
  `queryId` - query id
  `reason` - reason for which exception is created
  `sqlState` - sql state
  `vendorCode` - vendor code

#### SnowflakeSQLException

    @Deprecated
    public SnowflakeSQLException​(String reason,
                                 String sqlState)

Deprecated.
use `SnowflakeSQLException(String, String, String)`

Parameters:
  `reason` - exception reason
  `sqlState` - the SQL state

#### SnowflakeSQLException

    public SnowflakeSQLException​(String queryId,
                                 String reason,
                                 String sqlState)

Parameters:
  `queryId` - the queryID
  `reason` - exception reason
  `sqlState` - the SQL state

#### SnowflakeSQLException

    @Deprecated
    public SnowflakeSQLException​(String sqlState,
                                 int vendorCode)

Deprecated.
use `SnowflakeSQLException(String, String, int)`

Parameters:
  `sqlState` - the SQL state
  `vendorCode` - the vendor code

#### SnowflakeSQLException

    public SnowflakeSQLException​(String queryId,
                                 String sqlState,
                                 int vendorCode)

Parameters:
  `queryId` - query ID
  `sqlState` - SQL state
  `vendorCode` - vendor code

#### SnowflakeSQLException

    @Deprecated
    public SnowflakeSQLException​(String sqlState,
                                 int vendorCode,
                                 Object... params)

Deprecated.
use `SnowflakeSQLException(String, String, int, Object...)`

Parameters:
  `sqlState` - the SQL state
  `vendorCode` - the vendor code
  `params` - additional parameters

#### SnowflakeSQLException

    public SnowflakeSQLException​(String queryId,
                                 String sqlState,
                                 int vendorCode,
                                 Object... params)

Parameters:
  `queryId` - query ID
  `sqlState` - the SQL state
  `vendorCode` - the vendor code
  `params` - additional parameters

#### SnowflakeSQLException

    public SnowflakeSQLException​(Throwable ex,
                                 String sqlState,
                                 int vendorCode)

Parameters:
  `ex` - Throwable exception
  `sqlState` - the SQL state
  `vendorCode` - the vendor code

#### SnowflakeSQLException

    public SnowflakeSQLException​(Throwable ex,
                                 ErrorCode errorCode,
                                 Object... params)

Parameters:
  `ex` - Throwable exception
  `errorCode` - the error code
  `params` - additional parameters

#### SnowflakeSQLException

    @Deprecated
    public SnowflakeSQLException​(Throwable ex,
                                 String sqlState,
                                 int vendorCode,
                                 Object... params)

Deprecated.
use `SnowflakeSQLException(String, Throwable, String, int, Object...)`

Parameters:
  `ex` - Throwable exception
  `sqlState` - the SQL state
  `vendorCode` - the vendor code
  `params` - additional parameters

#### SnowflakeSQLException

    public SnowflakeSQLException​(String queryId,
                                 Throwable ex,
                                 String sqlState,
                                 int vendorCode,
                                 Object... params)

Parameters:
  `queryId` - query ID
  `ex` - Throwable exception
  `sqlState` - the SQL state
  `vendorCode` - the vendor code
  `params` - additional parameters

#### SnowflakeSQLException

    public SnowflakeSQLException​(ErrorCode errorCode,
                                 Object... params)

Parameters:
  `errorCode` - the error code
  `params` - additional parameters

#### SnowflakeSQLException

    public SnowflakeSQLException​(String queryId,
                                 ErrorCode errorCode,
                                 Object... params)

Parameters:
  `queryId` - query ID
  `errorCode` - error code
  `params` - additional parameters

#### SnowflakeSQLException

    public SnowflakeSQLException​(ErrorCode errorCode,
                                 int retryCount,
                                 boolean issocketTimeoutNoBackoff,
                                 long elapsedSeconds)

Parameters:
  `errorCode` - error code
  `retryCount` - retry count
  `issocketTimeoutNoBackoff` - isSocketTimeoutNoBackoff
  `elapsedSeconds` - time elapsed in seconds

#### SnowflakeSQLException

    public SnowflakeSQLException​(SFException e)

Parameters:
  `e` - the SFException

#### SnowflakeSQLException

    public SnowflakeSQLException​(String reason)

#### SnowflakeSQLException

    public SnowflakeSQLException​(Throwable ex,
                                 String message)

### Method Detail

#### getQueryId

    public String getQueryId()

#### getRetryCount

    public int getRetryCount()

#### issocketTimeoutNoBackoff

    public boolean issocketTimeoutNoBackoff()

#### getElapsedSeconds

    public long getElapsedSeconds()