Java Ref
Java Ref
DataDirect ®
®
Reference
© 1999 MERANT. All rights reserved. Printed in the U.S.A.
No part of this publication, with the exception of the software product user
documentation contained on a CD-ROM, may be copied, photocopied,
reproduced, transmitted, transcribed, or reduced to any electronic medium or
machine-readable form without prior written consent of MERANT.
MERANT
701 East Middlefield Road
Mountain View, California 94043
3
Table of Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
What Is DataDirect SequeLink Java Edition? . . . . . . . . . . . . . . 7
SequeLink ODBC Edition . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
SequeLink OLE DB Edition. . . . . . . . . . . . . . . . . . . . . . . . . . 8
SequeLink Java Edition . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
About the SequeLink JDBC Driver . . . . . . . . . . . . . . . . . . . . . . 17
Installing the SequeLink JDBC Driver . . . . . . . . . . . . . . . . . . . . 18
Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
SequeLink JDBC Driver Errors . . . . . . . . . . . . . . . . . . . . . . 45
SequeLink Server Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Database Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5 Using JDBCTest. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
About JDBCTest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
JDBCTest Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Starting JDBCTest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Configuring JDBCTest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Making a JDBCTest Connection . . . . . . . . . . . . . . . . . . . . . 80
Executing a Simple Select Statement . . . . . . . . . . . . . . . . . 84
Executing a Prepared Statement . . . . . . . . . . . . . . . . . . . . 86
Retrieving Database Metadata . . . . . . . . . . . . . . . . . . . . . . 90
Scrolling Through a Result Set . . . . . . . . . . . . . . . . . . . . . . 93
Executing a Batch on a Prepared Statement . . . . . . . . . . . 97
Using Stored Procedures With Oracle . . . . . . . . . . . . . . . . 101
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Preface
SequeLink Server
■ SequeLink Server for Windows NT
■ SequeLink Server for UNIX
■ SequeLink Server for AS/400
■ SequeLink Server for OS/390
SequeLink Server
■ SequeLink Server for Windows NT
■ SequeLink Server for UNIX
■ SequeLink Server for AS/400
■ SequeLink Server for OS/390
SequeLink Server
■ SequeLink Server for Windows NT
■ SequeLink Server for UNIX
■ SequeLink Server for AS/400
■ SequeLink Server for OS/390
Other Documentation
SequeLink ODBC Edition:
■ SequeLink ODBC Edition Client Installation Guide
■ SequeLink Server Installation Guide
■ SequeLink ODBC Driver Reference for Windows 3.1x
■ SequeLink ODBC Driver Reference for Windows 9x,
Windows NT, UNIX, and Macintosh
■ SequeLink Administrator’s Guide
■ SequeLink Error Codes and Messages Reference
Note: Occasionally, this book refers the reader to Web URLs for
more information about specific topics, including Web URLs not
maintained by MERANT. Because it is the nature of the Web and
Web documents to change frequently, we only can guarantee
that the URLs referenced in this book are correct at the time of
publishing.
Typographical Conventions
This reference uses the following typographical conventions:
Convention Explanation
italics Introduces new terms with which you may not be
familiar, and is used occasionally for emphasis.
bold Emphasizes important information. Also indicates
button, menu, and icon names on which you can
act. For example, click Next.
UPPERCASE Indicates the name of a file. For operating
environments that use case-sensitive filenames, the
correct capitalization is used in information specific
to those environments.
Also indicates keys or key combinations that you
can use. For example, press the ENTER key.
monospace Indicates syntax examples, values that you specify,
or results that you receive.
monospaced Indicates names that are placeholders for values
italics that you specify. For example, filename.
forward slash / Separates menus and their associated commands.
For example, Select File / Copy means that you
should select Copy from the File menu.
The slash also separates directory levels when
specifying locations under UNIX.
vertical rule | Indicates an “OR” separator used to delineate
items.
Convention Explanation
brackets [ ] Indicates optional items. For example, in the
following statement: SELECT [DISTINCT], DISTINCT
is an optional keyword.
Also indicates sections of the Windows Registry.
braces { } Indicates that you must select one item. For
example, {yes | no} means that you must specify
either yes or no.
ellipsis . . . Indicates that the immediately preceding item can
be repeated any number of times in succession. An
ellipsis following a closing bracket indicates that all
information in that unit can be repeated.
Mouse Conventions
This action… Means to…
Click Point to an object with the mouse pointer and
momentarily press the left mouse button.
Double-click Press the left mouse button twice.
Right-click Momentarily press the right mouse button.
Drag Press and hold the left mouse button while
dragging item(s) to another part of the screen.
SHIFT+Click Click an object to select it; then, press and hold
the SHIFT key. Click another object to select the
intervening series of objects.
CTRL+Click Press and hold the CTRL key; then, click a
selection. This lets you select or deselect any
combination of objects.
Keyboard Conventions
Select menu items by using the mouse or pressing ALT+ the key
letter of the menu name or item.
Environment-Specific Information
This reference supports users of various operating environments.
Where it provides information that is not applicable to all
supported environments, the following symbols are used to
identify that information.
Symbol Environment
Windows 9x. Information specific to the Microsoft
Windows 95 or Windows 98 environment is identified by
the Windows symbol and the numbers “9x.”
Windows NT. Information specific to the Microsoft
Windows NT environment is identified by the Windows
symbol and the letters “NT.”
UNIX. Information specific to UNIX environments is
identified by this symbol, which applies to all UNIX
environments supported. UNIX is a registered trademark in
the United States and other countries, licensed exclusively
through X/Open Company Ltd.
Macintosh Power PC. Information specific to the
Macintosh Power PC environment is identified by the
MacOS symbol, which is a registered trademark of
Apple Computer, Inc., and the words “Power PC.”
Internet
Telephone
Australia 1 800 335 664 or 8:30-5:30 p.m. Local Melbourne Time (LMT)
9816 9977 for
Melbourne Metro
Belgium 0800 724 61 9:00-6:30 p.m. CET
France 0800 91 56 07 9:00-6:30 p.m. CET
Germany 0130 822 496 or 9:00-6:30 p.m. CET
+44 1727 812898
Japan 81-3-5401-9660 9:00-12:00, 1:00-5:00 p.m. JST
The Netherlands 0800 022 1609 9:00-6:30 p.m. CET
New Zealand 1 800 335 664 8:30-5:30 p.m. LMT
United Kingdom +44 1727 811881 8:00-5:30 p.m. GMT
and Ireland
USA and Canada 1 800 443 1601 8:30-8:00 p.m. EST
When you contact us, make sure that you can provide the
following information:
1 Getting Started
The SequeLink JDBC Driver can be used with the SequeLink Proxy
Server to provide reliable transaction security for your JDBC
applications and applets using Secure Socket Layer (SSL)
encryption. For more information about the SequeLink Proxy
Server, see Chapter 3, “Using the SequeLink Proxy Server.” For
more information about SSL encryption, see Chapter 4, “Using
SSL Encryption.”
In addition, you can use the following tools with the SequeLink
JDBC Driver:
■ Spy is a tracking tool for JDBC calls that passes calls issued by
an application to the underlying JDBC driver and logs detailed
information about those calls.
driver
classes
slje.jar Contains all the JDBC driver classes (JAR file). To load the driver, add this file to
your CLASSPATH variable.
crysec.jar Contains the SSL implementation (JAR file). To use SSL, add this file to your
CLASSPATH variable.
src Contains Java sources that extend the JDBC driver, including an example of
interfacing with JSafe (Domestic version only) and an example of a certificate
checker class.
jdbctest
classes Contains all the JDBCTest classes. To use JDBCTest, add this directory to your
CLASSPATH variable.
jdbctest.bat Starts JDBCTest (batch file).
jdbctest.html Starts JDBCTest as an applet (HTML file).
jdbctest.sh Starts JDBCTest (UNIX shell script).
proxy
proxyserver.jar Contains the Proxy Server (JAR file). To load the Proxy Server, add this file to
your CLASSPATH variable.
crysec.jar Contains the SSL implementation (JAR file). To use SSL, add this file to your
CLASSPATH variable.
src Contains Java sources that extend the JDBC driver, including an example of
interfacing with JSafe (Domestic version only).
spy
classes
spy.jar Contains all the JDBCSpy classes (JAR file). To load Spy, add this file to your
CLASSPATH variable.
uninstall.class Un-installs SequeLink Java Edition Client.
or
jdbc:sequelink:socket://hostname:port/[type][;<key>=<value>]...
where:
Examples:
jdbc:sequelink://waterloo:4003/[Oracle];
jdbc:sequelink://189.23.5.25:4003/[Oracle];OSUser=john;
OSPassword=whatever
jdbc:sequelink://189.23.5.132:4004/[Informix];Database=stores7
jdbc:sequelink://189.23.5.132:4004/[Informix];Database=stores7;
OSUser= john;OSPassword=whatever
jdbc:sequelink://189.23.5.68:4005/[Sybase];Database=pubs;
OSUser=john;OSPassword=whatever
jdbc:sequelink://qant:4006/[SQLServer];Database=pubs;OSUser=john;
OSPassword=whatever
jdbc:sequelink:ssl://bryce:9500/[Oracle];ciphersuites=
SSL_DH_anon_WITH_RC4_128_MD5
jdbc:sequelink:ssl://bryce:9502/[Oracle];ciphersuites=
SSL_DHE_RSA_WITH_DES_CBC_SHA;certificatecheck=
intersolv.sequelink.qa.AcceptTestCert
Connection Attributes
For a description of:
Service Attributes
This section lists connection attributes that depend on the type
of database you want to access.
DB2 on AS/400
user - password
These are the AS/400 user name and password required to log on
to an AS/400 server.
Library
DB2 on NT
user - password
These are the DB2 user name and user authorization required to
log on a DB2 on NT database.
Database
OSUser - OSPassword
These attributes identify the host user account under which the
SequeLink Server process will run. If your server specifies the host
user ID and password or if no user authentication is required, do
not specify the OSUser and OSPassword attributes. For more
information about specifying user authentication levels, refer to
the SequeLink Administrator’s Guide.
DB2 on OS/390
user - password
These are the OS/390 user name and password required to log
on to your OS/390 system. The user name and password are
passed to the security system installed on OS/390. If no security
system is installed, dummy values must be supplied. SequeLink
supports the following security systems: RACF, CA-ACF2, and
CA-TOP SECRET.
DB2 on UNIX
user - password
These are the DB2 user name and user authorization required to
log on a DB2 on UNIX database.
Database
OSUser - OSPassword
These attributes identify the host user account under which the
SequeLink Server process will run. If your server specifies the host
user ID and password or if no user authentication is required, do
not specify the OSUser and OSPassword attributes. For more
Informix
user - password
These are the user name and user authorization required to log
on to an Informix database.
Database
/usr/informix/production
OSUser - OSPassword
BlockFetchForUpdate
These are the Microsoft SQL Server user name and password
required to log on to a SQL Server database.
Database
OSUser - OSPassword
ODBC Btrieve
To use the SequeLink ODBC Socket with the MERANT Connect
ODBC for Btrieve driver, supply the following parameters.
user - password
The user and password attributes identify the host user account
under which the SequeLink Server process should run.
Database
ODBC dBASE
To use the SequeLink ODBC Socket with the MERANT Connect
ODBC for dBASE driver, supply the following parameters.
user - password
The user and password attributes identify the host user account
under which the SequeLink Server process should run.
Database
ODBC Excel
To use the SequeLink ODBC Socket with the MERANT Connect
ODBC for Excel driver, supply the following parameters.
user - password
The user and password attributes identify the host user account
under which the SequeLink Server process should run.
Database
ODBC FoxPro
To use the SequeLink ODBC Socket with the MERANT Connect
ODBC for FoxPro driver, supply the following parameters.
user - password
The user and password attributes identify the host user account
under which the SequeLink Server process should run.
Database
user - password
These attributes identify the host user account under which the
SequeLink Server process should run. If your server specifies the
host user ID and password or if no user authentication is
required, do not specify the user and password attributes. For
more information about specifying user authentication levels,
refer to the SequeLink Administrator’s Guide.
Database
ODBC Paradox
To use the SequeLink ODBC Socket with the MERANT Connect
ODBC for Paradox driver, supply the following parameters.
user - password
The user and password attributes identify the host user account
under which the SequeLink Server process should run. If your
server specifies the host user ID and password or if no user
authentication is required, do not specify the user and
password attributes. For more information about specifying user
authentication levels, refer to the SequeLink Administrator’s
Guide.
Database
ODBC Socket
To use the SequeLink ODBC Socket, supply the following
parameters:
user - password
OSUser - OSPassword
Datasource
This is the data source that will be used for this connection.
Specify this parameter using either of the following formats:
Database
ODBC Text
To use the SequeLink ODBC Socket with the MERANT Connect
ODBC for Text driver, supply the following parameters.
user - password
These attributes identify the host user account under which the
SequeLink Server process should run. If your server specifies the
host user ID and password or if no user authentication is
required, do not specify the user and password attributes. For
more information about specifying user authentication levels,
refer to the SequeLink Administrator’s Guide.
Database
OpenINGRES
user - password
These are the user name and user authorization required to log
on to an OpenINGRES database.
Database
Flags
Oracle
user - password
These are the Oracle user name and user authorization required
to log on to an Oracle database.
OSUser - OSPassword
These attributes identify the host user account under which the
SequeLink Server process will run. If your server specifies the host
user ID and password or if no user authentication is required, do
not specify the OSUser and OSPassword attributes. For more
information about specifying user authentication levels, refer to
the SequeLink Administrator’s Guide.
Sybase
user - password
These are the Sybase user name and user authorization required
to log on to a Sybase database.
Database
ServerName
OSUser - OSPassword
Client Attributes
Certificatecheck
Ciphersuites
DataDictionary
DataDictionaryCatalog
DataDictionarySchema
ForcePasswordChange
NewPassword
Transliteration
jdbc:sequelink://qant:4003/[Oracle];transliteration=Cp850
Value Description
8859_1 ISO Latin-1
8859_2 ISO Latin-2
8859_3 ISO Latin-3
8859_4 ISO Latin-4
8859_5 ISO Latin/Cyrillic
8859_6 ISO Latin/Arabic
8859_7 ISO Latin/Greek
8859_8 ISO Latin/Hebrew
8859_9 ISO Latin-5
Cp1250 Windows Eastern Europe/Latin-2
Cp1251 Windows Cyrillic
Cp1252 Windows Eastern Europe/Latin-1
Cp1253 Windows Greek
Cp1254 Windows Turkish
Cp1255 Windows Hebrew
Cp1256 Windows Arabic
Cp437 PC Original
Cp737 PC Greek
Cp850 PC Latin-1
Value Description
Cp852 PC Latin-2
Cp857 PC Turkish
Cp860 PC Portuguese
Cp861 PC Icelandic
Cp862 PC Hebrew
Cp863 PC Canadian French
Cp864 PC Arabic
Cp865 PC Nordic
Cp866 PC Russian
Cp874 Windows Thai
EUCJIS Japanese EUC
GB2312 GB2312-80 Simplified Chinese
JIS JIS
KSC5601 KSC5601 Korean
SJIS PC and Windows Japanese
http://java.sun.com/products/jdk/1.1/docs/guide/intl/
encoding.doc.html
http://java.sun.com/products/jdk/1.2/docs/guide/internat/
encoding.doc.html
intersolv.jdbc.sequelink.SequeLinkDriver
5 Click OK.
8 In the Database and User Name fields, type the required user
and password connection attributes. For information about
connection properties, see “Specifying Connection
Properties” on page 25.
Error Messages
The SequeLink JDBC Driver reports errors to the calling
application by returning SQLExceptions. Each SQLException
contains the following information:
For example:
Use the native error code to look up details about the possible
cause of the error. For a list of all error codes and messages, refer
to the SequeLink Error Codes and Messages Reference.
Sometimes, you may need to check the last JDBC call your
application made and refer to the JDBC specification for
recommended action.
For example:
Use the native error code to look up details about the possible
cause of the error. For a list of all error codes and messages, refer
to the SequeLink Error Codes and Messages Reference.
Database Errors
An error generated by the database has the following format:
For example:
Use the native error code to look up details about the possible
cause of the error. For these details, refer to your database
documentation.
Troubleshooting
Q: Why can't I register the SequeLink JDBC Driver?
Class.forName(...).newInstance() instead of
Class.forName(...).
A: You specified an incomplete URL. Make sure that the URL you
specified is compatible with the specifications explained in
“Connection Attributes” on page 25.
host and transfers data packets between the JDBC client and the
remote host.
Firewall
Web
Server
Internet
SequeLink SequeLink
Proxy Server JDBC Driver
Java
Applet
Other
Server
SequeLink
Server
Note: Make sure that you use different port numbers for Port
and AdminPort. Also, the port numbers for Port and
AdminPort cannot be used by another TCP/IP service.
■ On Windows NT, you can use the SequeLink Server
Administrator to obtain a list of TCP ports that are used by
SequeLink Server services. In addition, verify the port numbers
in the system32\etc\drivers\services file.
On UNIX:
startproxyserver.sh -s configfile
On UNIX:
proxyserver.sh -q configfile
Logging
All messages generated by the SequeLink Proxy Server are
written to a log file in the current working directory. The log file
name has the format:
Proxy_Server_Name.log
■ Automatic startup
■ Log on as System Account
■ Allow service to interact with the desktop
Note: Make sure that both the proxyserver.jar and crysec.jar files
located in the proxy/classes directory are added to the
CLASSPATH definition of your Java Virtual Machine.
cmdsrvc -s service_name -d
SequeLink SequeLink
JDBC Driver Proxy Server
Java SequeLink
Application Server
For more information about using SSL cipher suites, see “Using
SSL Cipher Suites” on page 59. For more information about
configuring the SequeLink Proxy Server to use SSL, see “Enabling
SSL Encryption” on page 65.
jdbc:sequelink:ssl://hostname:port/[type];ciphersuites=value
[;<key>=<value>]...
SSL_KeyExchangeMethod_WITH_DataTranserCipher_DigestFunction
Cipher Suite
SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA
SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA
Network=ssl
CipherSuites=value
Notes:
Table 4-5 on page 66 lists the key exchange algorithms you can
use and the keyword/value pairs you can specify in the proxy
Table 4-5. Key Exchange Algorithms and Keyword/Value Pairs You Can Specify in the
Proxy Server Configuration File
Key Exchange
Algorithm Keyword Value
DHE_DSS DSSCertificate Name of the file with the DSS certificate in DER
format.
DSSPrivateKey Name of the file with the DSS private key in
PKCS8 encrypted format.
PassPhrase Pass phrase with which the private key file is
encrypted. If this keyword is unspecified, the
Proxy Server will prompt for the pass phrase.
UsePassPhraseDialog To be prompted for the pass phrase using the
standard input/output instead of a dialog box,
set this keyword to No. Remember that the pass
phrase will be shown on the screen as you type.
DHE_DSS_EXPORT DSSCertificate Name of the file with the DSS certificate in DER
format.
DSSPrivateKey Name of the file with the DSS private key in
PKCS8 encrypted format.
PassPhrase Pass phrase with which the private key file is
encrypted. If this keyword is unspecified, the
Proxy Server will prompt for the pass phrase.
UsePassPhraseDialog To be prompted for the pass phrase using the
standard input/output instead of a dialog box,
set this keyword to No. Remember that the pass
phrase will be shown on the screen as you type.
DHE_RSA RSACertificate Name of the file with the RSA certificate in DER
format.
RSAPrivateKey Name of the file with the RSA private key in
PKCS8 encrypted format.
PassPhrase Pass phrase with which the private key file is
encrypted. If this keyword is unspecified, the
Proxy Server will prompt for the pass phrase.
Table 4-5. Key Exchange Algorithms and Keyword/Value Pairs You Can Specify in the
Proxy Server Configuration File (cont.)
Key Exchange
Algorithm Keyword Value
UsePassPhraseDialog To be prompted for the pass phrase using the
standard input/output instead of a dialog box,
set this keyword to No. Remember that the pass
phrase will be shown on the screen as you type.
RSA RSACertificate Name of the file with the RSA certificate in DER
format.
RSAPrivateKey Name of the file with the RSA private key in
PKCS8 encrypted format.
PassPhrase Pass phrase with which the private key file is
encrypted. If this keyword is unspecified, the
Proxy Server will prompt for the pass phrase.
UsePassPhraseDialog To be prompted for the pass phrase using the
standard input/output instead of a dialog box,
set this keyword to No. Remember that the pass
phrase will be shown on the screen as you type.
■ The SequeLink Proxy Server prompts for the private key when
it starts. In graphical user interface (GUI) environments, a
dialog box may appear. For example:
where
On UNIX:
encrypt.sh infile outfile
where
where
On UNIX:
decrypt.sh infile outfile
where
The encryption and decryption tools prompt for the pass phrase
and show it on the screen as you type, so make sure that you
close the terminal session window after you have encrypted or
decrypted the file to prevent unauthorized people from
viewing it.
package intersolv.sequelink.net;
public interface CertificateCheckerInterface
{
public void CheckCertificate(byte[] berX509cert)
throws SecurityException;
}
The SequeLink JDBC Driver calls this method and passes the X509
certificate that it received during the SSL handshake to the
method. This method must verify that the received certificate is
indeed the certificate that is expected. If it proves not to be the
right certificate, the method must throw a SecurityException.
You specify the name of the class that implements this interface
in the certificatecheck keyword in the JDBC connection
URL.
These classes retrieve the server certificate from a CAB file, JAR
file, or local file, and compare it with the certificate that is passed
as the berX509cert parameter to the CheckCertificate method.
You can change these files as appropriate for your environment.
SequeLink does not provide the routines for RSA and RC4. When
you use a cipher suite that specifies RSA or RC4 with the
standard installation of SequeLink Java Edition Client, you will
receive an exception telling you that the underlying
cryptographic engine is not available.
If you are using the JSafe library from RSA Data Security, Inc, you
can use the two Java source files, which provide support for RSA
and RC4, that are supplied with SequeLink:
src\crysec\RC4.java
src\crysec\RSA.java
You must compile the Java source files and replace the default
implementation of crysec/RC4.class and crysec/RSA.class with the
classes that you compile. When you compile these classes, make
sure that the crysec.jar file is added to your CLASSPATH variable.
5 Using JDBCTest
About JDBCTest
JDBCTest contains menu selections that correspond to specific
JDBC functions—for example, connecting to a database or
passing a SQL statement. It allows you to:
JDBCTest Tutorial
This JDBCTest tutorial explains how to use the most important
features of JDBCTest (and the JDBC API) and assumes that you
can connect to an Oracle database with the standard available
demo table or fine-tune the sample SQL statements shown in
this example as appropriate for your environment.
Starting JDBCTest
How you start JDBCTest depends on your platform, whether you
want to start JDBCTest as an application or applet, and your Java
Virtual Machine.
Note: This example assumes that you have installed the JDK 1.1 or
JDK 1.2 on your workstation and that java.exe is available in your
PATH.
On Solaris
Run the jbctest.sh file located in the <installdir>/jdbctest
directory.
Note: This example assumes that you have installed the JDK 1.1 or
JDK 1.2 on your workstation and that Java is available in your
PATH.
As an Applet
Start your applet viewer or Web browser and open the
jdbctest.html file located in the <installdir>/jdbctest
directory.
Configuring JDBCTest
The default JDBCTest configuration file is <installdir>/
jdbctest/classes/Config.txt. This file can be edited, as appropriate,
for your environment using any text editor. All parameters are
configurable, but the most commonly configured parameters are:
Click OK. The main JDBCTest window indicates that the driver
registration succeeded.
■ In the Java Code scroll box, the actual Java code used to
implement the last action
Tip: Check the Concatenate check box to see the Java code
of all previous actions; otherwise, the Java code of only
the last action will be shown.
3 Select Connection / Connect to DB. JDBC prompts with a list of
default connection URLs. Select one from the list and change
it as appropriate for your environment.
■ In the Java Code scroll box, the actual Java code used to
implement the last action
4 Select Results / Show All Results. The data from your result
set is displayed.
5 Scroll through the code in the Java Code scroll box to see
which JDBC calls have been implemented by JDBCTest.
Click Close.
3 Scroll through the Java code in the Java Code scroll box to
find out which JDBC calls have been implemented by
JDBCTest.
8 Click Close.
d Click Set.
3 In the Enter SQL Here scroll box, type the name of the
preceding PL/SQL package.
d Click Set.
Click Close.
This chapter introduces Spy, a tool that allows you to track JDBC
calls, and describes how to use it.
About Spy
Spy passes calls issued by an application to an underlying JDBC
driver and logs detailed information about those calls. It
provides the following advantages:
■ Even if your JDBC driver does not support logging, you can
still log JDBC calls.
jdbc:spy:{original-url};[<key>=<value>;]
Example B:
jdbc:spy:{jdbc:sequelink://...};log=System.out;linelimit=80
*Driver.connect(jdbc:spy:{jdbc:sequelink://QANT:4003/ [Oracle];})
trying driver[className=intersolv.jdbc.spy.SpyDriver,
context=null,intersolv.jdbc.spy.SpyDriver@1ec49f]3
getConnection returning
driver[className=intersolv.jdbc.spy.SpyDriver,
context=null,intersolv.jdbc.spy.SpyDriver@1ec49f]5
spy>> Connection[1].getWarnings()
spy>> OK6
spy>> Connection[1].createStatement
spy>> OK (Statement[1])7
spy>> ResultSet[1].getMetaData()
spy>> OK (ResultSetMetaData[1])9
spy>> ResultSetMetaData[1].getColumnCount()
spy>> OK (3)10
spy>> ResultSet[1].next()
spy>> OK (true)14
spy>> ResultSet[1].next()
spy>> OK (false)18
spy>> ResultSet[1].close()
spy>> OK19
spy>> Connection[1].close()
spy>> OK20
Notes:
1: The Spy driver is registered. The spy>> prefix indicates that this
line has been logged by Spy.
18: The application attempts to fetch the second row, but the
database returned only one row for this query.
A JDBC Support
This appendix describes the JDBC 1.22 and JDBC 2.0 functionality
supported by the SequeLink JDBC Driver.
Table A-1. JDBC 1.22 Functionality Supported by the SequeLink JDBC Driver
[getQueryTimeOut() -
setQueryTimeOut()]
■ No support for cancel execution [cancel()]
Table A-1. JDBC 1.22 Functionality Supported by the SequeLink JDBC Driver (cont.)
Table A-2. JDBC 2.0 Functionality Supported by the SequeLink JDBC Driver
■ setCharacterStream()
■ getCharacterstream()
■ getStatement()
Table A-2. JDBC 2.0 Functionality Supported by the SequeLink JDBC Driver (cont.)
Scrollable Cursors
Scrollable cursors can move backward and forward in a result
set, allowing the application to scroll back and forth through
retrieved data. SequeLink Java Edition supports scrollable cursors
against a selected list of databases.
■ Forward-only
■ Scroll-insensitive
■ Scroll sensitive
Concurrency Types
JDBC 2.0 defines the following concurrency types for a result set:
■ Read-only
■ Updatable
• Join
• Aggregate functions
• Group By
• Scroll-sensitive result sets are not supported when a
fragmented table is not created explicitly with the With
RowIDs clause. This only applies to Informix.
JDBC Compatibility
Table A-3 shows compatibility between the JDBC application
versions, Java Virtual Machines, and the SequeLink JDBC Driver.
Threading
The SequeLink JDBC Driver is completely thread safe; that is, it
will not fail when database requests are made on separate
threads.
■ Thread impaired. The JDBC driver serializes all JDBC calls. All
requests are handled one by one, without concurrent
processing.
■ Size of the byte code that is loaded. The more bytes that are
transferred, the slower the download.
First, you must package all classes of your applet into a JAR file.
Second, copy the JAR file into the directory indicated by the
codebase tag, and third, specify the JAR file in the
archive tag.
For example:
<html>
<applet
width=100 height=100
code=JDBCTestApplet
codebase=.
archive=myapplet.jar>
<param name=ConfigFile value=Config.txt>
</applet>
<html>
<applet
width=100 height=100
code=JDBCTestApplet
codebase=.
archive=myapplet.jar,slje.jar,crysec.jar>
<param name=ConfigFile value=Config.txt>
</applet>
A: The SequeLink JDBC Driver and SSL classes are packaged in the
JAR files slje.jar and crysec.jar, which are located in the directory
<installdir>/driver/classes. Copy these JAR files to your Web
server and make sure that the JAR files are specified correctly in
your HTML code using the codebase and archive tags in the
applet tag.
http://java.sun.com/products/jdbc/
■ http://java.sun.com/products/jdk/1.2/docs/guide/jdbc/
index.html
■ http://java.sun.com/products/jdk/1.1/docs/guide/jdbc/
index.html
intersolv.jdbc.sequelink.SequeLinkDriver:
sun.jdbc.odbc.JdbcOdbcDriver
The sql.drivers property can be set like other Java properties,
using the -D option. For example:
java -Dsql.drivers=intersolv.jdbc.sequelink.
SequeLinkDriver
Properties p = System.getProperties();
p.put (“sql.drivers”,
“intersolv.jdbc.sequelink.SequeLinkDriver”);
System.setProperties (p);
4 Method 3: Explicitly load the driver class using the standard
Class.forName() method. To do this, code the following lines
and call DriverManager.getConnection():
Class.forName(“intersolv.jdbc.sequelink.
SequeLinkDriver”);
A: The classes you need to import are all contained in the java.sql
package. To import these classes, include the following line at the
beginning of your code:
import java.sql.*
A: You can use any certificate for SSL encryption that you can use
for your Web server. If you have a certificate management
environment (for example, SSLeay), you can generate certificates
yourself. For more information about SSLeay, go to:
http://www.psy.uq.oz.au/~ftp/Crypto
http://www.psy.uq.oz.au/~ftp/Crypto
A: Verifying the server certificate assures you that you are really
connected to the correct server. The SSL handshake guarantees
that the site it received the certificate from knows the private key
that corresponds to the public key in the certificate. If you verify
that the certificate is the one that you expected, you are sure that
you are communicating with the correct server. If you accept any
certificate, you have the same level of protection as with an
anonymous cipher suite. This means that only you and the server
with which you are communicating can decipher the
communication. So, you are protected from eavesdropping.
http://www.rsa.com/rsalabs/pkcs1
This is the reason why the SequeLink JDBC Driver always returns
a generic handshake error to the client. For more information
about the error’s possible cause, review the proxy server log file.
Index
Symbols OpenINGRES 35
Oracle 35
SequeLink ODBC Socket 33
"man-in-the-middle" security infiltrations 59 SSDD 37
Sybase 36
Transliteration 39
A
Advantages of using SequeLink Shadow B
Data Dictionaries (SSDDs) 123
Algorithms BigDecimal objects 128
Asymmetric cryptographic 59 BlockFetchForUpdate 28
Message digest 60
Symmetric cryptographic 60
Applets, untrusted 132
Asymmetric cryptographic algorithms 59
Attributes
C
BlockFetchForUpdate 28
Certificatecheck 37
Certificate check 37
Certificates
CipherSuites 37
Converting to DER format 133
Client 37
Obtaining 133
Connection 25
Verifying for the SequeLink Proxy
DB2 on AS/400 26
Server 73
DB2 on NT 26
Character set conversion 127
DB2 on OS/390 27
Cipher suites
DB2 on UNIX 27
About 60
ForcePasswordChange 38
Specifying 60
Informix 28
Supported 61
Microsoft SQL Server 29
Using 59
NewPassword (DB2 and OS/390) 38
Client attributes 37
ODBC Btrieve 29
Configuring
ODBC dBASE 30
JDBCTest 80
ODBC Excel 31
SequeLink Proxy Server 51
ODBC FoxPro 31
Connecting
ODBC Microsoft Access 32
With JDBCTest 41
ODBC Paradox 32
With URLs 21
ODBC Text 34
Connection
Attributes 25
F
Problems, troubleshooting 46
URL examples 24 Fetching BigDecimal objects 128
URL format 21 ForcePasswordChange 38
contacting Technical Support 14 Frequently asked questions 129
Conventions used in this book 12 Functionality
Cryptographic characteristics JDBC 1.22 113
Data transfer ciphers 64 JDBC 2.0 115
Key exchange algorithmns 63
H
D
Host name 22
Data transfer ciphers 64
Databases supported 130
DataDictionary 37
DataDictionaryCatalog 38 I
DataDictionarySchema 38
DB2 Importing classes for JDBC 132
ForcePasswordChange 38 Improving character set conversion
NewPassword 38 performance 127
Password expiration 38 Informix connection attributes 28
DB2 on AS/400 connection attributes 26 Installing SequeLink Proxy Server as a
DB2 on NT connection attributes 26 Windows NT service 55
DB2 on OS/390 connection attributes 27
DB2 on UNIX connection attributes 27
Decryption tool 72
Downloading applets, tips 125 J
JAR files 125
Java security restrictions 49, 132
E JDBC
Compatibility 120
Enabling SSL encryption 65 JDBC 1.22 functionality 113
Encryption JDBC 2.0 functionality 115
About 57 Support 113
Using the encryption tool 71 Technical information 131
Error messages 44 JDBCTest
Examples About 77
Connection URLs 24 Configuring 80
URL (SequeLink JDBC Driver) 24 Connecting with 41, 80
URL (Spy) 109
Executing
A batch on a Prepared statement 97
O
A Prepared statement 86
A simple Select statement 84 ODBC
Making a JDBCTest connection 80 Btrieve connection attributes 29
Retrieving database metadata 90 dBASE connection attributes 30
Scrolling through a result set 93 Excel connection attributes 31
Starting 78 FoxPro connection attributes 31
As an applet 78 Microsoft Access connection attributes 32
On Solaris (UNIX) 78 Paradox connection attributes 32
On Windows 9x and Windows NT 78 Socket connection attributes 33
Using a Java Virtual Machine other than Text connection attributes 34
the JDK 78 OpenINGRES connection attributes 35
Tutorial 77 Oracle connection attributes 35
Using stored procedures with Oracle 101 OS/390
ForcePasswordChange 38
NewPassword 38
Password expiration 38
K
Key exchange algorithms 63
P
Pass phrase, providing 68
L Password expiration, OS/390 and DB2 38
PKCS8 format 70
Private keys
Log example, Spy 110
PKCS8 format 70
Logging, SequeLink Proxy Server 53
Using 68
M R
Message digest algorithms 60
Registering the SequeLink JDBC Driver 46
Microsoft SQL Server connection
RSA and RC4 algorithms, using 75
attributes 29
N
NewPassword 38
S CipherSuites 37
Connection URL format 21
Data transfer ciphers 64
Scrollable cursors Enabling 65
Concurrency types 117 Key exchange algorithms 63
Result set types 117 Keyword/value pairs 66
Using with the SequeLink JDBC Driver 118 Supported cipher suites 61
Security restrictions, Java 49 Using
SequeLink ODBC Socket connection Cipher suites 59
attributes 33 Decryption tool 72
SequeLink Proxy Server Encryption tool 71
About 49 Starting
Configuring 51 JDBCTest 78
Installing as a Windows NT service 55 SequeLink Proxy Server
Logging 53 UNIX 52
Obtaining certificates 133 Windows NT 52
Pass phrase 68 Stopping
Starting SequeLink Proxy Server (UNIX) 53
UNIX 52 SequeLink Proxy Server (Windows NT) 53
Windows NT 52 Stored procedures 101
Stopping SupportNet 14
UNIX 53 Sybase connection attributes 36
Windows NT 53 Symmetric cryptographic algorithms 60
Using as a Windows NT service 54
Validating certificate 73
SequeLink Shadow Data Dictionaries (SSDDs)
DataDictionary 37
DataDictionaryCatalog 38
T
DataDictionarySchema 38
TCP port 22, 52
Using 123
Technical Support, contacting 14
Service type 23
Testing your connection 41
Solaris (UNIX), starting JDBCTest 78
Threading 121
Specifying
Transliteration
Cipher suites 60
Class 127
Incomplete URLs 48
Client attribute 39
Spy
Improving character set conversion
About 107
performance 127
Log example 110
Troubleshooting connection problems 46
URL examples 109
URL syntax 107
SSDD client attributes 37
SSL encryption
About 57
Certificatecheck 37
U Starting JDBCTest 78
Un-installing SequeLink Proxy Server as a
Windows NT service 56
Un-installing SequeLink Proxy Server as a WWW, using to contact technical support 14
Windows NT service 56
Untrusted applets 132
URL
Examples (SequeLink JDBC Driver) 24
Examples (Spy) 109
Format for connections 21
Specifying an incomplete 48
Using
Decryption tool 72
Encryption tool 71
Private keys with the SequeLink Proxy
Server 68
RSA and RC4 algorithms 75
Scrollable cursors with the SequeLink JDBC
Driver 118
SequeLink Proxy Server as a Windows NT
service 54
SSL cipher suites 59
SSL encryption 57
V
Validating the SequeLink Proxy Server
certificate 73
W
Windows 9x, starting JDBCTest 78
Windows NT
Installing SequeLink Proxy Server as a
Windows NT service 55
SequeLink Proxy Server as a Windows NT
service 54