Top Description Fields Constructors Methods
org.eclipse.persistence.exceptions

public Class DatabaseException

extends EclipseLinkException
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.eis.EISException
Imports
java.io.StringWriter, java.sql.SQLException, org.eclipse.persistence.queries.*, org.eclipse.persistence.internal.databaseaccess.*, org.eclipse.persistence.internal.sessions.AbstractRecord, .AbstractSession, org.eclipse.persistence.exceptions.i18n.ExceptionMessageGenerator, org.eclipse.persistence.sessions.DataRecord

Purpose: Wrapper for any database exception that occurred through EclipseLink.

Field Summary

Modifier and TypeField and Description
protected transient Accessor
protected transient Call
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
protected SQLException
protected boolean
public static final int
protected transient DatabaseQuery
protected transient AbstractRecord
public static final int
public static final int
public static final int
public static final int
public static final int
Inherited from org.eclipse.persistence.exceptions.EclipseLinkException:
CRerrorCodehasBeenLoggedindentationStringinternalExceptionsessionshouldPrintInternalException

Constructor Summary

AccessConstructor and Description
protected
DatabaseException()

INTERNAL: EclipseLink exceptions should only be thrown by the EclipseLink code.

protected
DatabaseException(String message)

INTERNAL: EclipseLink exceptions should only be thrown by the EclipseLink code.

protected
DatabaseException(SQLException exception)

INTERNAL: EclipseLink exceptions should only be thrown by the EclipseLink code.

Method Summary

Modifier and TypeMethod and Description
public static DatabaseException
public static DatabaseException
public static DatabaseException
public static DatabaseException
public static DatabaseException
public static DatabaseException
public static DatabaseException
public static DatabaseException
public static DatabaseException
public static DatabaseException
public static DatabaseException
public Accessor
getAccessor()

PUBLIC: Return the accessor.

public Call
getCall()

PUBLIC: Return the call that caused the exception.

public int
getDatabaseErrorCode()

PUBLIC: This is the database error number.

public String
getMessage()

Overrides org.eclipse.persistence.exceptions.EclipseLinkException.getMessage.

PUBLIC: This is the database error message.
public DatabaseQuery
getQuery()

PUBLIC: This method returns the databaseQuery.

public DataRecord
getQueryArgumentsRecord()

PUBLIC: Return the query arguments used in the original query when exception is thrown

public boolean
public static DatabaseException
public static DatabaseException
public void
setAccessor(Accessor accessor)

INTERNAL: Set the Accessor.

public void
setCall(Call call)

INTERNAL: Set the call that caused the exception.

public void
setCommunicationFailure(boolean isCommunicationFailure)

public void
setQuery(DatabaseQuery query)

PUBLIC: This method set the databaseQuery.

public void
setQueryArguments(AbstractRecord queryArguments)

PUBLIC: Set the query arguments used in the original query when exception is thrown

public static DatabaseException
public static DatabaseException
public static DatabaseException
sqlException(SQLException exception, boolean commError)

public static DatabaseException
sqlException(SQLException exception, AbstractSession session, boolean commError)

public static DatabaseException
sqlException(SQLException exception, Accessor accessor, AbstractSession session, boolean isCommunicationFailure)

public static DatabaseException
sqlException(SQLException exception, Call call, Accessor accessor, AbstractSession session, boolean isCommunicationFailure)

public static DatabaseException
public static DatabaseException
public static DatabaseException
unableToAcquireConnectionFromDriverException(String driver, String user, String url)

The connection returned from this driver was null, the driver may be missing(using the default) or the wrong one for the database.

public static DatabaseException
unableToAcquireConnectionFromDriverException(SQLException exception, String driver, String user, String url)

The connection returned from this driver was null, the driver may be missing(using the default) or the wrong one for the database.

Inherited from org.eclipse.persistence.exceptions.EclipseLinkException:
crgetErrorCodegetIndentationStringgetInternalExceptiongetSessiongetUnformattedMessagehasBeenLoggedprintStackTraceprintStackTraceprintStackTracesetErrorCodesetHasBeenLoggedsetIndentationStringsetInternalExceptionsetSessionsetShouldPrintInternalExceptionshouldPrintInternalExceptiontoString

Field Detail

accessorback to summary
protected transient Accessor accessor
callback to summary
protected transient Call call
CANNOT_REGISTER_SYNCHRONIZATIONLISTENER_FOR_UNITOFWORKback to summary
public static final int CANNOT_REGISTER_SYNCHRONIZATIONLISTENER_FOR_UNITOFWORK
CONFIGURATION_ERROR_CLASS_NOT_FOUNDback to summary
public static final int CONFIGURATION_ERROR_CLASS_NOT_FOUND
CONFIGURATION_ERROR_NEW_INSTANCE_ILLEGAL_ACCESS_EXCEPTIONback to summary
public static final int CONFIGURATION_ERROR_NEW_INSTANCE_ILLEGAL_ACCESS_EXCEPTION
CONFIGURATION_ERROR_NEW_INSTANCE_INSTANTIATION_EXCEPTIONback to summary
public static final int CONFIGURATION_ERROR_NEW_INSTANCE_INSTANTIATION_EXCEPTION
COULD_NOT_CONVERT_OBJECT_TYPEback to summary
public static final int COULD_NOT_CONVERT_OBJECT_TYPE
COULD_NOT_FIND_MATCHED_DATABASE_FIELD_FOR_SPECIFIED_OPTOMISTICLOCKING_FIELDSback to summary
public static final int COULD_NOT_FIND_MATCHED_DATABASE_FIELD_FOR_SPECIFIED_OPTOMISTICLOCKING_FIELDS
DATABASE_ACCESSOR_CONNECTION_IS_NULLback to summary
public static final int DATABASE_ACCESSOR_CONNECTION_IS_NULL
DATABASE_ACCESSOR_NOT_CONNECTEDback to summary
public static final int DATABASE_ACCESSOR_NOT_CONNECTED
ERROR_PREALLOCATING_SEQUENCE_NUMBERSback to summary
public static final int ERROR_PREALLOCATING_SEQUENCE_NUMBERS
ERROR_READING_BLOB_DATAback to summary
public static final int ERROR_READING_BLOB_DATA
ERROR_RETRIEVE_DB_METADATA_THROUGH_JDBC_CONNECTIONback to summary
public static final int ERROR_RETRIEVE_DB_METADATA_THROUGH_JDBC_CONNECTION
exceptionback to summary
protected SQLException exception
isCommunicationFailureback to summary
protected boolean isCommunicationFailure
LOGOUT_WHILE_TRANSACTION_IN_PROGRESSback to summary
public static final int LOGOUT_WHILE_TRANSACTION_IN_PROGRESS
queryback to summary
protected transient DatabaseQuery query
queryArgumentsback to summary
protected transient AbstractRecord queryArguments
SEQUENCE_TABLE_INFORMATION_NOT_COMPLETEback to summary
public static final int SEQUENCE_TABLE_INFORMATION_NOT_COMPLETE
SQL_EXCEPTIONback to summary
public static final int SQL_EXCEPTION
SYNCHRONIZED_UNITOFWORK_DOES_NOT_SUPPORT_COMMITANDRESUMEback to summary
public static final int SYNCHRONIZED_UNITOFWORK_DOES_NOT_SUPPORT_COMMITANDRESUME
TRANSACTION_MANAGER_NOT_SET_FOR_JTS_DRIVERback to summary
public static final int TRANSACTION_MANAGER_NOT_SET_FOR_JTS_DRIVER
UNABLE_TO_ACQUIRE_CONNECTION_FROM_DRIVERback to summary
public static final int UNABLE_TO_ACQUIRE_CONNECTION_FROM_DRIVER

Constructor Detail

DatabaseExceptionback to summary
protected DatabaseException()

INTERNAL: EclipseLink exceptions should only be thrown by the EclipseLink code.

DatabaseExceptionback to summary
protected DatabaseException(String message)

INTERNAL: EclipseLink exceptions should only be thrown by the EclipseLink code.

DatabaseExceptionback to summary
protected DatabaseException(SQLException exception)

INTERNAL: EclipseLink exceptions should only be thrown by the EclipseLink code.

Method Detail

cannotRegisterSynchronizatonListenerForUnitOfWorkback to summary
public static DatabaseException cannotRegisterSynchronizatonListenerForUnitOfWork(Exception e)
configurationErrorClassNotFoundback to summary
public static DatabaseException configurationErrorClassNotFound(String className)
configurationErrorNewInstanceIllegalAccessExceptionback to summary
public static DatabaseException configurationErrorNewInstanceIllegalAccessException(IllegalAccessException exception, Class<?> javaClass)
configurationErrorNewInstanceInstantiationExceptionback to summary
public static DatabaseException configurationErrorNewInstanceInstantiationException(InstantiationException exception, Class<?> javaClass)
couldNotConvertObjectTypeback to summary
public static DatabaseException couldNotConvertObjectType(int type)
databaseAccessorConnectionIsNullback to summary
public static DatabaseException databaseAccessorConnectionIsNull(DatabaseAccessor databaseAccessor, AbstractSession session)
databaseAccessorNotConnectedback to summary
public static DatabaseException databaseAccessorNotConnected()
databaseAccessorNotConnectedback to summary
public static DatabaseException databaseAccessorNotConnected(DatabaseAccessor databaseAccessor)
errorPreallocatingSequenceNumbersback to summary
public static DatabaseException errorPreallocatingSequenceNumbers()
errorReadingBlobDataback to summary
public static DatabaseException errorReadingBlobData()
errorRetrieveDbMetadataThroughJDBCConnectionback to summary
public static DatabaseException errorRetrieveDbMetadataThroughJDBCConnection()
getAccessorback to summary
public Accessor getAccessor()

PUBLIC: Return the accessor.

getCallback to summary
public Call getCall()

PUBLIC: Return the call that caused the exception.

getDatabaseErrorCodeback to summary
public int getDatabaseErrorCode()

PUBLIC: This is the database error number. Since it is possible to have no internal exception the errorCode will be zero in this case.

getMessageback to summary
public String getMessage()

Overrides org.eclipse.persistence.exceptions.EclipseLinkException.getMessage.

PUBLIC: This is the database error message.

Returns:String

Doc from java.lang.Throwable.getMessage.

the detail message string of this Throwable instance (which may be null).

Annotations
@Override
getQueryback to summary
public DatabaseQuery getQuery()

PUBLIC: This method returns the databaseQuery. DatabaseQuery is a visible class to the EclipseLink user. Users create an appropriate query by creating an instance of a concrete subclasses of DatabaseQuery.

getQueryArgumentsRecordback to summary
public DataRecord getQueryArgumentsRecord()

PUBLIC: Return the query arguments used in the original query when exception is thrown

isCommunicationFailureback to summary
public boolean isCommunicationFailure()
logoutWhileTransactionInProgressback to summary
public static DatabaseException logoutWhileTransactionInProgress()
sequenceTableInformationNotCompleteback to summary
public static DatabaseException sequenceTableInformationNotComplete()
setAccessorback to summary
public void setAccessor(Accessor accessor)

INTERNAL: Set the Accessor.

setCallback to summary
public void setCall(Call call)

INTERNAL: Set the call that caused the exception.

setCommunicationFailureback to summary
public void setCommunicationFailure(boolean isCommunicationFailure)
setQueryback to summary
public void setQuery(DatabaseQuery query)

PUBLIC: This method set the databaseQuery. DatabaseQuery is a visible class to the EclipseLink user. Users create an appropriate query by creating an instance of a concrete subclasses of DatabaseQuery.

setQueryArgumentsback to summary
public void setQueryArguments(AbstractRecord queryArguments)

PUBLIC: Set the query arguments used in the original query when exception is thrown

specifiedLockingFieldsNotFoundInDatabaseback to summary
public static DatabaseException specifiedLockingFieldsNotFoundInDatabase(String lockingFieldName)
sqlExceptionback to summary
public static DatabaseException sqlException(SQLException exception)
sqlExceptionback to summary
public static DatabaseException sqlException(SQLException exception, boolean commError)
sqlExceptionback to summary
public static DatabaseException sqlException(SQLException exception, AbstractSession session, boolean commError)
sqlExceptionback to summary
public static DatabaseException sqlException(SQLException exception, Accessor accessor, AbstractSession session, boolean isCommunicationFailure)
sqlExceptionback to summary
public static DatabaseException sqlException(SQLException exception, Call call, Accessor accessor, AbstractSession session, boolean isCommunicationFailure)
synchronizedUnitOfWorkDoesNotSupportCommitAndResumeback to summary
public static DatabaseException synchronizedUnitOfWorkDoesNotSupportCommitAndResume()
transactionManagerNotSetForJTSDriverback to summary
public static DatabaseException transactionManagerNotSetForJTSDriver()
unableToAcquireConnectionFromDriverExceptionback to summary
public static DatabaseException unableToAcquireConnectionFromDriverException(String driver, String user, String url)

The connection returned from this driver was null, the driver may be missing(using the default) or the wrong one for the database.

unableToAcquireConnectionFromDriverExceptionback to summary
public static DatabaseException unableToAcquireConnectionFromDriverException(SQLException exception, String driver, String user, String url)

The connection returned from this driver was null, the driver may be missing(using the default) or the wrong one for the database.