ProgramixGenericLib v4.0.0

com.programix.da2
Class DATools

java.lang.Object
  extended by com.programix.da2.DATools

public class DATools
extends Object

Contains various tools helpful in the work of the "data access layer".

Author:
Paul Hyde

Method Summary
static DAException chainWithPrefix(String msg, Throwable cause)
          Returns a new DAException with that has the specified cause chained to it and a message the starts with the specified prefix and ends with the message from the cause.
static DAException convert(Throwable x)
          Takes the specified Throwable and wraps it in a DAException (if necessary).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

convert

public static DAException convert(Throwable x)
Takes the specified Throwable and wraps it in a DAException (if necessary). If the type passed in is already a DAException then that exception is simply returned. This is useful in coding situations where only a DAException is allowed to be thrown (and we don't want to wrap a DAException within a DAException):
 public String getSomething(int id) throws DAException {
     try {
         //...
         
     } catch ( Exception x ) {
         throw DATools.convert(x);
     }
 }
 


chainWithPrefix

public static DAException chainWithPrefix(String msg,
                                          Throwable cause)
Returns a new DAException with that has the specified cause chained to it and a message the starts with the specified prefix and ends with the message from the cause.


ProgramixGenericLib v4.0.0

Copyright © 2001-2007 Programix Incorporated. All rights reserved. ProgramixGenericLib is free and is OSI Certified Open Source Software under the BSD license.