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 #5 background imageLoading...
Page #5 background image
Contents
About this information .............................ix
Who should read this information ............................ix
DB2 Utilities Suite .................................ix
Terminology and citations...............................ix
Accessibility features for DB2 Version 9.1 for z/OS ......................x
How to send your comments .............................xi
How to read syntax diagrams .............................xi
Chapter 1. Java application development for DB2 ..................1
Chapter 2. Supported drivers for JDBC and SQLJ..................3
JDBC driver and database version compatibility .......................4
DB2 Database for Linux, UNIX, and Windows and IBM Data Server Driver for JDBC and SQLJ levels .....5
Chapter 3. JDBC application programming.....................7
Example of a simple JDBC application ...........................7
How JDBC applications connect to a data source .......................9
Connecting to a data source using the DriverManager interface with the IBM Data Server Driver for JDBC and
SQLJ.....................................11
Connecting to a data source using the DataSource interface ..................15
How to determine which type of IBM Data Server Driver for JDBC and SQLJ connectivity to use .....17
JDBC connection objects ..............................19
Creating and deploying DataSource objects ........................19
Java packages for JDBC support ............................21
Learning about a data source using DatabaseMetaData methods..................21
DatabaseMetaData methods for identifying the type of data source ................22
Variables in JDBC applications .............................23
JDBC interfaces for executing SQL............................24
Creating and modifying database objects using the Statement.executeUpdate method .........24
Updating data in tables using the PreparedStatement.executeUpdate method ............25
JDBC executeUpdate methods against a DB2 for z/OS server..................27
Making batch updates in JDBC applications .......................28
Learning about parameters in a PreparedStatement using ParameterMetaData methods .........31
Data retrieval in JDBC applications ..........................32
Calling stored procedures in JDBC applications ......................45
LOBs in JDBC applications with the IBM Data Server Driver for JDBC and SQLJ ...........49
ROWIDs in JDBC with the IBM Data Server Driver for JDBC and SQLJ ..............55
Distinct types in JDBC applications ..........................56
Savepoints in JDBC applications ...........................57
Retrieving automatically generated keys in JDBC applications .................58
Providing extended client information to the data source with IBM driver-only methods ........61
Providing extended client information to the data source with client info properties ..........62
XML data in JDBC applications.............................65
XML column updates in JDBC applications ........................65
XML data retrieval in JDBC applications.........................67
Java support for XML schema registration and removal....................71
Transaction control in JDBC applications..........................73
IBM Data Server Driver for JDBC and SQLJ isolation levels ..................73
Committing or rolling back JDBC transactions .......................74
Default JDBC autocommit modes ...........................74
Exceptions and warnings under the IBM Data Server Driver for JDBC and SQLJ ............75
Handling an SQLException under the IBM Data Server Driver for JDBC and SQLJ ..........77
Handling an SQLWarning under the IBM Data Server Driver for JDBC and SQLJ ...........81
Retrieving information from a BatchUpdateException ....................82
IBM Data Server Driver for JDBC and SQLJ client reroute support .................84
© Copyright IBM Corp. 1998, 2008 iii
||

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