Databases Reference
In-Depth Information
5.1 Application requirements
Any Java application needs the following packages to access the DB2 JDBC
universal driver and use it to make the connection to the DB2 database:
java.sql contains the core JDBC API.
com.ibm.db2.jcc contains the DB2-specific implementation of JDBC for
universal JDBC driver. db2jcc.jar archive contains this package.
For accessing the DataSource object for enterprise application, you need the
following packages along with the above:
javax.naming contains classes and interfaces for Java Naming and Directory
Interface.
javax.sql contained JDBC 2.0 standard extensions (db2jcc_javax.jar).
javax.transactions contains support for distributed transaction for DB2 JDBC
Type 2 driver.
Along with this files, one of these two files should be included in CLASSPATH:
db2jcc_license_cu.jar
db2jcc_license_cisuz.jar
5.2 Drivers
Java applications, which use DB2 as a database, connect to the database using
different kinds of drivers. According to the JDBC specification, there are four
types of driver architecture. DB2 supports Type 2 (deprecated as of DB2 V8.2)
and a combination of Type 2 and Type 4 drivers called universal JDBC drivers,
which combine the Type 2 and Type 4 functionalities. Using universal driver, an
application can utilize both Type 2 and Type 4 functionalities using a single
instance of driver in memory.
Universal JDBC driver for DB2
Whenever an application loads the universal driver, a single instance of Type 2
and Type 4 driver is loaded in memory and can be used to make Type 2 and
Type 4 connections. This driver is an entirely new driver and the behavior of this
driver might be different from the standard Type 2 and Type 4 drivers.The Type 2
and Type 4 driver connectivity depend on the type of URL provided to the driver
while getting the connection.
For Type 2 driver connectivity, use the following URL format:
jdbc:db2:database name
Search WWH ::




Custom Search