KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > daffodildb > server > serversystem > dmlvalidation > constraintsystem > CheckConstraintException


1 package com.daffodilwoods.daffodildb.server.serversystem.dmlvalidation.constraintsystem;
2
3 import com.daffodilwoods.database.general.*;
4 import com.daffodilwoods.database.resource.*;
5
6 /**
7  *
8  * <p>Title: CheckConstraintException</p>
9 * * <p>Description: Statement Trigger Exception has a super class DException, which helps in
10  * throwing a exception corresponding to sqlCode and the paramaters passed.</p>
11  */

12
13 public class CheckConstraintException extends DException{
14    public String JavaDoc condition ;
15    public QualifiedIdentifier tableName ;
16
17    /**
18     * constructs a new instance of check constraint exception with the given arguments.
19     * @param sqlCode code of exception in the sql statement.
20     * @param parameters parameters that r passed to the exception.
21     * @param temp previous exception.
22     */

23
24    public CheckConstraintException(String JavaDoc sqlCode, Object JavaDoc[] parameters, DException temp) {
25       super(sqlCode, parameters);
26       this.prevException = temp;
27    }
28
29    /**
30     * returns the Previous exception thrown if it is not null.
31     * @return DException
32     */

33
34    public DException getPreviousException(){
35         return (prevException==null) ? null : prevException;
36    }
37
38    public CheckConstraintException(String JavaDoc sqlcode, Object JavaDoc[] parameters) {
39       super( sqlcode, parameters );
40    }
41
42
43    /**
44     * used to get the message of the exception
45     * @param locale locale of JVM
46     * @return the message.
47     */

48    public String JavaDoc getMessage(java.util.Locale JavaDoc locale) {
49         return super.getMessage(locale);
50    }
51
52
53    /**
54     * sets the table name and the condition as public.
55     * @param tabName name of the table
56     * @param con condition of the constraint.
57     */

58
59    public void setCheckConstraintExceptionValues( QualifiedIdentifier tabName , String JavaDoc con ) {
60         tableName = tabName ;
61         condition = con ;
62    }
63
64    /**
65     * returns table name.
66     * @return String table name retreived by the method.
67     */

68
69    public QualifiedIdentifier getTable() {
70         return tableName ;
71    }
72
73    /**
74     * used to retreive the condition.
75     * @return condition retreived by the method.
76     */

77
78    public String JavaDoc getCondition() {
79         return condition ;
80    }
81 }
82
Popular Tags