KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > db > Database


1 /*
2
3    Derby - Class org.apache.derby.iapi.db.Database
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.iapi.db;
23
24 import org.apache.derby.iapi.services.context.ContextManager;
25 import org.apache.derby.iapi.error.StandardException;
26 import org.apache.derby.iapi.sql.ResultSet;
27 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
28 import org.apache.derby.iapi.jdbc.AuthenticationService;
29 import org.apache.derby.iapi.services.i18n.LocaleFinder;
30 import java.io.InputStream JavaDoc;
31 import java.io.OutputStream JavaDoc;
32 import java.sql.Date JavaDoc;
33 import java.util.Hashtable JavaDoc;
34 import java.util.Locale JavaDoc;
35
36 /**
37  * The org.apache.derby.iapi.db.Database
38  * interface provides "internal" methods on the database which are
39  * not available to JBMS users (org.apache.derby.database.Database,
40  * which this interface extends, provides all the externally visible
41  * methods).
42  * <P>
43  * At the present moment, this file defines methods which will at
44  * some point be moved to to the external database interface.
45  *
46  * <B> There are a bunch of the unimplemninted interface that used to be in
47  * this file. They have been moved to old_Database.java. old_Database.java is
48  * checked into the codeline but is not built, it is there for reference </B>
49  *
50  * @author Jeff Lichtman
51  */

52
53 public interface Database extends org.apache.derby.database.Database, LocaleFinder
54 {
55     // this interface gets used on a module, so we name it:
56
// Note that doers not point to this class name, but instead to
57
// the public API for this class. This ensures that the name
58
// written in service.properties is not a obfuscated one.
59

60     /**
61      * Sets up a connection to the Database, owned by the given user.
62      *
63      * The JDBC version of getConnection takes a URL. The purpose
64      * of the URL is to tell the driver where the database system is.
65      * By the time we get here, we have found the database system
66      * (that's how we're making this method call), so the URL is not
67      * necessary to establish the connection here. The driver should
68      * remember the URL that was used to establish the connection,
69      * so it can implement the DatabaseMetaData.getURL() method.
70      *
71      * @param user The UserID of the user getting the connection
72      * @param drdaID The drda id of the connection (from network server)
73      * @param dbname The database name
74      *
75      * @return A new LanguageConnectionContext
76      *
77      * @exception StandardException thrown if unable to create the connection.
78      */

79     public LanguageConnectionContext setupConnection(ContextManager cm, String JavaDoc user, String JavaDoc drdaID, String JavaDoc dbname) throws StandardException;
80
81     /**
82       Push a DbContext onto the provided context stack. This conext will
83       shut down the database in case of a DatabaseException being
84       cleaned up.
85      */

86     public void pushDbContext(ContextManager cm);
87
88     /**
89         Is the database active (open).
90     */

91     public boolean isActive();
92
93     /**
94       */

95     public int getEngineType();
96
97     /**
98      * This method returns the authentication service handle for the
99      * database.
100      *
101      * NOTE: There is always a Authentication Service per database
102      * and at the system level.
103      *
104      * @return The authentication service handle for the database
105      */

106     public AuthenticationService getAuthenticationService();
107
108     /**
109      * Get a Resource Adapter - only used by XA system. There is one and only
110      * one resource adapter per cloudscape database.
111      *
112      * @return the resource Adapter for the database, null if no resource
113      * adapter is available for this database. Returned as an Object
114      * so that non-XA aggressive JVMs such as Chai don't get ClassNotFound.
115      * caller must cast result to ResourceAdapter.
116      *
117      */

118     public Object JavaDoc getResourceAdapter();
119
120     /** Set the Locale that is returned by this LocaleFinder */
121     public void setLocale(Locale JavaDoc locale);
122 }
123
Popular Tags