Installing WebLogic jDriver for Microsoft SQL Server
Installing WebLogic jDriver for Microsoft SQL Server
WebLogic jDriver for Microsoft SQL Server version 6.5 and 7.0
WebLogic jDriver for Microsoft SQL Server version 7.0
Editing an entry to the XML license file
Configuring a connection pool with WebLogic Server
Using the connection pool in your application
Verifying your SQL Server installation
Setting a port for SQL Server connections
Verifying the JDBC driver with dbping
Overview
WebLogic jDriver for Microsoft SQL Server is a new name for the product previously referred to as jdbcKona/MSSQLServer4.
This document tells you how to install WebLogic jDriver for Microsoft SQL Server (formerly called FastForward for SQL Server), WebLogic's pure-Java Type 4 JDBC driver for Microsoft SQL Server. WebLogic jDriver for Microsoft SQL Server 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 Microsoft SQL Server. The driver ships in two versions, one for SQL Server version 6.5 and 7.0, and another for SQL Server 7.0 only. Both versions function identically, except as noted below.
WebLogic jDriver for Microsoft SQL Server, like all Type 4 JDBC drivers, is pure-Java and requires no vendor-supported client libraries. WebLogic jDriver for Microsoft SQL Server communicates directly with SQL Server through a TCP/IP network, using the SQL Server "Tabular Data Stream" protocol, so DB-Library does not have to be installed on a client computer.
Which version should I use?
WebLogic jDriver for Microsoft SQL Server version 6.5 and 7.0
WebLogic jDriver for Microsoft SQL Server version 7.0
Before you begin Upgrade information
If you are using WebLogic jDriver for Microsoft SQL Server with WebLogic Server 4.5 or later, you must also upgrade the driver for use with WebLogic Server.
If you have previously purchased a license for WebLogic jDriver for Microsoft SQL Server, you must obtain an updated license file from your BEA contact person. Instructions for updating your license are included in the Installation steps, below.
Evaluation licenses
The WebLogic jDriver for Microsoft SQL Server 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 WebLogic jDriver for Microsoft SQL Server 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 Microsoft SQL Server on a Windows computer and that you unpacked the archive in the root directory of your C drive. If you're 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\mssqlserver4\classes;
c:\weblogic\mssqlserver4\license
(If you are using the WebLogic jDriver for Microsoft SQL Server version 7.0, substitute mssqlserver4v70 for mssqlserver4 in the above command line.)
To change your CLASSPATH permanently:
(If you are using the WebLogic jDriver for Microsoft SQL Server version 7.0, substitute mssqlserver4v70 for mssqlserver4 in the above classpath.)
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're using WebLogic jDriver for Microsoft SQL Server from within an IDE like Symantec Cafe or JBuilder, the procedure for adding classes to the CLASSPATH may be different.
If you're planning to use WebLogic jDriver for Microsoft SQL Server to access SQL Server databases via applets in a web browser, you must install the distribution on the computer executing the web server. Furthermore, the web server and SQL Server must be running on the same computer. This is a security restriction enforced by most web browsers, including Netscape Navigator and Internet Explorer.
The web server must also be able to find the WebLogic jDriver for Microsoft SQL Server class files. To ensure that the web server can find the files, install the WebLogic jDriver for Microsoft SQL Server distribution on your web server computer and then set the CLASSPATH on that computer as described in step 2. above. 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 Microsoft SQL Server, 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 Microsoft SQL Server:
To purchase a permanent license for WebLogic jDriver for Microsoft SQL Server, contact sales@weblogic.com.
Editing an entry to the XML license file
(Where weblogic is the directory containing your WebLogic jDriver for Microsoft SQL Server 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 looks something like this:
<LICENSE PRODUCT="jdbcKona/MSSQLServer4"
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 Microsoft SQL Server with either WebLogic Server or WebLogic Express, you can set up a pool of connections to your SQL Server 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 Microsoft SQL Server and one of the existing connections from the pool to connect to the SQL Server database on behalf of your application.
Configuring a connection pool with WebLogic Server
weblogic.jdbc.connectionPool.SQLPool=\
url=jdbc:weblogic:mssqlserver4:myServer:myPort,\
driver=weblogic.jdbc.mssqlserver4.Driver,\
loginDelaySecs=1,\
initialCapacity=4,\
maxCapacity=10,\
capacityIncrement=2,\
allowShrinking=true,\
shrinkPeriodMins=15,\
refreshTestMinutes=10,\
testTable=dual,\
props=user=myUserName;password=secret;server=myServer;\
weblogic.allow.reserve.weblogic.jdbc.connectionPool.SQLPool=\
guest,joe,jill
weblogic.allow.reset.weblogic.jdbc.connectionPool.SQLPool=\
joe,jill
weblogic.allow.shrink.weblogic.jdbc.connectionPool.SQLPool=\
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 SQL Server installation
Verify that you are using version 6.5 or 7.0 of Microsoft SQL Server. Older versions of SQL Server do not properly support JDBC metadata functions and have limited data type support.
To connect to SQL Server, you need the following information:
For Microsoft SQL Server, the default port number is 1433. Servers, however, can be configured to listen on any port number. Verify the port number from your configuration files. If you need help setting the port number, see the following section Setting a port for SQL Server connections.
Setting a port for SQL Server connections
You set the hostname and port for SQL Server connections by making an entry into the SQL Server configuration files. In the configuration files, a logical "server name" is associated with a server machine name and port number. WebLogic jDriver for Microsoft SQL Server does not use the logical server name, only the host name and the port number.
You must have administrator privileges to change your SQL Server settings. To set the port:
Once you have set the port, you can verify with telnet that the server is listening on that port. Here is the syntax for the telnet command:
$ telnet hostname_or_IP_address port
For example, to test the SQL Server listening on port 1433 of the computer named "myhost", type:
$ telnet myhost 1433
If the server is not listening on the port, telnet will display an error message. If the server is listening on the port, telnet will display nothing; eventually, the host will drop the connection.
You can use isql to test your login information. Here's the isql syntax:
$ isql -Uusername -Ppassword -Sserver
Verifying the JDBC driver with dbping
You can use the WebLogic dbping Java application to verify that WebLogic jDriver for Microsoft SQL Server can connect to your SQL Server. To use dbping, make sure that the classes for WebLogic jDriver for Microsoft SQL Server are in your CLASSPATH (as described under Installation steps), then type this command:
$ java utils.dbping MSSQLSERVER4 username password
[database@]host[:port]
For example, the following command pings the SQL Server "pubs" database on the computer named "myhost", using the default TCP/IP port, and the "sa" login with a null password:
$ java utils.dbping MSSQLSERVER4 sa "" pubs@myhost
The output from the command includes code that you can use to connect to the database in a Java program.
See Using WebLogic jDriver for SQL Server for more information about JDBC connections.
More resources
Documentation
We also ship a number of code examples in the distribution that will help you get started. Code examples are located in the examples directory in the distribution.
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|