mime-version: 1.0
date: Fri, 25 Jun 2010 16:38:42 -0500
content-transfer-encoding: quoted-printable
content-location: http://ww1.pervasive.com/developerzone/access_methods/readme_jdbc.html
x-mimeole: Produced By Microsoft MimeOLE V6.00.2900.5931
from: <Saved by Windows Internet Explorer 8>
subject: Pervasive PSQL v9 JDBC
content-type: text/html;
	charset="Windows-1252"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:mso=3D"urn:schemas-microsoft-com:office:office" xmlns:msdt=3D"=
uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"><HEAD><TITLE>Readme PSQL v9 JDB=
C</TITLE>
<META content=3D"text/html; charset=3Dwindows-1252" http-equiv=3DContent-T=
ype>
<META name=3DAUTHOR content=3D"Pervasive Software">
<META name=3DDESCRIPTION content=3D"Information about the Pervasive JDBC D=
river">
<META name=3DOWNER content=3D"Pervasive Developer Solutions Team">
<STYLE>BODY {
	FONT-FAMILY: Verdana, Arial, Helvetica, MS Sans Serif; FONT-SIZE: 80%; MA=
RGIN-RIGHT: 10em
}
A:link {
	FONT-FAMILY: Verdana; COLOR: #008000
}
A:active {
	FONT-FAMILY: Verdana; COLOR: #8fbc8b
}
A:visited {
	FONT-FAMILY: Verdana; COLOR: #996699
}
A:hover {
	BACKGROUND-COLOR: #996699; FONT-FAMILY: Verdana; COLOR: #ffffff
}
P {
	MARGIN-TOP: 0.6em; FONT-FAMILY: Verdana; MARGIN-BOTTOM: 0.6em; MARGIN-LEF=
T: 1em
}
H1 {
	BORDER-BOTTOM: black solid; MARGIN-BOTTOM: 0.5em; FONT-SIZE: 160%
}
H2 {
	MARGIN-TOP: 1.5em; MARGIN-BOTTOM: 0.5em; FONT-SIZE: 140%
}
H3 {
	MARGIN-TOP: 1.2em; MARGIN-BOTTOM: 0.5em; FONT-SIZE: 110%; xfont-size: 110%
}
H4 {
	MARGIN-TOP: 1.2em; MARGIN-BOTTOM: 0.5em; FONT-SIZE: 105%; xfont-size: 105%
}
H5 {
	MARGIN-TOP: 1.2em; MARGIN-BOTTOM: 0.5em; FONT-SIZE: 100%
}
BIG {
	FONT-SIZE: 105%; FONT-WEIGHT: bold
}
OL {
	MARGIN-TOP: 0.6em; MARGIN-BOTTOM: 0em; MARGIN-LEFT: 4em
}
UL {
	LIST-STYLE-TYPE: square; MARGIN-TOP: 0.6em; FONT-FAMILY: Verdana; MARGIN-=
BOTTOM: 0em
}
UL LI {
	FONT-FAMILY: Verdana
}
P LI {
	LIST-STYLE-TYPE: square; FONT-FAMILY: Verdana; MARGIN-BOTTOM: 0em
}
LI P {
	FONT-FAMILY: Verdana
}
TABLE {
	MARGIN-TOP: 1em; MARGIN-LEFT: 5em; FONT-SIZE: 100%; MARGIN-RIGHT: 5em; ce=
ll-padding: 10
}
TH {
	TEXT-ALIGN: left; FONT-FAMILY: Verdana; BACKGROUND: #d3d3d3; VERTICAL-ALI=
GN: bottom
}
TR {
	VERTICAL-ALIGN: top
}
TD {
	FONT-FAMILY: Verdana; VERTICAL-ALIGN: top
}
STRONG {
	COLOR: maroon; FONT-WEIGHT: bold; TEXT-DECORATION: none
}
P.note {
	BORDER-BOTTOM: silver solid; BORDER-LEFT: silver solid; PADDING-BOTTOM: 1=
%; BACKGROUND-COLOR: #ffffee; PADDING-LEFT: 1%; PADDING-RIGHT: 1%; MARGIN-=
LEFT: 10em; BORDER-TOP: silver solid; MARGIN-RIGHT: 10em; BORDER-RIGHT: si=
lver solid; PADDING-TOP: 1%
}
PRE {
	MARGIN-TOP: 1.2em; FONT-FAMILY: Courier; MARGIN-BOTTOM: 1.5em; COLOR: blu=
e; MARGIN-LEFT: 5em; FONT-SIZE: 70%
}
CODE {
	FONT-FAMILY: Courier; COLOR: blue; FONT-SIZE: 70%
}
P.question {
=09
}
</STYLE>

<META name=3DGENERATOR content=3D"MSHTML 8.00.6001.18928">
<!--[if gte mso 9]><xml>
<mso:CustomDocumentProperties>
<mso:PDB_ProductTaxHTField0 msdt:dt=3D"string">PSQL v9|7e3e4af7-15e0-439e-=
9929-f38b98b53be7</mso:PDB_ProductTaxHTField0>
<mso:PDB_Product msdt:dt=3D"string">27;#PSQL v9|7e3e4af7-15e0-439e-9929-f3=
8b98b53be7</mso:PDB_Product>
<mso:Publication_Date msdt:dt=3D"string">2006-05-01T00:00:00Z</mso:Publica=
tion_Date>
<mso:PDB_Synopsis msdt:dt=3D"string"></mso:PDB_Synopsis>
<mso:TaxCatchAll msdt:dt=3D"string">27;#PSQL v9|7e3e4af7-15e0-439e-9929-f3=
8b98b53be7</mso:TaxCatchAll>
</mso:CustomDocumentProperties>
</xml><![endif]-->
</HEAD>
<BODY>
<H1>Pervasive PSQL v9 JDBC - May 2006</H1>
<P>This document contains the following topics: </P>
<UL>
  <LI><A=20
  href=3D"http://ww1.pervasive.com/developerzone/access_methods/Readme_Per=
vasive%20PSQL%20v9%20JDBC_May2006.mht#AboutTheDriver">About=20
  the Pervasive JDBC Driver</A>=20
  <LI><A=20
  href=3D"http://ww1.pervasive.com/developerzone/access_methods/Readme_Per=
vasive%20PSQL%20v9%20JDBC_May2006.mht#Features">Features</A>=20

  <LI><A=20
  href=3D"http://ww1.pervasive.com/developerzone/access_methods/Readme_Per=
vasive%20PSQL%20v9%20JDBC_May2006.mht#Requirements">System=20
  Requirements</A>=20
  <LI><A=20
  href=3D"http://ww1.pervasive.com/developerzone/access_methods/Readme_Per=
vasive%20PSQL%20v9%20JDBC_May2006.mht#Started">Getting=20
  Started</A>=20
  <UL>
    <LI><A=20
    href=3D"http://ww1.pervasive.com/developerzone/access_methods/Readme_P=
ervasive%20PSQL%20v9%20JDBC_May2006.mht#install">Installation</A>=20

    <LI><A=20
    href=3D"http://ww1.pervasive.com/developerzone/access_methods/Readme_P=
ervasive%20PSQL%20v9%20JDBC_May2006.mht#comps">Components=20
    List</A>=20
    <LI><A=20
    href=3D"http://ww1.pervasive.com/developerzone/access_methods/Readme_P=
ervasive%20PSQL%20v9%20JDBC_May2006.mht#Setting the CLASSPATH">Setting=20
    the CLASSPATH</A>=20
    <LI><A=20
    href=3D"http://ww1.pervasive.com/developerzone/access_methods/Readme_P=
ervasive%20PSQL%20v9%20JDBC_May2006.mht#Loading the Pervasive JDBC Driver"=
>Loading=20
    the Pervasive JDBC Driver into the Java Environment</A>=20
    <LI><A=20
    href=3D"http://ww1.pervasive.com/developerzone/access_methods/Readme_P=
ervasive%20PSQL%20v9%20JDBC_May2006.mht#Specifying a data">Specifying=20
    a Data Source</A>=20
    <LI><A=20
    href=3D"http://ww1.pervasive.com/developerzone/access_methods/Readme_P=
ervasive%20PSQL%20v9%20JDBC_May2006.mht#Developing JDBC Applets">Developin=
g=20
    JDBC Applets</A> </LI></UL>
  <LI><A=20
  href=3D"http://ww1.pervasive.com/developerzone/access_methods/Readme_Per=
vasive%20PSQL%20v9%20JDBC_May2006.mht#Problems">Known=20
  Issues</A>=20
  <LI><A=20
  href=3D"http://ww1.pervasive.com/developerzone/access_methods/Readme_Per=
vasive%20PSQL%20v9%20JDBC_May2006.mht#links">Useful=20
  Links</A>=20
  <LI><A=20
  href=3D"http://ww1.pervasive.com/developerzone/access_methods/Readme_Per=
vasive%20PSQL%20v9%20JDBC_May2006.mht#disclaimer">Disclaimer</A>=20
  </LI></UL>
<HR>

<H2><A name=3DAboutTheDriver></A>About the Pervasive JDBC Driver</H2>
<P>The Pervasive PSQL v9 JDBC driver is a Type 4, 100% Pure Java<SUP><FONT=
=20
size=3D-1>TM</FONT></SUP> certified client driver. The driver supports the=
=20
JDBC<SUP><FONT size=3D-1>TM</FONT></SUP> 2.0 standard. As it is a certifie=
d 100%=20
Pure Java<SUP><FONT size=3D-1>TM</FONT></SUP> driver, it will work on all=
=20
platforms that support the JVM.=20
<P>Pervasive PSQL v9 JDBC driver is a thin client that does the bare minim=
um=20
amount of processing and relies on the server for the core processing logi=
c like=20
syntax analysis, query processing etc. Communication to the Pervasive SQL =
Server=20
is via the server's native LNA network protocol.=20
<P>Additional information on JDBC is available on the Javasoft JDBC web pa=
ge: <A=20
href=3D"http://java.sun.com/products/jdbc">http://java.sun.com/products/jd=
bc</A>=20
<P>The JDBC driver for Pervasive PSQL is shipped with the Pervasive PSQL e=
ngine.=20
This Pervasive PSQL SDK release adds the following JDBC resources:=20
<UL>
  <LI>JDBC samples=20
  <LI>JDBC documentation=20
  <LI>Files relating to redistributing JDBC driver with your application=20
</LI></UL>
<H2><A name=3DFeatures></A>Features</H2>
<UL>
  <LI>Supports thread safe operation.=20
  <LI>Supports transactions isolation levels provided by the Pervasive PSQ=
L=20
  server engine: READ_COMMITTED and SERIALIZIBLE.=20
  <LI>Performs result set caching to reduce network access.=20
  <LI>Supports long text data through the LONGVARCHAR datatype ( 2 GB limi=
t ).=20
  <LI>Supports huge binary data through the LONGVARBINARY datatype ( 2 GB =
limit=20
  ).=20
  <LI>Supports stored procedures with parameters. </LI></UL>
<H2><A name=3DRequirements></A>System Requirements</H2>
<UL>
  <LI><B>Windows:</B> Java Development Kit version 1.5 or greater=20
  <LI><B>Linux:</B> Java Development Kit version 1.5 or greater=20
  <LI>The CLASSPATH environment variable should be modified to include com=
plete=20
  path to the pvjdbc2.jar file including the file name.=20
  <LI>Pervasive PSQL v9 engine installed with TCP/IP support. The driver w=
ill=20
  not work with previous versions of Btrieve, Scalable SQL, or Pervasive.S=
QL.=20
  </LI></UL>
<H2><A name=3DStarted></A><B>Getting Started</B></H2>
<H3><A name=3Dinstall></A>Installation</H3>
<P>The JDBC driver is shipped with the Pervasive PSQL engine. This release=
=20
installs samples and documentation for the driver. See the following JDBC=
=20
section of the Developer Center for more information: <A=20
href=3D"http://www.pervasive.com/developerzone/access_methods/jdbc.asp"=20
target=3D_new>http://www.pervasive.com/developerzone/access_methods/jdbc.a=
sp</A>=20
</P>
<H3><A name=3Dcomps></A>Components Updated</H3>
<P>The following components are in the <CODE>bin</CODE> directory. These f=
iles=20
need to be included in the the <CODE>bin</CODE> directory of your Pervasiv=
e PSQL=20
engine. For example, assuming a default installation, <CODE>c:\pvsw\bin</C=
ODE>=20
on Windows and <CODE>/usr/local/psql/bin</CODE> on Linux. </P>
<TABLE border=3D1 cellPadding=3D2 width=3D400>
  <TBODY>
  <TR>
    <TH vAlign=3Dtop width=3D"29%">
      <P><B>Component</B></P></TH>
  <TR>
    <TD vAlign=3Dtop width=3D"29%">
      <P>pvjdbc2.dll </P></TD>
  <TR>
    <TD vAlign=3Dtop width=3D"29%">
      <P>pvjdbc2.jar</P></TD>
  <TR>
    <TD vAlign=3Dtop width=3D"29%">
      <P>pvjdbc2x.jar</P></TD></TR>
  <TR>
    <TD vAlign=3Dtop width=3D"29%">
      <P>jpscs.jar</P></TD></TR><!--TR>
    <TD vAlign=3Dtop width=3D"29%">
      <P>jpscs.jar (cryptography services)</P></TD>
    <TD vAlign=3Dtop width=3D"25%">
      <P>9.10</P></TD>
</TR--></TBODY></TABLE>
<H3><A name=3D"Setting the CLASSPATH"></A><B>Setting the CLASSPATH</B></H3>
<P>So that Java applications and applets recognize the Pervasive PSQL JDBC=
=20
Driver, set your CLASSPATH environment variable to include the pvjdbc2.jar=
,=20
pvjdbc2x.jar, and jpscs.jar files.=20
<P><B>From Windows:</B> <PRE>set CLASSPATH=3D%CLASSPATH%;&lt;path to pvjdb=
c2.jar directory&gt;
     /pvjdbc2.jar

set CLASSPATH=3D%CLASSPATH%;&lt;path to pvjdbc2x.jar directory&gt;
     /pvjdbc2x.jar

set CLASSPATH=3D%CLASSPATH%;&lt;path to jpscs.jar directory&gt;
     /jpscs.jar
</PRE>
<P><B>From Linux:</B> <PRE>export CLASSPATH=3D$CLASSPATH:&lt;path to pvjdb=
c2.jar directory&gt;
     /pvjdbc2.jar

export CLASSPATH=3D$CLASSPATH:&lt;path to pvjdbc2x.jar directory&gt;
     /pvjdbc2x.jar

export CLASSPATH=3D$CLASSPATH:&lt;path to jpscs.jar directory&gt;
     /jpscs.jar
</PRE>
<H3><A name=3D"Setting the CLASSPATH"></A><B>Setting the SYSTEM PATH</B></=
H3>
<P>Windows Only. Typically, the system path is properly set at installatio=
n.=20
However, under certain circumstances it might be necessary to set it direc=
tly.=20
<P><B>From Windows:</B> <PRE>set PATH=3D%PATH%;&lt;path to pvjdbc2.jar dir=
ectory&gt;
     /pvjdbc2.dll

</PRE>
<P><A name=3D"Loading the Pervasive JDBC Driver"></A><B>Loading the Pervas=
ive JDBC=20
Driver into the Java Environment</B>=20
<P>After setting the CLASSPATH, you can now reference the Pervasive JDBC D=
river=20
from your Java application.&nbsp; You do this by using the java.lang.Class=
=20
class: <PRE>Class.forName("com.pervasive.jdbc.v2.Driver");</PRE>
<H3><A name=3D"Specifying a data"></A>Specifying a Data Source</H3>
<P>After loading the PervasiveDriver class into your Java environment, you=
 need=20
to pass a URL-style string to the java.sql.DriverManager class to connect =
to a=20
Pervasive PSQL database.&nbsp; The syntax for URL for the Pervasive JDBC d=
river=20
is: <PRE>jdbc:pervasive://&lt;machinename&gt;:&lt;portnumber&gt;/&lt;datas=
ource&gt;</PRE>
<TABLE>
  <TBODY>
  <TR>
    <TD>&lt;machinename&gt;</TD>
    <TD>is the host name or IP address of the machine that runs the Pervas=
ive=20
      DB Server</TD></TR>
  <TR>
    <TD>&lt;portnumber&gt;</TD>
    <TD>is the port on which the Pervasive DB Server is listening =96 by d=
efault=20
      it is 1583</TD></TR>
  <TR>
    <TD>&lt;datasource&gt;</TD>
    <TD>is the name of the ODBC DSN on the Pervasive database server that =
the=20
      application intends to use.</TD></TR></TBODY></TABLE>
<P>For example, if your Pervasive PSQL engine is on a machine named DBSERV=
, and=20
you wish to connect to the DEMODATA database, your URL would look like thi=
s=20
(assuming the server is configured to use the default port): <PRE>jdbc:per=
vasive://DBSERV/DEMODATA</PRE>
<P>So to connect to the database using the DriverManager class, you would =
use=20
the syntax: <PRE>Connection conn =3D
          DriverManager.getConnection("jdbc:pervasive://DBSERV:1583/DEMODA=
TA",
          loginString, passwordString);</PRE>
<P>...where "loginString" is the string that represents a user login and=20
"passwordString" is the string that represents a user password.=20
<P class=3Dnote><B>Note: </B>The Pervasive PSQL engine must be running on =
the=20
specified host in order for JDBC applets and applications to access data.=
=20
<H2><A name=3D"Developing JDBC Applets"></A><B>Developing JDBC Applets</B>=
</H2>
<P>To develop web based applications using JDBC, you need to place the JDB=
C jar=20
file in the codebase directory containing the applet classes.=20
<P>For example, if you are developing an application called MyFirstJDBCapp=
let,=20
you need to place the pvjdbc2.jar file in the directory containing the=20
MyFirstJDBCapplet class. For example, it might be C:\inetpub\wwwroot\myjdb=
c\.=20
<P>This enables the client web browser to be able to download the JDBC dri=
ver=20
over the network and connect to the database.=20
<P>You also need to put the archive parameter within the &lt;APPLET&gt; ta=
g. For=20
example: <PRE>&lt;applet CODE=3D"MyFirstJDBCapplet.class"
        ARCHIVE=3D"pvjdbc2.jar" WIDTH=3D641 HEIGHT=3D554&gt;</PRE>
<DIV class=3Dnote><B>Note:</B> The Pervasive PSQL v9 engine must be runnin=
g on the=20
web server that hosts the applet.</DIV>
<H2><A name=3DProblems></A><B>Known Issues in this Release</B></H2>
<P>The following are known issues with this release.</P>
<TABLE border=3D1 cellPadding=3D5 width=3D"75%">
  <TBODY>
  <TR>
    <TH vAlign=3Dtop width=3D"15%">Issue Number</TH>
    <TH vAlign=3Dtop width=3D"83%">Description</TH></TR>
  <TR>
    <TD width=3D"15%">n/a</TD>
    <TD width=3D"83%">n/a</TD></TR></TBODY></TABLE>
<H2><A name=3Dlinks></A>Useful Links</H2>
<P>Discuss all your Pervasive development issues at DevTalk at <A=20
href=3D"http://www.pervasive.com/devtalk">http://www.pervasive.com/devtalk=
</A>.=20
</P>
<P>See some creative applications and code snippets and share your own at=
=20
Pervasive ComponentZone at <A=20
href=3D"http://www.pervasive.com/componentzone">http://www.pervasive.com/c=
omponentzone</A>.=20
</P>
<H2><A name=3DDisclaimer></A>Disclaimer </H2>
<P><FONT size=3D2>PERVASIVE SOFTWARE INC. LICENSES THE SOFTWARE AND DOCUME=
NTATION=20
PRODUCT TO YOU OR YOUR COMPANY SOLELY ON AN "AS IS" BASIS AND SOLELY IN=20
ACCORDANCE WITH THE TERMS AND CONDITIONS OF THE ACCOMPANYING LICENSE=20
AGREEMENT.<BR>PERVASIVE SOFTWARE INC. MAKES NO OTHER WARRANTIES WHATSOEVER=
,=20
EITHER EXPRESS OR IMPLIED, REGARDING THE SOFTWARE OR THE CONTENT OF THE=20
DOCUMENTATION; PERVASIVE SOFTWARE INC. HEREBY EXPRESSLY STATES AND YOU OR =
YOUR=20
COMPANY ACKNOWLEDGES THAT PERVASIVE SOFTWARE INC. DOES NOT MAKE ANY WARRAN=
TIES,=20
INCLUDING, FOR EXAMPLE, WITH RESPECT TO MERCHANTABILITY, TITLE, OR FITNESS=
 FOR=20
ANY PARTICULAR PURPOSE OR ARISING FROM COURSE OF DEALING OR USAGE OF TRADE=
,=20
AMONG OTHERS. </FONT></P>
<P><FONT size=3D-1>Copyright =A9 1999-2006 Pervasive Software Inc. All Rig=
hts=20
Reserved. </FONT></P></BODY></HTML>

