Sun GlassFish Enterprise Server v3 Prelude Release Notes

Attempt to Use Administration Console to Create a Connection Pool Fails Even if the Driver Is Present (Issue 6671)

Description

In some circumstances, an attempt to use the Administration Console to create a JDBC connection pool fails even if the driver is present. When this failure occurs, the Administration Console returns a server error such as HTTP Status 500.

For more information, see Issue report.

Workaround

Repeat the attempt to create the JDBC connection pool, specifying the data-source class name explicitly. You can use either the Administration Console or the asadmin utility for this task.

The required class name depends on the resource type. For example, for the MySQL database, the required class name for each resource type is as shown in Table 1–6.

For other database drivers, consult the documentation from the database driver vendor.

Table 1–6 Resource Types and Data-Source Class Names for the Driver for the MySQL Database

Resource Type 

Data-Source Class Name 

javax.sql.ConnectionPoolDataSource

com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource

javax.sql.DataSource

com.mysql.jdbc.jdbc2.optional.MysqlDataSource

javax.sql.XADataSource

com.mysql.jdbc.jdbc2.optional.MysqlXADataSource


Example 1–1 Creating a JDBC Connection Pool by Using the asadmin Utility

This example shows how to create a JDBC connection pool that is named mysql-pool for the MySQL database. The vendor-supplied JDBC data-source class is com.mysql.jdbc.jdbc2.optional.MysqlDataSource. This class implements the javax.sql.DataSource interface.


asadmin create-jdbc-connection-pool 
--datasourceclassname=com.mysql.jdbc.jdbc2.optional.MysqlDataSource
--restype=javax.sql.DataSource
--property="user=DBUSER:password=DBPASSWORD:url=jdbc\\:mysql\\://DB_HOSTNAME\\:3306/DATABASE_NAME"
mysql-pool

ProcedureTo Specify the Data-Source Class Name Explicitly When Using Administration Console

Perform this workaround only if an attempt to use the Administration Console to create a JDBC connection pool returns a server error such as HTTP Status 500. Use this workaround with the instructions for creating a JDBC connection pool in the Administration Console online help.

  1. In the step for selecting a database vendor, do not select a vendor from the Database Vendor drop-down list.

    You perform this step on the New JDBC Connection Pool (Step 1 of 2) page.

    As a result of not selecting a vendor, the data source class name in the New JDBC Connection Pool (Step 2 of 2) page will not be filled in for you.

  2. In the step for specifying the data-source class name, type the required class name in the Datasource Classname field.

    You perform this step on the New JDBC Connection Pool (Step 2 of 2) page.

    The required class name depends on the resource type that is selected from the Resource Type drop-down list. For example, for the MySQL database, the required class name for each resource type is as shown in Table 1–6.

    For other database drivers, consult the documentation from the database driver vendor.

  3. In the step for specifying additional properties, fill in the property table with the required property names and values.

    You perform this step on the New JDBC Connection Pool (Step 2 of 2) page.

    The required property names and values depend on the data-source class.