org.apache.ojb.broker.util
Class ExceptionHelper

java.lang.Object
  extended by org.apache.ojb.broker.util.ExceptionHelper

public abstract class ExceptionHelper
extends java.lang.Object

A helper class which endorse dealing with exceptions.

Version:
$Id: ExceptionHelper.java 365232 2005-12-21 22:36:07Z tomdz $

Constructor Summary
ExceptionHelper()
           
 
Method Summary
static PersistenceBrokerSQLException generateException(java.sql.SQLException ex, java.lang.String sql, ClassDescriptor cld, Logger logger, java.lang.Object obj)
          Method which support the conversion of SQLException to OJB's runtime exception (with additional message details).
static PersistenceBrokerSQLException generateException(java.sql.SQLException ex, java.lang.String sql, ClassDescriptor cld, ValueContainer[] values, Logger logger, java.lang.Object obj)
          Method which support the conversion of SQLException to OJB's runtime exception (with additional message details).
static PersistenceBrokerSQLException generateException(java.lang.String message, java.sql.SQLException ex, java.lang.String sql, ClassDescriptor cld, ValueContainer[] values, Logger logger, java.lang.Object obj)
          Method which support the conversion of SQLException to OJB's runtime exception (with additional message details).
static PersistenceBrokerSQLException generateException(java.lang.String message, java.sql.SQLException ex, java.lang.String sql, Logger logger)
          Method which support the conversion of SQLException to OJB's runtime exception (with additional message details).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionHelper

public ExceptionHelper()
Method Detail

generateException

public static PersistenceBrokerSQLException generateException(java.lang.String message,
                                                              java.sql.SQLException ex,
                                                              java.lang.String sql,
                                                              Logger logger)
Method which support the conversion of SQLException to OJB's runtime exception (with additional message details).

Parameters:
message - The error message to use, if null a standard message is used.
ex - The exception to convert (mandatory).
sql - The used sql-statement or null.
logger - The Logger to log an detailed message to the specified Logger or null to skip logging message.
Returns:
A new created PersistenceBrokerSQLException based on the specified arguments.

generateException

public static PersistenceBrokerSQLException generateException(java.sql.SQLException ex,
                                                              java.lang.String sql,
                                                              ClassDescriptor cld,
                                                              Logger logger,
                                                              java.lang.Object obj)
Method which support the conversion of SQLException to OJB's runtime exception (with additional message details).

Parameters:
ex - The exception to convert (mandatory).
sql - The used sql-statement or null.
cld - The ClassDescriptor of the target object or null.
logger - The Logger to log an detailed message to the specified Logger or null to skip logging message.
obj - The target object or null.
Returns:
A new created PersistenceBrokerSQLException based on the specified arguments.

generateException

public static PersistenceBrokerSQLException generateException(java.sql.SQLException ex,
                                                              java.lang.String sql,
                                                              ClassDescriptor cld,
                                                              ValueContainer[] values,
                                                              Logger logger,
                                                              java.lang.Object obj)
Method which support the conversion of SQLException to OJB's runtime exception (with additional message details).

Parameters:
ex - The exception to convert (mandatory).
sql - The used sql-statement or null.
cld - The ClassDescriptor of the target object or null.
values - The values set in prepared statement or null.
logger - The Logger to log an detailed message to the specified Logger or null to skip logging message.
obj - The target object or null.
Returns:
A new created PersistenceBrokerSQLException based on the specified arguments.

generateException

public static PersistenceBrokerSQLException generateException(java.lang.String message,
                                                              java.sql.SQLException ex,
                                                              java.lang.String sql,
                                                              ClassDescriptor cld,
                                                              ValueContainer[] values,
                                                              Logger logger,
                                                              java.lang.Object obj)
Method which support the conversion of SQLException to OJB's runtime exception (with additional message details).

Parameters:
message - The error message to use, if null a standard message is used.
ex - The exception to convert (mandatory).
sql - The used sql-statement or null.
cld - The ClassDescriptor of the target object or null.
values - The values set in prepared statement or null.
logger - The Logger to log an detailed message to the specified Logger or null to skip logging message.
obj - The target object or null.
Returns:
A new created PersistenceBrokerSQLException based on the specified arguments.


(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30