Previous Contents Index Next |
iPlanet Web Server, Enterprise Edition Server-Side JavaScript Guide |
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 iPlanet Web Server 4.1 Release Notes.
This chapter contains the following sections:
About LiveWire Database Service
Checking Your Database Configuration
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.iPlanet Web 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. iPlanet 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. These database vendors are not supported for the FastTrack Edition server.
Table 10-1    Database vendor client libraries supported on each platform by Netscape Enterprise Server
MS SQL Server 6.5 (3.60 driver)
Oracle1
1 Oracle SQL*Net version 1.1 is no longer supported.
The following table summarizes the specific database vendors supported on each platform for iPlanet Web Server 4.x. These database vendors are not supported for the FastTrack Edition server.
Table 10-2    Database vendor client libraries supported on each platform by iPlanet Web Server
Database Vendor
Solaris Sparc 2.6, 7, and 2.8 beta
Solaris x86 (DE only)
Win NT 4.0 SP5
HPUX 11.0
AIX 4.3.2
DEC 4.0D
Linux RedHat 6.01
IRIX 6.5
1 Supported in iPlanet Web Server version 4.1 only.
The following table summarizes support for ODBC on Windows NT for iPlanet Web Server.
Table 10-3    Windows NT ODBC Support
ODBC Component
Windows NT 4.0 SP4
Note that ODBC is not supported on Unix platforms.
The following table lists the capabilities of the supported ODBC drivers on NT.
Table 10-4    ODBC driver capabilities on NT
SQL Database
Connect
SQL passthrough
Read-only cursor
Updatable cursor
Stored procedures
Note that ODBC drivers are not supported for Unix platforms.
DB2
To use a DB2 server, you must have iPlanet Web Server, Enterprise Edition. You cannot access DB2 from the FastTrack Edition.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 passwordIf 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=1If 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:
Informix
To use an Informix server, you must have iPlanet Web Server Enterprise Edition. You cannot access Informix from the FastTrack Edition.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:
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:
System DSN: If you're using a system DSN, the web server must be started using the System account.
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.User DSN: If you're using a user DSN, the web server must be started using an appropriate NT user account.
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:
(Solaris and Irix) Add the location of the ODBC libraries to this variable.
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:
Oracle
To use an Oracle server, you must have iPlanet Web Server, Enterprise Edition. You cannot access Oracle from the FastTrack Edition.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:
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:
Specifies the top-level directory in which Oracle is installed.
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:
connobj.connect ("ORACLE", "" "user", "password", "");
For more information on Oracle installation, see Oracle's documentation.
Sybase
To use a Sybase server, you must have iPlanet Web Server, Enterprise Edition. You cannot access Sybase from the FastTrack Edition.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:
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:
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.
Previous Contents Index Next
Copyright © 2000 Sun Microsystems, Inc. Some preexisting portions Copyright © 2000 Netscape Communications Corp. All rights reserved.
Last Updated August 09, 2000