Previous Next Contents Index


Chapter 9

Administering Database Connectivity

Netscape Application Server applications are able to access a database, or several databases, to add, retrieve, and modify data. This chapter describes how to configure data access drivers and apply settings to database connectivity parameters.

The following topics are included in this chapter:


About Data Access Drivers
Netscape Application Server (NAS) applications often require database access.Database access is achieved through a data access driver, which is software written either by the database vendor or a third-party vendor. The following types of data access drivers can be configured with NAS to provide database connectivity:

Make sure that data access drivers are installed before installing an instance of NAS. This way, NAS can automatically configure the drivers.

Configuring Data Access Drivers When you open the Database window of NAS Administrator, the left pane displays all data access drivers installed on a particular server whether the drivers are configured or not. A red X appears next to drivers that are not configured.

To configure a data access driver, perform the following steps:

  1. From the NAS Administrator toolbar, click the Database button to open the Database window.
  2. In the left pane of the Database window, click the driver you want to configure.

  3. In the right pane of the Database window, click Load Data Access Driver.
  4. In the Client Library field, you can edit the library corresponding to the data access driver.
  5. In the Priority field, you can edit the priority of the data access driver.
  6. Click Apply Changes to save your changes to NAS.

Adjusting Database Connectivity Parameters
Netscape Application Server (NAS) allows you to adjust database connectivity through connection parameters. Connection parameters allow you to optimize the speed with which NAS connects to a database or databases. The connection parameters are grouped in the following categories:

Setting Connection Parameters You can set the length of time NAS attempts to make a database connection. These parameters optimize the performance of the NAS machine by keeping the server from wasting resources. For example, because NAS waits for open database connections when a request is made, the connection time limit is useful to limit the server from endlessly trying to connect to a database that is down.

To set the connection parameters, perform the following steps:

  1. From the NAS Administrator toolbar, click the Database button to open the Database window.
  2. In the left pane of the Database window, click the database for which you want to adjust the timeout parameter.
  3. In the right pane of the Database window, in the Connection Timeout field, enter the number of seconds.
  4. Click Apply Settings to save the changes to NAS.
Setting Thread Parameters You can set the minimum and maximum number of threads available for database connections. The thread parameters determine how many threads NAS allocates for asynchronous database queries. Such threads are usually used for queries returning a large number of rows and allowing the application to do other tasks while waiting for the query to finish. Asynchronous database queries are not supported by JDBC 2.0, a Java programming interface used to build on top on database drivers.

The default thread allocations are adequate for most applications. If an application developer uses many asynchronous queries, you might want to increase the maximum number of available threads. Keep in mind that each thread does use a small stack allocation and pulls from the total number of available system threads. Therefore, if an application does not use any asynchronous queries, you can increase performance by setting the maximum available threads to zero.

To set the thread parameters, perform the following steps:

  1. From the NAS Administrator toolbar, click the Database button to open the Database window.
  2. In the left pane of the Database window, select the database for which you want to adjust the asynchronous thread parameters.
  3. In the right pane of the Database window, in the Minimum Threads field, enter the number of threads.
  4. In the right pane of the Database window, in the Maximum Threads field, enter the number of threads.
  5. Click Apply Settings to save the changes to NAS.
Setting Database Cache Parameters The database cache is an array used to hold active and recently used database connections. NAS adds database connections to cache when an application creates a database connection.

While the application is using that database connection, NAS marks that connection "in use." Once the database operations are finished, the server marks the database connection "free." The cache then holds the free connection in the cache for a configured period of time. This allows the server to use the free cached connection and quickly handle a new request to the same database. Once a free connection exceeds the timeout, a cleaning thread removes the connection from the cache and opens a slot for a new connection to be cached.

You can adjust the following cache parameters:

The default values are adequate for most applications, so adjustments are not usually required for initial application installations.

NAS dynamically adjusts the cache up to the maximum number of allowable connections. If there are no connections to cache, the array is allocated to zero spaces.

To set database cache parameters, perform the following steps:

  1. From the NAS Administrator toolbar, click the Database button to open the Database window.
  2. In the left pane of the Database window, select the database for which you want to adjust the database cache parameters.
  3. In the right pane of the Database window, under Cache, enter values for the following parameters:
  4. Click Apply Settings to save the changes to NAS.
 

© Copyright 1999 Netscape Communications Corp.