Installing WebLogic jDriver for Informix
Installing WebLogic jDriver for Informix
Editing an entry to the XML license file
Configuring a connection pool with WebLogic Server
Using the connection pool in your application
Verifying your connection to the Informix database
Determining your database, hostname, and port
Overview
WebLogic jDriver for Informix is a new name for the product previously referred to as jdbcKona/Informix4.
This document tells you how to install WebLogic jDriver for Informix, BEA's pure-Java Type 4 JDBC driver for Informix. WebLogic jDriver for Informix is a 100% pure Java implementation of the Java Database Connectivity (JDBC) API, the industry standard for relational database access from Java clients. It provides Java clients, including applets, with direct access to the Informix database management system (DBMS). If you are using the driver with applets, then you must install the package on your web server host, which must also host your Informix database.
Before you begin
Upgrade information
Note: If you are using WebLogic jDriver for Informix with WebLogic Server 4.5 or later, you must also upgrade the driver for use with WebLogic Server. You can download the driver from the BEA website.
Evaluation licenses
The WebLogic jDriver for Informix distribution you downloaded from WebLogic's website includes an evaluation license that allows you to test the product with 2 users for 30 days. To purchase additional licenses, contact sales@weblogic.com.
Installation steps
If you have not already done so, unpack the zip file containing the WebLogic jDriver for Informix into the root directory of your computer. You must use a program such as WinZip that preserves the directory structure of the archive. The files unpack into the weblogic directory.
The instructions in this document assume that you are installing WebLogic jDriver for Informix on a Windows computer and that you unpacked the archive in the root directory of your C drive. If you are installing on a different operating system or in a different location, check your system documentation for help in adjusting the commands shown in these instructions for your own environment.
To change your CLASSPATH temporarily at a Windows Command Prompt, use this command:
$ set CLASSPATH=%CLASSPATH%;c:\weblogic\informix4\classes
To change your CLASSPATH permanently:
Any program you launch after you update the CLASSPATH variable in the System control panel will have access to the new value.
For more help setting your CLASSPATH, read Setting classpath. If you are using WebLogic jDriver for Informix from within an IDE like Symantec Cafe or JBuilder, the procedure for adding classes to the CLASSPATH may be different.
If you are planning to use WebLogic jDriver for Informix to access databases via applets in a web browser, you must install the distribution on the computer executing the web server. Furthermore, the web server and the Informix database server must be running on the same computer. This is a security restriction enforced by most web browsers, including Netscape Navigator and Internet Explorer. For information about browser security and applets, read Troubleshooting Applet Security problems.
The web server must also be able to find the WebLogic jDriver for Informix class files. To ensure that the web server can find the files, install the WebLogic jDriver for Informix distribution on your web server computer and then set the CLASSPATH on that computer as described in Step 2. Be sure to restart the web server after you change the CLASSPATH so that the web server has access to the revised CLASSPATH value.
With the release of version 5.1 of WebLogic jDriver for Informix, a new type of license is shipped with the distribution. This license uses an XML file to store the license keys.
There are several issues to consider regarding your license for WebLogic jDriver for Informix:
To purchase a permanent license for WebLogic jDriver for Informix, contact sales@weblogic.com.
Editing an entry to the XML license file
(Where weblogic is the directory containing your WebLogic jDriver for Informix or WebLogic Server installation.)
Do not edit this file in Microsoft Word or any other word-processing program that will save the file as a binary.
For example, if you have received a key for clustering, it'll look something like this:
<LICENSE PRODUCT="jdbcKona/Informix4"
IP="000.000.900.900"
UNITS="5"
EXPIRATION="31-Mar-1999"
KEY="w20f8s08480v0adpup43245paprtnp8ac"
/>
Setting up a connection pool
If you are using WebLogic jDriver for Informix with either WebLogic Server or WebLogic Express, you can set up a pool of connections to your Informix DBMS that will be established when WebLogic Server is started. Since the connections are shared among users, these connection pools eliminate the overhead of opening a new database connection for each user.
Your application then uses a multitier (Type-3) JDBC driver, such as the WebLogic Pool, JTS or RMI driver to connect to WebLogic Server. WebLogic Server then uses WebLogic jDriver for Informix and one of the existing connections from the pool to connect to the Informix database on behalf of your application.
Configuring a connection pool with WebLogic Server
weblogic.jdbc.connectionPool.InfxPool=\
url=jdbc:weblogic:informix4,\
driver=weblogic.jdbc.informix4.Driver,\
loginDelaySecs=1,\
initialCapacity=4,\
maxCapacity=10,\
capacityIncrement=2,\
allowShrinking=true,\
shrinkPeriodMins=15,\
refreshTestMinutes=10,\
testTable=dual,\
props=user=myUserName;password=secret;\
server=myDatabase@myDBServer:myPortNo
weblogic.allow.reserve.weblogic.jdbc.connectionPool.InfxPool=\
guest,joe,jill
weblogic.allow.reset.weblogic.jdbc.connectionPool.InfxPool=\
joe,jill
weblogic.allow.shrink.weblogic.jdbc.connectionPool.InfxPool=\
joe,jill
For more information on setting properties for connection pools, see JDBC Connection Pools in the WebLogic Administrators guide Setting WebLogic Properties.
Using the connection pool in your application
Client-side applications
To use a connection pool in a client-side application, establish the database connection using the WebLogic JDBC/RMI driver. For more information, see
To use a connection pool in a server-side application (such as a servlet), establish your database connection using the WebLogic pool or jts drivers. For more information, see:
Verifying your connection to the Informix database
Check your connection to the Informix database. You need to have a username and password of a valid user, and you also need to know the database name, hostname, and port of your database (see Determining your database, hostname, and port).
Once you've collected that information, you can test your connection. The WebLogic distribution includes a Java application to help you in setting up WebLogic jDriver for Informix. To use this helper app, make sure that the c:/weblogic/informix4/classes directory is in your CLASSPATH. At a command line, type:
java utils.dbping INFORMIX4 user pass db@host:port
For more detailed instructions on how to verify your connection to a DBMS, see Testing connections.
Determining your database, hostname, and port
You need to know several details about your Informix server installation in order to make a connection to it. These include:
This may seem a little confusing because often people use the word "server" to mean both the machine on which your database is running and the database instance itself. We'll be clear in this document: the "hostname" is the name of the machine, and the "database name" is the name of the Informix instance.
To get information about the Informix server you want to connect to, look in $INFORMIXDIR/etc/sqlhosts and find the appropriate entry under the "SERVER" column. The entry in this file will tell you the hostname and servicename - located in the far right column - for the connection. You only need to know the servicename to find out the port number.
Then look in your /etc/services file (or, on Windows NT, in \Winnt\system32\drivers\etc\services) to find the port number associated with the servicename.
More resources
Documentation
If you are planning to use WebLogic jDriver for Informix in an applet, you need to install the driver on your web server host. In addition, the web server and the Informix database must be located on the same machine. Because an applet must communicate only with the host from which its classes were loaded, the Informix database and the web server must be on the same IP host.
If you have questions about applet security issues, read Troubleshooting Applet Security problems.
For more information on applets, read Using WebLogic for applet programming.
Code examples
We also ship a number of code examples in the distribution that will help you get started. Code examples are located in the weblogic/informix4/examples/ directory in the distribution.
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|