Share via


SQLServerException Class

  • java.lang.Object
    • java.lang.Throwable
      • java.lang.Exception
        • java.sql.SQLException
          • com.microsoft.sqlserver.jdbc.SQLServerException

public final class SQLServerException
extends java.sql.SQLException

Represents the exception thrown from any point in the driver that throws a java.sql.SQLException. SQLServerException handles both SQL 92 and XOPEN state codes. They are switchable via a user specified connection property. SQLServerExceptions are written to any open log files the user has specified.

Constructor Summary

Constructor Description
SQLServerException(SQLServerError sqlServerError)

Method Summary

Modifier and Type Method and Description
SQLServerError getSQLServerError()

Returns SQLServerError object containing detailed info about exception as received from SQL Server.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Methods inherited from java.lang.Throwable

java.lang.Throwable.addSuppressed java.lang.Throwable.fillInStackTrace java.lang.Throwable.getCause java.lang.Throwable.getLocalizedMessage java.lang.Throwable.getMessage java.lang.Throwable.getStackTrace java.lang.Throwable.getSuppressed java.lang.Throwable.initCause java.lang.Throwable.printStackTrace java.lang.Throwable.printStackTrace java.lang.Throwable.printStackTrace java.lang.Throwable.setStackTrace java.lang.Throwable.toString

Methods inherited from java.sql.SQLException

java.sql.SQLException.getErrorCode java.sql.SQLException.getNextException java.sql.SQLException.getSQLState java.sql.SQLException.iterator java.sql.SQLException.setNextException

Constructor Details

SQLServerException

public SQLServerException(SQLServerError sqlServerError)

Parameters:

sqlServerError

Method Details

getSQLServerError

public SQLServerError getSQLServerError()

Returns SQLServerError object containing detailed info about exception as received from SQL Server. This API returns null if no server error has occurred.

Returns:

SQLServerError

Applies to