com.softtech.jdbc
Class ExceptionFactory

java.lang.Object
  extended by com.softtech.jdbc.ExceptionFactory

public class ExceptionFactory
extends java.lang.Object

Given a databaseType (e.g. DatabaseType.ORACLE), message, and SQLException, generate the appropriate DatabaseException subclass object

Author:
Jeff Smith (jeff@SoftTechDesign.com, www.SoftTechDesign.com), Paolo Orru (paolo.orru@gmail.com), added PostgreSQL support

Constructor Summary
ExceptionFactory()
           
 
Method Summary
static DatabaseException getException(int databaseType, java.lang.String msg)
          Generate an object of the correct exception subclass (of DatabaseException).
static DatabaseException getException(int databaseType, java.lang.String msg, java.sql.SQLException e)
          Generate the correct exception subclass (of DatabaseException).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionFactory

public ExceptionFactory()
Method Detail

getException

public static DatabaseException getException(int databaseType,
                                             java.lang.String msg,
                                             java.sql.SQLException e)
Generate the correct exception subclass (of DatabaseException). For example, generate an OracleException or a MySQLException.

Parameters:
databaseType -
msg -
e -
Returns:
DatabaseException (subclass)

getException

public static DatabaseException getException(int databaseType,
                                             java.lang.String msg)
Generate an object of the correct exception subclass (of DatabaseException). For example, generate an OracleException or a MySQLException.

Parameters:
databaseType -
msg -
Returns:
DatabaseException (subclass)