KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > lib > ddl > DDLCommand


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.lib.ddl;
21
22 /**
23 * Interface of database action command. Instances should remember connection
24 * information of DatabaseSpecification and use it in execute() method.
25 *
26 * @author Slavek Psenicka
27 */

28 public interface DDLCommand
29 {
30     /** Returns specification (DatabaseSpecification) for this command */
31     public DatabaseSpecification getSpecification();
32
33     /** Returns name of modified object */
34     public String JavaDoc getObjectName();
35
36     /** Sets name to be used in command
37     * @param name New name
38     */

39     public void setObjectName(String JavaDoc name);
40
41     /** Executes command */
42     public void execute() throws DDLException;
43
44     /**
45     * Returns full string representation of command. This string needs no
46     * formatting and could be used directly as argument of executeUpdate()
47     * command. Throws DDLException if format is not specified or CommandFormatter
48     * can't format it (it uses MapFormat to process entire lines and can solve []
49     * enclosed expressions as optional.
50     */

51     public String JavaDoc getCommand()
52     throws DDLException;
53     
54     /** information about appearance some exception in the last execute a bunch of commands */
55     public boolean wasException();
56
57 }
58
Popular Tags