org.jcreme.sql
Class SQLExceptionHandlerFactory

java.lang.Object
  extended byorg.jcreme.sql.SQLExceptionHandlerFactory

public class SQLExceptionHandlerFactory
extends java.lang.Object

This class enables to build a SQLExceptionHandler when needed from the name of the vendor.

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

Constructor Summary
SQLExceptionHandlerFactory()
           
 
Method Summary
 SQLExceptionHandler buildSQLExceptionHandler(java.lang.String productName)
          Builds a new instance of the SQLExceptionHandler class associated to the product name.
static SQLExceptionHandlerFactory getInstance()
          Give access to the unique instance of the class.
 void registerSQLExceptionHandlerClass(java.lang.String productName, java.lang.Class handlerClass)
          Enables to associate a SQLExceptionHandler class to a product name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLExceptionHandlerFactory

public SQLExceptionHandlerFactory()
Method Detail

getInstance

public static SQLExceptionHandlerFactory getInstance()
Give access to the unique instance of the class.

Returns:
the unique instance of the class.

registerSQLExceptionHandlerClass

public void registerSQLExceptionHandlerClass(java.lang.String productName,
                                             java.lang.Class handlerClass)
Enables to associate a SQLExceptionHandler class to a product name. It silently ignores null and invalid values.

Parameters:
productName - the name of the product as returned from the DatabaseMetaData.
handlerClass - the class which instances can handle errors from the product.

buildSQLExceptionHandler

public SQLExceptionHandler buildSQLExceptionHandler(java.lang.String productName)
Builds a new instance of the SQLExceptionHandler class associated to the product name. If no such class exists, an instance of DefaultSQLExceptionHandler is returned.

Parameters:
productName - the name of the product as returned from the DatabaseMetaData.
Returns:
an instance of a SQLExceptionHandler implementation.


Copyright 2006 null. All Rights Reserved.