Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Accessing application server specific features and using them in your J2EE application would make it more powerful than accessing only the J2EE features from them. It gives you the ability to write extensions to your application server.

...

This article is organized into the following sections :

Table of Contents

Application overview

The sample application covered in this article will help you to test the Database connection pools deployed in your Geronimo server. One can consider this as an extension to the Geronimo console because the current version does not contain the ability to test connections to database pools after they have been deployed.

...

The list of web application files in the application is depicted by the following diagram.

...

...

geronimo-web.xml defines the list of dependencies that have to be loaded into the web application class loader. In this case, there are no dependencies. Information about the project (e.g. module's unique identification, any dependencies) is described inside the <environment> tag. It is a good idea to give this module some sort of unique identification, so that it can later be referenced by some other deployable application. This module is in the group org.apache.geronimo.samples.dbtester. The path specified in the <context-root> tag will be the first segment of the URL used to access this web application. So to access this web application the url will be http://<hostname>:<port>/dbtester.

...

The structure of the final WAR should look like the following:

...

...

web.xml defines two servlets that will act as the control layer between presentation and service layers.

...

...

The most important part of this application is how to access Geronimo kernel and retrieve the list of database pools deployed there. This task is handled by the DBManagerBean class.

...

...

To retrieve the list of schemas and their tables, the application uses database metadata provided in a JDBC driver. ResultSet meta data has been used to get record related data and to display database contents. The following code snippet depicts how the application retrieves the schemas and their tables in a DataSource.

...

Usage

The app is available at http://localhost:8080/dbtester. Note that the sample servers you get if you run maven with -Pit will not show any data since they dont include any database pools. A more realistic view comes from installing the plugin or app on a full geronimo server.

...