Class SQLExceptionComponentProvider
java.lang.Object
org.tentackle.trip.provider.ThrowableComponentProvider<SQLException>
org.tentackle.dbms.trip.SQLExceptionComponentProvider
- All Implemented Interfaces:
org.tentackle.trip.TripComponentProvider<SQLException>
@TripComponentProviderService(SQLException.class)
public class SQLExceptionComponentProvider
extends org.tentackle.trip.provider.ThrowableComponentProvider<SQLException>
Component provider for
SQLException.
Since the client usually doesn't have the JDBC driver on its classpath, no driver-specific class is transferred:
- a driver-specific SQL exception is transferred as its nearest JDK superclass (see
DbTripFactory), with the driver's class name appended to the message - a driver-specific cause, which is not an SQL exception, is replaced by an
Exceptioncarrying the original class name, message and stack trace
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanaddField(Collection<org.tentackle.trip.TripComponent<SQLException, ?>> components, Field field, org.tentackle.trip.TripType<SQLException> type, int ordinal) org.tentackle.trip.TripComponent<SQLException, ?>[]getComponents(org.tentackle.trip.TripType<SQLException> type) protected static ThrowablegetTransferredCause(Throwable cause) Gets the cause to be transferred.
SQL exceptions and the JDK's exceptions are transferred as they are.Methods inherited from class org.tentackle.trip.provider.ThrowableComponentProvider
getAdditionalGetterNames, getGetter
-
Constructor Details
-
SQLExceptionComponentProvider
public SQLExceptionComponentProvider()Creates the provider.
-
-
Method Details
-
getComponents
public org.tentackle.trip.TripComponent<SQLException, ?>[] getComponents(org.tentackle.trip.TripType<SQLException> type) - Specified by:
getComponentsin interfaceorg.tentackle.trip.TripComponentProvider<SQLException>- Overrides:
getComponentsin classorg.tentackle.trip.provider.ThrowableComponentProvider<SQLException>
-
getTransferredCause
Gets the cause to be transferred.
SQL exceptions and the JDK's exceptions are transferred as they are. Any other exception, usually specific to the JDBC driver, is replaced by anExceptioncarrying the original'sThrowable.toString()as its message and its stack trace.- Parameters:
cause- the cause- Returns:
- the cause to transfer
-
addField
protected boolean addField(Collection<org.tentackle.trip.TripComponent<SQLException, ?>> components, Field field, org.tentackle.trip.TripType<SQLException> type, int ordinal) - Overrides:
addFieldin classorg.tentackle.trip.provider.ThrowableComponentProvider<SQLException>
-