EasyManuals Logo

IBM DB2 User Manual

IBM DB2
585 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #34 background imageLoading...
Page #34 background image
For the DriverManager interface, you specify the type of connectivity through the
URL in the DriverManager.getConnection method. For the DataSource interface,
you specify the type of connectivity through the driverType property.
The following table summarizes the differences between type 2 connectivity and
type 4 connectivity:
Table 2. Comparison of IBM Data Server Driver for JDBC and SQLJ type 2 connectivity and IBM Data Server Driver
for JDBC and SQLJ type 4 connectivity
Function
IBM Data Server Driver for JDBC
and SQLJ type 2 connectivity
support
IBM Data Server Driver for JDBC
and SQLJ type 4 connectivity
support
Performance Better for accessing a local DB2 server Better for accessing a remote DB2
server
Installation Requires installation of native
libraries in addition to Java classes
Requires installation of Java classes
only
Stored procedures Can be used to call or execute stored
procedures
Can be used only to call stored
procedures
Distributed transaction processing
(XA)
Not supported Supported
J2EE 1.4 compliance Compliant Compliant
CICS environment Supported Not supported
IMS environment Supported Not supported
The following points can help you determine which type of connectivity to use.
Use IBM Data Server Driver for JDBC and SQLJ type 2 connectivity under these
circumstances:
v Your JDBC or SQLJ application runs locally most of the time.
Local applications have better performance with type 2 connectivity.
v You are running a Java stored procedure.
A stored procedure environment consists of two parts: a client program, from
which you call a stored procedure, and a server program, which is the stored
procedure. You can call a stored procedure in a JDBC or SQLJ program that uses
type 2 or type 4 connectivity, but you must run a Java stored procedure using
type 2 connectivity.
v Your application runs in the CICS environment or IMS environment.
Use IBM Data Server Driver for JDBC and SQLJ type 4 connectivity under these
circumstances:
v Your JDBC or SQLJ application runs remotely most of the time.
Remote applications have better performance with type 4 connectivity.
v You are using IBM Data Server Driver for JDBC and SQLJ connection
concentrator and Sysplex workload balancing support.
Related tasks
“Connecting to a data source using the DriverManager interface with the IBM
Data Server Driver for JDBC and SQLJ” on page 11
Related reference
“Properties for the IBM Data Server Driver for JDBC and SQLJ” on page 201
18 Application Programming Guide and Reference for Java

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM DB2 and is the answer not in the manual?

IBM DB2 Specifications

General IconGeneral
DeveloperIBM
Initial Release1983
LicenseProprietary
Written inC, C++
CategoryDatabase Management System (RDBMS)
Operating SystemLinux, Windows
Programming LanguagesC, C++
Data ModelsRelational
EditionsCommunity, Standard, Advanced
Key Featureshigh availability, scalability