Table of Contents | Previous | Next | Index


Chapter 10
Configuring Your Database

This chapter describes how to set up your database to run with the LiveWire Database Service. You should read this chapter and "Configuration Information" before you try to use LiveWire with your JavaScript applications.

NOTE: There may have been changes to the database clients that are supported. For the latest information, see the Enterprise Server 4.x Release Notes.
This chapter contains the following sections:


About LiveWire Database Service

With the release of the 3.x and 4.x versions of Netscape servers, you must install a database client library (and a particular version of that library) if you wish to use the LiveWire Database Service. You must also configure the client library for use with LiveWire.

Netscape servers do not ship with any database client libraries. You must contact your database vendor for the appropriate library. You need only install and configure the database client libraries for the databases you will use.

If you install your database on a machine other than the one on which the web server is installed, you must have a client database library installed on the machine that has the web server. You must obtain the proper license arrangements directly from your database vendor. Netscape does not make these arrangements for you.

The requirements for configuring your database may differ if your database and your web server are installed on the same machine or on different machines. If they are on the same machine, the following information refers to it as a local configuration; if on different machines, as a remote configuration.

This chapter describes only those aspects of installing the database client that are specific to installing it for use with LiveWire. For general information on installing a database client, refer to the appropriate database vendor documentation.


Checking Your Database Configuration

After you've done the setup described in this chapter, you can use the dbadmin sample application to verify that your database connection works properly. You use this JavaScript sample application to connect to your database server and perform various simple tasks such as executing a SELECT statement and displaying the results or sending an arbitrary SQL command to the server.

Because you can use dbadmin to modify and delete database tables, access to it is automatically restricted if you choose to protect the Application Manager. For more information on restricting the Application Manager, see "Controlling Access to an Application."

The first thing you must do when using dbadmin is to connect to a database. Choose Connect to Database. A form, shown in Figure 10.1, appears in which you can enter connection information. Enter the parameters, and click Connect to attempt to connect to the server. For information on the parameters you use to connect, see "Database Connection Pools;" for further information, see the description of the connect method in the Server-Side JavaScript Reference.

Figure 10.1   The dbadmin connection page

If this connection succeeds, the Execute Query page appears. In this case, your database is properly configured for working with the LiveWire Database Service. If the connection fails, the Database Connect Error page appears. In this case, make sure you've followed the instructions for your particular database and hardware configuration.


Supported Database Clients and ODBC Drivers

The following table summarizes the specific database vendors supported on each platform for Netscape Enterprise Server 3.x (for information regarding Netscape Enterprise Server 4.0, refer to the Enterprise Server 4.0 Release Notes). These database vendors are not supported for Netscape FastTrack Server.

Table 10.1 Database vendor client libraries supported on each platform by Netscape Enterprise Server  

Database Vendor AIX DEC Irix 6.2 HP-UX 11.0 Solaris 2.5.1/ 2.6 Windows NT 4.0 w/ SP4
DB2

CAE 2.1.2

Not supported

Not supported

V5.2

V5.2

V5.2

Informix

Informix Client 7.22

Informix Client 7.22

Informix Client 7.22

SDK 2.10 (ESQL 9.16)

SDK 2.10 (ESQL 9.16)

SDK 2.10 TC1 (ESQL 9.16)

Microsoft ODBC

ODBC Mgr Visigenic 2.0

Not supported

ODBC Mgr Visigenic 2.0

Not supported

Supported on Solaris 2.5.1 only

MS SQL Server 6.5 (3.60 driver)

SQL Anywhere 5.5 (5.00 driver)

MS Access 7.0 (3.51.171300 Driver)

Oracle1

Oracle Client 7.3.x

Oracle Client 7.3.x

Oracle Client 7.3.x

Oracle Client

8.0.5

Oracle Client

8.0.5

Oracle Client 8.0.5

Sybase

Open

Client

/C 11.1

Open

Client

/C 11.1

Open

Client

/C 11.1

11.1.1

11.1.1

11.1.1

1 Oracle SQL*Net version 1.1 is no longer supported.

The following table summarizes support for ODBC on Windows NT for both Netscape Enterprise Server and Netscape FastTrack Server.

Table 10.2 Windows NT ODBC Support  

ODBC Component Windows NT 4.0 SP4

ODBC Manager

MS ODBC Manager 3.51 MCAD 2.0 SP2

ODBC Drivers

MS SQL Server 6.5

MS SQL Server Driver 3.60 (sqlsrv32.dll)

MS Access 7.0

MS Access Driver 3.51.171300 (odbcjt32.dll)

Sybase SQL Anywhere 5.5

Sybase SQL Anywhere Driver 5.00.0003 (wod50t.dll)

Note that ODBC is not supported on Unix platforms.

NOTE: Visigenic no longer enhances their existing ODBC drivers or SDK products. Instead, Visigenic has selected INTERSOLV to provide an upgrade path for these drivers and products. (For information, see http://www.intersolv.com/ newsstand/pr9711191.htm). Visigenic will provide a document covering the operational differences between Visigenic and INTERSOLV ODBC drivers.
The following table lists the capabilities of the supported ODBC drivers on NT.

Table 10.3 ODBC driver capabilities on NT  

SQL Database Connect SQL passthrough Read-only cursor Updatable cursor Stored procedures

MS-SQL Server 6.5

Yes

Yes

Yes

Yes

Yes

Sybase SQL Anywhere

Yes

Yes

Yes

Yes

Not tested

Access

Yes

Yes

Yes

No

N/A

Note that ODBC drivers are not supported for Unix platforms.


DB2

To use a DB2 server, you must have Netscape Enterprise Server. You cannot access DB2 from Netscape FastTrack Server.

All platforms: Install the DB2 client, version 2.1.2. For Solaris, you need APAR #JR10150. For information, see the DB2 documentation at http://www.software.ibm.com/data/db2/.

If the database and web server are on different machines: To determine if you can connect to the DB2 server, you can issue the following command from the DB2 command line:

DB2 TERMINATE # this command allows the catalog command to take effect
DB2 CONNECT TO databasename USERID userid USING password
If you use the BLOB or CLOB data types in your application, you must set the longdatacompat option in your $DB2PATH/db2cli.ini file to 1. For example:

[Database name]
longdatacompat=1
If you make changes to the db2cli.ini file, you must restart your web server for them to take effect.

Unix only: You must set the following environment variables:

DB2INSTANCE

Specifies the name of the connection port defined on both the server and client. This name is also in the dbm configuration file for the SVCENAME configuration parameter.

DB2PATH

Specifies the top-level directory in which DB2 is installed.

For example: /home/$DB2INSTANCE/sqllib

DB2COMM

Verify that this variable specifies the protocol that will be used. For example:

DB2COMM=TCPIP

PATH

Must include $DB2PATH/misc:$DB2PATH/adm:$DB2PATH/bin

LD_LIBRARY_PATH

(Solaris and Irix) Must include the DB2 lib directory. For example, on Solaris it must include /opt/IBMdb2/v2.1/lib.

SHLIB_PATH

(HP-UX) Must include the DB2 lib directory.

LIBPATH

(AIX) Must include the DB2 lib directory.


Informix

To use an Informix server, you must have Netscape Enterprise Server. You cannot access Informix from Netscape FastTrack Server.

If the database and the web server are on different machines, follow the instructions in "Informix Remote."

If the database and the web server are on the same machine, follow the instructions in "Informix Local."

Informix Remote

Unix only: Install an Informix ESQL/C Runtime Client 7.22 (also called Informix I-Connect) and then set the following environment variables:

INFORMIXDIR

Specifies the top-level directory in which Informix is installed.

INFORMIXSERVER

Specifies the name of your default Informix server.

INFORMIXSQLHOSTS

Specifies the path of the sqlhosts file if you move it somewhere other than $INFORMIXDIR/etc/sqlhosts. You do not need to set this variable if you leave the sqlhosts file in this directory.

SHLIB_PATH

(HP-UX) Must include $INFORMIXDIR/lib and $INFORMIXDIR/lib/esql.

You must also modify $INFORMIXDIR/etc/sqlhosts to match the service name in the /etc/services file. For information on how to do so, see your Informix documentation.

NT only: Install an Informix ESQL/C Runtime Client 7.20 (also called Informix I-Connect.) During installation all necessary environment variables are set. You use the appropriate Informix utility to enter the necessary information about the remote server you wish to connect to.

If you run your web Server as a System, be sure that you have run regcopy.exe.

All platforms: Depending on your name service, you may also need to edit the appropriate file to add the IP address of the remote host machine you are connecting to. On NT, this file is winnt\system32\drivers\etc\hosts file under the NT SystemRoot. On Unix, this file is /etc/hosts.

In the same directory, add the following line to the services file:

ifmx_srvc port/tcp # Informix Online Server
where ifmx_srvc is the name of your service and port is its port number. The port number must match the port on the remote machine that the Informix server listens to. To make this line valid, you must either insert at least one space after tcp or place a comment at the end of the line. For example, if your Informix service is named ifmx1 and the port number is 1321, you add this line:

ifmx1 1321/tcp # Informix Online Server

Informix Local

If you install Informix locally, you must install the Informix client before you install the Informix server.

Unix only: If you use 7.22 Online Server for Unix, the installation process creates the appropriate directory structure and sqlhosts file. You must set the environment variables as for a remote server.

NT only: You should install the Online Server 7.20. This installs the client; no additional steps are necessary. If you run your web Server as a System, be sure that you have run regcopy.exe.


ODBC

All platforms: For information on the capabilities of the supported ODBC drivers, see "Supported Database Clients and ODBC Drivers."

You need to have the appropriate ODBC drivers for the database you are connecting to. You also need to have additional ODBC connectivity files.

Most software products that provide ODBC connectivity supply an ODBC driver or drivers and ODBC connectivity.

NT only: Currently Netscape has certified with ODBC Manager version 2.5. If you have access to an ODBC driver, but not to the ODBC connectivity files, you can obtain them from the MS ODBC SDK. To get updated files for Access, Foxpro, and Excel, you may need patch WX1350 from Microsoft.

Unix only: For ODBC on Unix, you can use either the driver from Visigenic or from OpenLink. If you're using the Visigenic driver, follow the instructions in "Visigenic ODBC Driver (Unix only)." If you're using the OpenLink driver, follow the instructions in "OpenLink ODBC Driver (Solaris only)."

ODBC Data Source Names (NT only)

Two types of data sources can be created:

The data source describes the connection parameter for each database needing ODBC connectivity. The data source is defined using the ODBC administrator. When ODBC is installed, an administrator is also installed. Each ODBC driver requires different pieces of information to set up the data source.

OpenLink ODBC Driver (Solaris only)

Install the request broker, OpenLink Workgroup Edition ODBC Driver, on the database server. This must be running before you can connect to the database using the OpenLink request agent.

Install the request agent, in OpenLink Generic ODBC client version 1.5, on the database client machine.

Rename or copy the request agent's driver manager file from libiodbc.so to libodbc.so in the $ODBCDIR/lib directory, where $ODBCDIR is the directory in which ODBC is installed.

When you installed your server, you installed it to run as some user, either root, nobody, or a particular server user. The user you pick must have a real home directory, which you may have to create. For example, the default home directory for the nobody user on Irix is /dev/null. If you install your server on Irix as nobody, you must give the nobody user a different home directory.

In that home directory, you must have an .odbc.ini file. For example, if you run the server as root, this file is under the root (/) directory.

Set the following environment variables:

LD_LIBRARY_PATH

(Solaris and Irix) Add the location of the ODBC libraries to this variable.

UDBCINI

Specifies the location of the .odbc.ini file.

Visigenic ODBC Driver (Unix only)

When you installed your server, you installed it to run as some user, either root, nobody, or a particular server user. The user you pick must have a real home directory, which you may have to create. For example, the default home directory for the nobody user on Irix is /dev/null. If you install your server on Irix as nobody, you must give the nobody user a different home directory.

In that home directory, you must have an .odbc.ini file. For example, if you run the server as root, this file is under the root (/) directory.

Set the following environment variable:

LD_LIBRARY_PATH

(Solaris and Irix) Add the location of the ODBC libraries to this variable. In the preceding example, this would be /u/my-user/odbcsdk/lib.

SHLIB_PATH

(HP-UX) Add the location of the ODBC libraries to this variable.

LIBPATH

(AIX) Add the location of the ODBC libraries to this variable.

NOTE: Visigenic no longer enhances their existing ODBC drivers or SDK products. Instead, Visigenic has selected INTERSOLV to provide an upgrade path for these drivers and products. (For information, see http://www.intersolv.com/ newsstand/pr9711191.htm). Visigenic will provide a document covering the operational differences between Visigenic and INTERSOLV ODBC drivers.

Oracle

To use an Oracle server, you must have Netscape Enterprise Server. You cannot access Oracle from Netscape FastTrack Server.

If the database and the web server are on different machines, follow the instructions in "Oracle Remote."

If the database and the web server are on the same machine, follow the instructions in "Oracle Local."

Unix only: Make sure you can connect to your Oracle database via SQL*Net. When you have finished installation, you can use a loopback test to verify that you connected correctly. For example, from within sqlplus, you can try to connect to your database with the following command:

connect username/password@service_name
Or, from the Unix command line, you could use this command:

sqlplus username/password@service_name
In these commands, you use the service_name from your tnsnames.ora file.

Oracle Remote

NT only: You must install the Oracle 7.3.2 client software for NT. Oracle 7.1 and 7.2 clients are not supported. You must also create the Oracle configuration files using the appropriate Oracle configuration utility.

Unix only: Before you can connect to Oracle under Irix, you must have the appropriate Irix patches. See Enterprise Server 3.x Release Notes for information on the patches you need.

You must install the Oracle 7.3.x client software for Unix. Oracle 7.1 and 7.2 clients are not supported.

You must set the following environment variables:

ORACLE_HOME

Specifies the top-level directory in which Oracle is installed.

TNS_ADMIN

Specifies the location of configuration files, for example, $ORACLE_HOME/network/admin. After installation Oracle creates the configuration files under /var/opt/oracle. If listener.ora and tnsnames.ora are in this directory, you might not need to set TNS_ADMIN, because by default Oracle uses /var/opt/oracle.

If you do not set these environment variables properly, Oracle returns the ORA-1019 error code the first time you attempt to connect. For information on error handling, see Chapter 12, "Error Handling for LiveWire."

Oracle Local

Unix only: Before you can connect to Oracle under Irix, you must have the appropriate Irix patches. See Enterprise Server 3.x Release Notes for information on the patches you need.

All platforms: You must install an Oracle Workgroup, Enterprise Server 7.3.2 (NT), or Enterprise Server 7.3.x (Unix). Oracle 7.1 and 7.2 clients are not supported. Check with your server vendor to verify that the Oracle server version is compatible with the Oracle client.

You must set the following environment variables:

ORACLE_HOME

Specifies the top-level directory in which Oracle is installed.

ORACLE_SID

Specifies the Oracle System Identifier.

When your Oracle database server is local, you must pass the empty string as the second argument to the connect method of the database or DbPool object or to the DbPool constructor. This way, those methods use the value of the ORACLE_SID environment variable. For example:

database.connect ("ORACLE", "" "user", "password", "");
For more information on Oracle installation, see Oracle's documentation.


Sybase

To use a Sybase server, you must have Netscape Enterprise Server. You cannot access Sybase from Netscape FastTrack Server.

if the database and the web server are on different machines, follow the instructions in "sybase remote."

If the database and the web server are on the same machine, follow the instructions in "Sybase Local."

In addition, if you're using a Unix platform and Sybase has a multithreaded driver for that platform, follow the instructions in "Sybase (Unix only)." See Enterprise Server 3.x Release Notes for a list of the Unix platforms on which Sybase has a multithreaded driver.

Sybase Remote

Unix only: Set the following environment variable:

SYBASE
The top-level directory in which Sybase is installed

LD_LIBRARY_PATH

(DEC) Must include $SYBASE/lib.

For Solaris, you must also follow the instructions in "Sybase (Unix only)."

All platforms: You must install SYBASE Open Client/C. Supported versions are listed in "Supported Database Clients and ODBC Drivers."

You can use the appropriate Sybase utility to enter, in the sql.ini file (NT) and the interfaces file (all platforms), the information about the remote server you want to connect to. For more information, see your Sybase documentation.

Sybase Local

Unix only: Set the following environment variable:

SYBASE
The top-level directory in which Sybase is installed

LD_LIBRARY_PATH

(DEC) Must include $SYBASE/lib.

For Solaris, you must also follow the instructions in "Sybase (Unix only)."

All platforms: Install a Sybase SQL Server, version 11.1; the client portion is installed with the server. Supported versions are listed in "Supported Database Clients and ODBC Drivers."

You can use the appropriate Sybase utility to enter the information about the remote server you want to connect to in the sql.ini file (NT) and the interfaces file (all platforms). For more information, see your Sybase documentation.

Sybase (Unix only)

On some Unix platforms, Sybase has both a single-threaded driver and a multithreaded driver. If Sybase has a multithreaded driver for a particular Unix machine, you must use the multithreaded driver with LiveWire. On these platforms, your web server will behave unpredictably with the single-threaded driver. This requirement applies for both a local and a remote connection. It does not apply to Windows platforms.

See Enterprise Server 3.x Release Notes for a list of the Unix platforms on which Sybase has a multithreaded driver.

To ensure that you use the multithreaded driver, you must edit your $SYBASE/config/libtcl.cfg file. This file contains a pair of lines that enable either the single-threaded or the multithreaded driver. You must have one of these lines commented out and the other active. For example, on Solaris locate these lines:

[DRIVERS]
;libtli.so=tcp unused ; This is the nonthreaded tli driver.
libtli_r.so=tcp unused ; This is the threaded tli driver.
Make sure that the line for the single-threaded driver is commented out and that the line for the multithreaded driver is not commented out. The filename differs on each platform, but the lines are always in the DRIVERS section and are always commented to indicate which is the single-threaded and which the multithreaded driver.

NOTE: If you wish to use the Sybase isql utility, you must use the nonthreaded tli driver. In this case, the line for libtli_r.so must be commented out. For information on using this driver, see your Sybase documentation.

Table of Contents | Previous | Next | Index

Last Updated: 09/29/99 18:01:58

© Copyright � 1999 Sun Microsystems, Inc. Some preexisting portions Copyright � 1999 Netscape Communications Corp. All rights reserved.