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:
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
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
|
|
Informix
|
|
Microsoft
ODBC
| MS SQL Server 6.5 (3.60 driver)
Oracle1
|
|
Sybase
|
| |
---|
1 Oracle SQL*Net version 1.1 is no longer supported. |
Table 10.2 Windows NT ODBC Support
ODBC Component |
Windows NT 4.0 SP4
|
ODBC Drivers
|
|
|
| |
---|
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
|
|
| |
---|
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 effectIf you use the
DB2 CONNECT TO databasename USERID userid USING password
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]If you make changes to the
longdatacompat=1
db2cli.ini
file, you must restart your web server for them to take effect.
Unix only: You must set the following environment variables:
INFORMIXDIR | Specifies the top-level directory in which Informix is installed. |
INFORMIXSERVER | |
INFORMIXSQLHOSTS | |
SHLIB_PATH |
(HP-UX) Must include |
$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:
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 afterifmx_srvc
port
/tcp # Informix Online Server
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
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
.
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 |
/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 | |
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.
sqlplus
, you can try to connect to your database with the following command:
connect username/password@service_nameOr, from the Unix command line, you could use this command:
sqlplus username/password@service_nameIn these commands, you use the service_name from your
tnsnames.ora
file.
ORACLE_HOME | Specifies the top-level directory in which Oracle is installed. |
TNS_ADMIN |
ORACLE_HOME | Specifies the top-level directory in which Oracle is installed. |
ORACLE_SID |
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 | The top-level directory in which Sybase is installed |
LD_LIBRARY_PATH |
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 | The top-level directory in which Sybase is installed |
LD_LIBRARY_PATH |
sql.ini
file (NT) and the interfaces
file (all platforms). For more information, see your Sybase documentation.
$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]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
;libtli.so=tcp unused ; This is the nonthreaded tli driver.
libtli_r.so=tcp unused ; This is the threaded tli driver.
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 Sybaseisql
utility, you must use the nonthreadedtli
driver. In this case, the line forlibtli_r.so
must be commented out. For information on using this driver, see your Sybase documentation.
Last Updated: 09/29/99 18:01:58