org.jcreme.sql
Class SQLExceptionHandlerDB2

java.lang.Object
  extended byorg.jcreme.sql.DefaultSQLExceptionHandler
      extended byorg.jcreme.sql.SQLExceptionHandlerDB2
All Implemented Interfaces:
SQLExceptionHandler

public class SQLExceptionHandlerDB2
extends DefaultSQLExceptionHandler
implements SQLExceptionHandler

This SQLExceptionHandler is specific to DB2. It takes advantage of the vendor codes to determine the type of the exceptions.

Version:
$Revision: 1.1 $
Author:
$Author: dbregeon $

Field Summary
static int DB2_COMMUNICATION_ERROR
          As specified in the DB2 documentation.
static int DB2_DEADLOCK_OR_TIMEOUT
          As specified in the DB2 documentation.
static java.lang.String DB2_DEADLOCK_WITHOUT_ROLLBACK
          As specified in the DB2 documentation.
static int DB2_DISABLED_FUNCTION
          As specified in the DB2 documentation.
static int DB2_DISABLED_STATE
          As specified in the DB2 documentation.
 
Fields inherited from class org.jcreme.sql.DefaultSQLExceptionHandler
SQL92_CONNECTION_ERROR_SQLSTATE_CLASS, SQL92_SERIALIZATION_FAILURE
 
Fields inherited from interface org.jcreme.sql.SQLExceptionHandler
EXCEPTION_TYPE_LOSS_OF_CONNECTION, EXCEPTION_TYPE_PLAIN_DEADLOCK, EXCEPTION_TYPE_ROLLEDBACK_DEADLOCK, EXCEPTION_TYPE_UNKNOWN, WAS_HANDLED
 
Constructor Summary
SQLExceptionHandlerDB2()
           
 
Method Summary
static SQLExceptionHandlerDB2 getInstance()
          Gives access to the unique instance of the class.
 boolean isLossOfConnection(java.sql.SQLException e)
          This method can be used to test an SQLException.
 boolean isPlainDeadLock(java.sql.SQLException e)
          This method can be used to test an SQLException.
 
Methods inherited from class org.jcreme.sql.DefaultSQLExceptionHandler
getDeadlockTimeout, getNumberOfTries, handleConnectionClosed, handleException, handleException, handleException, handlePlainDeadLock, handleRolledBackDeadLock, isDeadLock, isLossOfConnection, isPlainDeadLock, isRolledBackDeadLock, isRolledBackDeadLock, isUnknown, setDeadlockTimeout, setNumberOfTries, wasHandled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jcreme.sql.SQLExceptionHandler
getDeadlockTimeout, getNumberOfTries, handleException, handleException, handleException, isDeadLock, isLossOfConnection, isPlainDeadLock, isRolledBackDeadLock, isRolledBackDeadLock, isUnknown, setDeadlockTimeout, setNumberOfTries, wasHandled
 

Field Detail

DB2_COMMUNICATION_ERROR

public static final int DB2_COMMUNICATION_ERROR
As specified in the DB2 documentation.

See Also:
Constant Field Values

DB2_DISABLED_FUNCTION

public static final int DB2_DISABLED_FUNCTION
As specified in the DB2 documentation.

See Also:
Constant Field Values

DB2_DISABLED_STATE

public static final int DB2_DISABLED_STATE
As specified in the DB2 documentation.

See Also:
Constant Field Values

DB2_DEADLOCK_OR_TIMEOUT

public static final int DB2_DEADLOCK_OR_TIMEOUT
As specified in the DB2 documentation.

See Also:
Constant Field Values

DB2_DEADLOCK_WITHOUT_ROLLBACK

public static final java.lang.String DB2_DEADLOCK_WITHOUT_ROLLBACK
As specified in the DB2 documentation.

See Also:
Constant Field Values
Constructor Detail

SQLExceptionHandlerDB2

public SQLExceptionHandlerDB2()
Method Detail

getInstance

public static SQLExceptionHandlerDB2 getInstance()
Gives access to the unique instance of the class.

Returns:
the unique instance of the class.

isLossOfConnection

public boolean isLossOfConnection(java.sql.SQLException e)
This method can be used to test an SQLException.

Specified by:
isLossOfConnection in interface SQLExceptionHandler
Overrides:
isLossOfConnection in class DefaultSQLExceptionHandler
Parameters:
e - an SQLException to test.
Returns:
true if the exception is a loss of connection, false otherwise.

isPlainDeadLock

public boolean isPlainDeadLock(java.sql.SQLException e)
This method can be used to test an SQLException.

Specified by:
isPlainDeadLock in interface SQLExceptionHandler
Overrides:
isPlainDeadLock in class DefaultSQLExceptionHandler
Parameters:
e - an SQLException to test.
Returns:
true if the exception is a simple deadlock, false otherwise.


Copyright 2006 null. All Rights Reserved.