APIdia Launch Partner
Top Description Fields Constructors Methods
net.ucanaccess.exception

public Class UcanaccessSQLException

extends SQLException
Class Inheritance
Known Direct Subclasses
net.ucanaccess.exception.UnsupportedTypeException, net.ucanaccess.exception.AuthenticationException, net.ucanaccess.exception.InvalidCreateStatementException, net.ucanaccess.exception.InvalidFunctionParameterException, net.ucanaccess.exception.InvalidIntervalValueException, net.ucanaccess.exception.InvalidParameterException, net.ucanaccess.exception.TableNotFoundException
Imports
com.google.errorprone.annotations.FormatMethod, .FormatString, net.ucanaccess.jdbc.IUcanaccessErrorCodes, net.ucanaccess.util.VersionInfo, org.hsqldb.error.ErrorCode, java.sql.SQLException, java.util.Optional, java.util.function.BooleanSupplier, .Supplier

The sql exception specific to Ucanaccess.

Field Summary

Modifier and TypeField and Description
pack-priv static final String
private static final long
private static final String

Constructor Summary

AccessConstructor and Description
public
public
UcanaccessSQLException(String reason, String sqlState, int vendorCode, Throwable cause)

public
public
public
UcanaccessSQLException(String reason, String sqlState, int vendorCode)

public
UcanaccessSQLException(String reason, String sqlState, Throwable cause)

public
public
public

Method Summary

Modifier and TypeMethod and Description
pack-priv String
public static String
public String
getLocalizedMessage()

Overrides java.lang.Throwable.getLocalizedMessage.

Creates a localized description of this throwable.

public String
getMessage()

Overrides java.lang.Throwable.getMessage.

Returns the detail message string of this throwable.

public static final <T extends UcanaccessSQLException> void
throwIf(BooleanSupplier condition, Supplier<T> exceptionSupplier)

public static final <
the type of the Throwable to wrap.
T extends Throwable
>
UcanaccessSQLException

Returns:

a UcanaccessSQLException instance.
wrap
(T
the Throwable to wrap.
t
)

Wraps a Throwable into a UcanaccessSQLException.

public static final <
the type of the Throwable to wrap
T extends Throwable
>
UcanaccessSQLException

Returns:

a UcanaccessSQLException instance
wrap
(String
an optional custom message prefix
reason
,
T
the Throwable to wrap
t
)

Wraps a Throwable into a UcanaccessSQLException, prepending an optional reason message.

Inherited from java.sql.SQLException:
getErrorCodegetNextExceptiongetSQLStateiteratorsetNextException

Field Detail

MSG_PREFIXback to summary
pack-priv static final String MSG_PREFIX
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.sql.SQLException.serialVersionUID.

UCANACCESS_GENERIC_ERROR_STRback to summary
private static final String UCANACCESS_GENERIC_ERROR_STR

Constructor Detail

UcanaccessSQLExceptionback to summary
public UcanaccessSQLException()
UcanaccessSQLExceptionback to summary
public UcanaccessSQLException(String reason, String sqlState, int vendorCode, Throwable cause)
UcanaccessSQLExceptionback to summary
public UcanaccessSQLException(String reason)
UcanaccessSQLExceptionback to summary
public UcanaccessSQLException(String reason, Object... args)
Annotations
@FormatMethod
UcanaccessSQLExceptionback to summary
public UcanaccessSQLException(String reason, String sqlState, int vendorCode)
UcanaccessSQLExceptionback to summary
public UcanaccessSQLException(String reason, String sqlState, Throwable cause)
UcanaccessSQLExceptionback to summary
public UcanaccessSQLException(String reason, Throwable cause)
UcanaccessSQLExceptionback to summary
public UcanaccessSQLException(String reason, String sqlState)
UcanaccessSQLExceptionback to summary
public UcanaccessSQLException(Throwable cause)

Method Detail

addVersionInfoback to summary
pack-priv String addVersionInfo(String message)
explainCauseback to summary
public static String explainCause(Throwable cause)
getLocalizedMessageback to summary
public String getLocalizedMessage()

Overrides java.lang.Throwable.getLocalizedMessage.

Doc from java.lang.Throwable.getLocalizedMessage.

Creates a localized description of this throwable. Subclasses may override this method in order to produce a locale-specific message. For subclasses that do not override this method, the default implementation returns the same result as getMessage().

Annotations
@Override
getMessageback to summary
public String getMessage()

Overrides java.lang.Throwable.getMessage.

Doc from java.lang.Throwable.getMessage.

Returns the detail message string of this throwable.

Annotations
@Override
throwIfback to summary
public static final <T extends UcanaccessSQLException> void throwIf(BooleanSupplier condition, Supplier<T> exceptionSupplier) throws Supplier-:T
wrapback to summary
public static final <T extends Throwable> UcanaccessSQLException wrap(T t)

Wraps a Throwable into a UcanaccessSQLException.

If the throwable is already a UcanaccessSQLException, it's returned as is. This is a convenience method calling wrap(String, Throwable) without a reason prefix.

Parameters
<T>
the type of the Throwable to wrap.
t:T

the Throwable to wrap.

Returns:UcanaccessSQLException

a UcanaccessSQLException instance.

wrapback to summary
public static final <T extends Throwable> UcanaccessSQLException wrap(String reason, T t)

Wraps a Throwable into a UcanaccessSQLException, prepending an optional reason message.

Preserves original SQLState, ErrorCode, and Cause when wrapping SQLException types. If reason is null or blank, the message is derived solely from t.

Parameters
<T>
the type of the Throwable to wrap
reason:String

an optional custom message prefix

t:T

the Throwable to wrap

Returns:UcanaccessSQLException

a UcanaccessSQLException instance