Pervasive PSQL v10.10 - JDBC Readme
General Release - June 2008

Contents


This readme file contains the following topics:

About the Java Database Connectivity (JDBC) Driver

The Pervasive PSQL JDBC driver is a Type 4, 100% Pure Java certified client driver. The driver supports the JDBCTM 2.0 standard. The driver works on all platforms that support the JVM.

The Pervasive JDBC driver is a thin client that does a minimum amount of processing. The driver relies on the server for the core processing logic such as syntax analysis and query processing. Communication to the Pervasive PSQL Server is via the server's native LNA network protocol.

Additional information on JDBC is available on the Javasoft JDBC web page: http://java.sun.com/products/jdbc

The JDBC driver for Pervasive PSQL is shipped with the Pervasive PSQL engine. This Pervasive PSQL SDK release adds the following JDBC resources:

System Requirements

Getting Started

The runtime files for the JDBC access method are installed by default with the Pervasive PSQL Server, Pervasive PSQL Workgroup, and Pervasive PSQL Client.

The header files and sample files are available via Web download: http://www.pervasive.com/developerzone/access_methods/jdbc.asp.

Documentation

In the Pervasive PSQL SDK documentation, see JDBC Driver Guide and Pervasive PSQL Programmerís Guide.

Setting the CLASSPATH

So that Java applications and applets recognize the Pervasive PSQL JDBC Driver, set your CLASSPATH environment variable to include the pvjdbc2.jar, pvjdbc2x.jar, and jpscs.jar files. By default, these files are installed on Windows platforms in the install_directory\bin folder under Program Files. On Linux, the files are installed by default to /usr/local/psql/bin.

From Windows:
set CLASSPATH=%CLASSPATH%;<path to pvjdbc2.jar 
directory>/pvjdbc2.jar 
set CLASSPATH=%CLASSPATH%;<path to pvjdbc2x.jar 
directory>/pvjdbc2x.jar 
set CLASSPATH=%CLASSPATH%;<path to jpscs.jar directory>     
/jpscs.jar 
From Linux:
export CLASSPATH=$CLASSPATH:<path to pvjdbc2.jar 
directory>/pvjdbc2.jar 
export CLASSPATH=$CLASSPATH:<path to pvjdbc2x.jar 
directory>/pvjdbc2x.jar 
export CLASSPATH=$CLASSPATH:<path to jpscs.jar 
directory>/jpscs.jar 

Setting the SYSTEM PATH

If you connect to the database engine using shared memory or IPX, the JDBC driver must find pvjdbc2.dll. Ensure that your PATH variable on Windows contains the location of the DLL:

set PATH=%PATH%;<path to pvjdbc2.jar directory> 

If you connect to the database engine using sockets, no DLL is required.

Loading the Pervasive JDBC Driver into the Java Environment

After setting the CLASSPATH, you can now reference the Pervasive JDBC Driver from your Java application. You do this by using the java.lang.Class class:

Class.forName("com.pervasive.jdbc.v2.Driver"); 

Specifying a Data Source

After loading the PervasiveDriver class into your Java environment, you need to pass a URL-style string to the java.sql.DriverManager class to connect to a Pervasive PSQL database. The syntax for URL for the Pervasive JDBC driver is:

jdbc:pervasive://<machinename>:<portnumber>/
<datasource>
<machinename>
is the host name or IP address of the machine that runs the Pervasive DB Server.
<portnumber>
is the port on which the Pervasive dB Server is listening. By default it is 1583.
<datasource>
is the name of the ODBC DSN on the Pervasive database server that the application intends to use.
 

For example, if your Pervasive PSQL engine is on a machine named DBSERV, and you wish to connect to the DEMODATA database, your URL would look like this (assuming the server is configured to use the default port):

jdbc:pervasive://DBSERV/DEMODATA 

So to connect to the database using the DriverManager class, you would use the syntax:

Connection conn =           
DriverManager.getConnection("jdbc:pervasive://
DBSERV:1583/DEMODATA", loginString, passwordString); 

where "loginString" is the string that represents a user login and "passwordString" is the string that represents a user password.

Note  The Pervasive PSQL engine must be running on the specified host for JDBC applets and applications to access data.

Developing JDBC Applets

To develop web based applications using JDBC, you need to place the JDBC jar file in the codebase directory containing the applet classes.

For example, if you are developing an application called MyFirstJDBCapplet, you need to place the pvjdbc2.jar file in the directory containing the MyFirstJDBCapplet class. For example, it might be C:\inetpub\wwwroot\myjdbc\.

This enables the client web browser to be able to download the JDBC driver over the network and connect to the database.

You also need to put the archive parameter within the <APPLET> tag. For example:

<applet CODE="MyFirstJDBCapplet.class" 
        ARCHIVE="pvjdbc2.jar" WIDTH=641 HEIGHT=554> 

Note that the Pervasive PSQL v10.10 engine must be running on the Web server that hosts the applet.

Known Issues

This release has no known issues.

Technical Support

You may obtain technical support from the following Web-based support options:

Disclaimer

PERVASIVE SOFTWARE INC. LICENSES THE SOFTWARE AND DOCUMENTATION PRODUCT TO YOU OR YOUR COMPANY SOLELY ON AN "AS IS" BASIS AND SOLELY IN ACCORDANCE WITH THE TERMS AND CONDITIONS OF THE ACCOMPANYING LICENSE AGREEMENT.

Copyright ©2008 Pervasive Software Inc. All Rights Reserved.


Pervasive Software Inc.
http://www.pervasive.com
12365 Riata Trace Pkwy, Bldg B
Austin, TX 78727 USA
Voice: (512) 231-6000
Fax: (512) 231-6010
Online Pervasive Contacts

*** END OF README ***