001    package org.rakeshv.dbutils;
002    
003    /**
004     * A custom exception that is used to wrap any exception/error
005     * condition that is encountered while executing business logic.
006     *
007     * @author Rakesh Vidyadharan 2000-02-14
008     *
009     * <p>Copyright 2000, Rakesh Vidyadharan</p>
010     *
011     * $Id: JDBCException.java,v 1.4 2005/10/16 15:20:29 rakesh Exp $
012     */
013    public class JDBCException extends Exception
014    {
015      /**
016       * Constructs a new exception with null as its detail message. The 
017       * cause is not initialized, and may subsequently be initialized by 
018       * a call to <code>Throwable.initCause(java.lang.Throwable)</code>.  o
019       * Just uses the super-class constructor.
020       */
021      public JDBCException()
022      {
023        super();
024      }
025    
026      /**
027       * Constructs a new exception with the specified detail message. The 
028       * cause is not initialized, and may subsequently be initialized by 
029       * a call to <code>Throwable.initCause(java.lang.Throwable)</code>.  
030       * Just calls the corresponding super-class constructor.
031       *
032       * @param message -  The detail message. The detail message is 
033       *   saved for later retrieval by the Throwable.getMessage() method.
034       */
035      public JDBCException( String message )
036      {
037        super( message );
038      }
039    
040      /**
041       * Constructs a new exception with the specified detail message and 
042       * cause.  Just uses the appropriate super-class constructor.
043       *
044       * <p>Note that the detail message associated with cause is not 
045       * automatically incorporated in this exception's detail message.</p>
046       *
047       * @param message -  The detail message. The detail message is 
048       *   saved for later retrieval by the Throwable.getMessage() method.
049       * @param cause - The cause (which is saved for later 
050       *   retrieval by the Throwable.getCause() method). (A null value is 
051       *   permitted, and indicates that the cause is nonexistent or 
052       *   unknown.)
053       */
054      public JDBCException( String message, Throwable cause )
055      {
056        super( message, cause );
057    
058      }
059    
060      /**
061       * Constructs a new exception with the specified cause. The detail 
062       * message is set as <code>( cause==null ? null : cause.toString() )
063       * </code> (which typically contains the class and detail message of 
064       * cause).  This constructor is useful for exceptions that are little 
065       * more than wrappers for other throwables (for example, 
066       * PrivilegedActionException).  Just uses the appropriate super-class
067       * constructor.
068       *
069       * @param cause - The cause (which is saved for later 
070       *   retrieval by the Throwable.getCause() method). (A null value is 
071       *   permitted, and indicates that the cause is nonexistent or 
072       *   unknown.)
073       */
074      public JDBCException( Throwable cause )
075      {
076        super( cause );
077      }
078    }