]> &api-questions;

The Database Explorer API provides access to the database connections defined in the Database Explorer. It allows a client to retrieve the connection list and their properties and to create new connections.

The Database Explorer also manages a list of JDBC drivers used to connect to databases. The API provides access to these drivers and allows to specify the JDBC driver when creating a new connection. New JDBC drivers can be registered using the Services API (by adding a file to the module layer).

The API allows the registration of database runtimes. Runtimes are pluggable parts allowing a database server to be started when a connection is made. Runtimes are registered using the Services API.

All Javadoc-specified functionality should be covered by unit tests.

Most code is already written. About 5 man-days are still needed for the registration of database runtimes and cleanups and about two weeks shall be spent writing tests. The milestone by which this API should be stable is promo-G.

An external module can register JDBC drivers. A typical example is a J2EE application server which bundles a database server. When the server is registered in the IDE the JDBC drivers for the database servers are added. The drivers are registered using the Services API by adding their XML descriptions to the module layer.

When creating a new connection the JDBC driver for it can be specified. A list of all the registered JDBC drivers can be retrieved using JDBCDriverManager.getDrivers().

An external module can register new database runtimes. A database runtime is an abstraction of a database server instance (typically bundled with a J2EE server). It allows a database server instance to be started and stopped when a connection to this instance is made in the IDE. Database runtimes are represented by the DatabaseRuntime SPI interface and are registered using the Services API.

An external module can create new database connections. Again, this is typical for a J2EE server bundling a database server. The new connections are added by calling ConnectionManager.create() to create a new DatabaseConnection instance and then ConnectionManager.addConnection() to add the connection.

Sometimes the list of connections needs to be displayed somewhere else in the IDE than the Runtime tab. A typical example is the SQL Editor, which allows the user to select the database connection the SQL statement will be executed against in a combo box in the editor toolbar. The list of connections can be obtained by calling ConnectionManager.getConnections(), which returns an array of DatabaseConnection instances.

The client usually needs to show the display name of the connection. The display name can be retrieved using the DatabaseConnection.getDisplayName() method.

Sometimes a client needs to retrieve the connection properties, such as the driver class. An example could be a J2EE server creating a connection pool. The properties can be retrieved using the getDriverClass(), getConnectionUrl(), getSchema(), getUser() and getPassword() methods of the DatabaseConnection class.

Usually when displaying a list of connections (usually in a combo box), the last item is "Add Connection", which displays the standard Add Connection dialog of the JDBC manager. This can be achieved by calling ConnectionManager.showAddConnectionDialog().

A component which provides database functionality (such as the SQL Editor) will need to connect to a database. This can be achieved using the showConnectionDialog() DatabaseConnection method and the java.sql.Connection instance can be retrieved using the getJDBCConnection() method.

This project provides access to objects defined in the Database Explorer. Documentation is available in the Javadoc.

XXX no answer for compat-i18n

No.

XXX no answer for compat-version

XXX no answer for dep-jre

XXX no answer for dep-jrejdk

JDBC drivers and database runtimes are registered in the default lookup.

Needed in the Database Explorer UI.

Neded for writing JDBC driver registration files.

Multiple usages (bundles, request processor).

For installing a ModuleInstall.close() method which disconnects the connected connections upon IDE shutdown.

Needed in the Database Explorer UI.

Needed in the Database Explorer UI.

Various settings of the Database Explorer, including the list of connections, are saved using a SystemOption.

Needed in the Database Explorer UI (the Execute Command top component).

Neded for writing JDBC driver registration files.

Needed in the Database Explorer UI.

None.

No known platform dependencies.

XXX no answer for deploy-dependencies

XXX no answer for deploy-jar

XXX no answer for deploy-nbm

Only official API and SPI packages are exported.

XXX no answer for deploy-shared

XXX no answer for exec-ant-tasks

XXX no answer for exec-classloader

XXX no answer for exec-component

XXX no answer for exec-introspection

XXX no answer for exec-privateaccess

XXX no answer for exec-process

XXX no answer for exec-property

XXX no answer for exec-reflection

XXX no answer for exec-threading

XXX no answer for format-clipboard

XXX no answer for format-dnd

XXX no answer for format-types

JDBC drivers and database runtimes are searched for in the global lookup.

XXX no answer for lookup-register

XXX no answer for lookup-remove

XXX no answer for perf-exit

XXX no answer for perf-huge_dialogs

None known.

XXX no answer for perf-mem

XXX no answer for perf-menus

XXX no answer for perf-progress

Performance scales linearly with the number of connections and drivers, but usually the numbers are small.

Some methods of the database runtimes may take a long time (especially the start method). These methods are never called in the event thread and a progress dialog is displayed.

XXX no answer for perf-startup

XXX no answer for perf-wakeup

XXX no answer for resources-file

XXX no answer for resources-layer

XXX no answer for resources-mask

XXX no answer for resources-read

XXX no answer for security-grant

XXX no answer for security-policy