KickJava   Java API By Example, From Geeks To Geeks.

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


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 import java.sql.Connection JavaDoc;
23
24 /**
25 * Connection information.
26 * This interface defines information needed for connection to database
27 * (database and driver url, login name, password and schema name). It can create JDBC
28 * connection and feels to be a bean (has propertychange support and customizer).
29 * Instances of this class uses explorer option to store information about
30 * open connection.
31 *
32 * @author Slavek Psenicka, Radko Najman
33 */

34
35 public interface DBConnection extends java.io.Serializable JavaDoc
36 {
37     /** Returns driver URL */
38     public String JavaDoc getDriver();
39
40     /** Sets driver URL
41     * Fires propertychange event.
42     * @param driver DNew driver URL
43     */

44     public void setDriver(String JavaDoc driver);
45
46     /** Returns database URL */
47     public String JavaDoc getDatabase();
48
49     /** Sets database URL
50     * Fires propertychange event.
51     * @param database New database URL
52     */

53     public void setDatabase(String JavaDoc database);
54
55     /** Returns user login name */
56     public String JavaDoc getUser();
57
58     /** Sets user login name
59     * Fires propertychange event.
60     * @param user New login name
61     */

62     public void setUser(String JavaDoc user);
63
64     /** Returns schema name */
65     public String JavaDoc getSchema();
66
67     /** Sets schema name
68     * Fires propertychange event.
69     * @param schema Schema name
70     */

71     public void setSchema(String JavaDoc schema);
72
73     /** Returns connection name */
74     public String JavaDoc getName();
75
76     /** Sets connection name
77     * Fires propertychange event.
78     * @param name Connection name
79     */

80     public void setName(String JavaDoc name);
81     
82     /** Returns driver name */
83     public String JavaDoc getDriverName();
84
85     /** Sets driver name
86     * Fires propertychange event.
87     * @param name Driver name
88     */

89     public void setDriverName(String JavaDoc name);
90
91     /** Returns if password should be remembered */
92     public boolean rememberPassword();
93
94     /** Sets password should be remembered
95     * @param flag New flag
96     */

97     public void setRememberPassword(boolean flag);
98
99     /** Returns password */
100     public String JavaDoc getPassword();
101
102     /** Sets password
103     * Fires propertychange event.
104     * @param password New password
105     */

106     public void setPassword(String JavaDoc password);
107
108     /** Creates JDBC connection
109     * Uses DriverManager to create connection to specified database. Throws
110     * DDLException if none of driver/database/user/password is set or if
111     * driver or database does not exist or is inaccessible.
112     */

113     public Connection JavaDoc createJDBCConnection() throws DDLException;
114 }
115
Popular Tags