org.apache.derby.iapi.db
Interface Database

All Superinterfaces:
Database, LocaleFinder
All Known Implementing Classes:
BasicDatabase

public interface Database
extends Database, LocaleFinder

The org.apache.derby.iapi.db.Database interface provides "internal" methods on the database which are not available to JBMS users (org.apache.derby.database.Database, which this interface extends, provides all the externally visible methods).

At the present moment, this file defines methods which will at some point be moved to to the external database interface. There are a bunch of the unimplemninted interface that used to be in this file. They have been moved to old_Database.java. old_Database.java is checked into the codeline but is not built, it is there for reference

Author:
Jeff Lichtman

Method Summary
 AuthenticationService getAuthenticationService()
          This method returns the authentication service handle for the database.
 int getEngineType()
           
 java.lang.Object getResourceAdapter()
          Get a Resource Adapter - only used by XA system.
 boolean isActive()
          Is the database active (open).
 void pushDbContext(ContextManager cm)
          Push a DbContext onto the provided context stack.
 void setLocale(java.util.Locale locale)
          Set the Locale that is returned by this LocaleFinder
 LanguageConnectionContext setupConnection(ContextManager cm, java.lang.String user, java.lang.String drdaID, java.lang.String dbname)
          Sets up a connection to the Database, owned by the given user.
 
Methods inherited from interface org.apache.derby.database.Database
backup, backup, backupAndEnableLogArchiveMode, backupAndEnableLogArchiveMode, checkpoint, disableLogArchiveMode, dropAllJDBCMetaDataSPSes, freeze, getId, getLocale, isReadOnly, unfreeze
 
Methods inherited from interface org.apache.derby.iapi.services.i18n.LocaleFinder
getCollator, getCurrentLocale, getDateFormat, getTimeFormat, getTimestampFormat
 

Method Detail

setupConnection

public LanguageConnectionContext setupConnection(ContextManager cm,
                                                 java.lang.String user,
                                                 java.lang.String drdaID,
                                                 java.lang.String dbname)
                                          throws StandardException
Sets up a connection to the Database, owned by the given user. The JDBC version of getConnection takes a URL. The purpose of the URL is to tell the driver where the database system is. By the time we get here, we have found the database system (that's how we're making this method call), so the URL is not necessary to establish the connection here. The driver should remember the URL that was used to establish the connection, so it can implement the DatabaseMetaData.getURL() method.

Parameters:
user - The UserID of the user getting the connection
drdaID - The drda id of the connection (from network server)
dbname - The database name
Returns:
A new LanguageConnectionContext
Throws:
StandardException - thrown if unable to create the connection.

pushDbContext

public void pushDbContext(ContextManager cm)
Push a DbContext onto the provided context stack. This conext will shut down the database in case of a DatabaseException being cleaned up.


isActive

public boolean isActive()
Is the database active (open).


getEngineType

public int getEngineType()

getAuthenticationService

public AuthenticationService getAuthenticationService()
This method returns the authentication service handle for the database. NOTE: There is always a Authentication Service per database and at the system level.

Returns:
The authentication service handle for the database

getResourceAdapter

public java.lang.Object getResourceAdapter()
Get a Resource Adapter - only used by XA system. There is one and only one resource adapter per cloudscape database.

Returns:
the resource Adapter for the database, null if no resource adapter is available for this database. Returned as an Object so that non-XA aggressive JVMs such as Chai don't get ClassNotFound. caller must cast result to ResourceAdapter.

setLocale

public void setLocale(java.util.Locale locale)
Set the Locale that is returned by this LocaleFinder



Apache Derby V10.0 Engine Documentation - Copyright © 1997,2004 The Apache Software Foundation or its licensors, as applicable.