Acknowledgments
Part One
1 Introduction
1.1 What the JDBC 3.0 API Includes
1.2 Conventions Used in This Book
1.2.1 Fonts to Indicate Function
1.2.2 Icons to Indicate New Material
1.2.3 Special Page Designations in the Index
1.2.4 SQLException Is Implied in Method Explanations
1.2.5 Some Method Explanations Are Combined
1.3 Contents of the Book
1.3.1 Part One
1.3.2 Part Two
1.3.3 Suggested Order for Reading Chapters
1.3.4 Where to Find Information by Topic
1.3.5 Resources on the Web
1.4 What is the JDBC API
1.4.1 What Does the JDBC API Do?
1.4.2 A Base for Other APIs
1.4.3 The JDBC API versus ODBC
1.4.4 Two-tier and Three-tier Models
1.4.5 SQL Conformance
1.4.6 Products Based on JDBC Technology
1.4.7 JDBC Product Framework
1.4.8 JDBC Driver Types
1.4.9 Obtaining JDBC Drivers
1.4.10 Java-relational DBMSs
1.4.11 Other Products
1.5 The JDBC API and the Java Platforms
1.5.1 The JDBC API and the J2SE Platform
1.5.2 The JDBC API and the J2EE Platform
1.5.3 The JDBC API and the J2ME Platform
1.6 Java Overview
1.6.1 Java Is Portable
1.6.2 Java Is Object-oriented
1.6.3 Java Makes It Easy to Write Correct Code
1.6.4 Java Includes a Library of Classes and Interfaces
1.6.5 Java Is Extensible
1.6.6 Java Is Secure
1.6.7 Java Performs Well
1.6.8 Java Scales Well
1.6.9 Java Is Multithreaded
1.7 Relational Database Overview
1.7.1 Integrity Rules
1.7.2 >SELECT Statements
1.7.3 WHERE Clauses
1.7.4 Joins
1.7.5 Common SQL Commands
1.7.6 Result Sets and Cursors
1.7.7 Transactions
1.7.8 Stored Procedures
1.7.9 Metadata
2 Basic Tutorial
2.1 Getting Started
2.2 Setting Up a Database
2.3 Establishing a Connection
2.3.1 Loading Drivers
2.3.2 Making the Connection
2.4 Setting Up Tables
2.4.1 Creating a Table
2.4.2 Creating JDBC Statements
2.4.3 Executing Statements
2.4.4 Entering Data into a Table
2.5 Getting Data From a Table
2.6 Retrieving Value from Result Sets
2.6.1 Using the Method next
2.6.2 Retrieving Column Values
2.6.3 Using the Method getString
2.7 Updating Tables
2.8 Milestone: The Basics of JDBC
2.9 Using Prepared Statements
2.9.1 When to Use a PreparedStatement
2.9.2 Creating a PreparedStatement
2.9.3 Supplying Values for PreparedStatement Parameters
2.9.4 Using a Loop to Set Values
2.9.5 Return Values for the Method executeUpdate
2.10 Using Joins
2.11 Using Transactions
2.11.1 Disabling Auto-commit Mode
2.11.2 Committing a Transaction
2.11.3 Using Transactions to Preserve Data Integrity
2.11.4 When to Roll Back a Transaction
2.12 Stored Procedures
2.12.1 SQL Statements for Creating a Stored Procedure
2.12.2 Calling a Stored Procedure Using the JDBC API
2.13 Creating Complete JDBC Applications
2.13.1 Putting Code in a Class Definition
2.13.2 Importing Classes to Make Them Visible
2.13.3 Using the main Method
2.13.4 Using try and catch Blocks
2.13.5 Retrieving Exceptions
2.13.6 Retrieving Warnings
2.14 Running the Sample Applications
2.15 Sample Code
2.15.1 Sample Code 1 and 2
2.15.2 Sample Code 3 and 4
2.15.3 Sample Code 5
2.15.4 Sample Code 6
2.16 Creating an Applet from an Application
2.16.1 Writing Applet Code
2.16.2 Running an Applet
2.16.3 Sample Code 7 and 8
2.17 Stored Procedures Using SQLJ and the JDBC API
2.17.1 Creating a Stored Procedure
2.17.2 Installing a Stored Procedure
2.17.3 Declaring a Stored Procedure in SQL
3 Advanced Tutorial
3.1 Getting Set Up to Use the JDBC 2.0 and 3.0 API
3.1.1 Setting Up to Run Code
3.1.2 Using Code Examples
3.2 Moving the Cursor in Scrollable Result Sets
3.2.1 Creating a Scrollable Result Set
3.2.2 Moving the Cursor Forward and Backward
3.2.3 Moving the Cursor to a Designated Row
3.2.4 Getting the Cursor Position
3.3 Making the Updates to Updatable Result Sets
3.3.1 Creating an Updatable Result Set
3.3.2 Updating a Result Set Programmatically
3.3.3 Inserting and Deleting Rows Programmatically
3.3.4 Sample Code 20
3.3.5 Deleting a Row Programmatically
3.3.6 Seeing Changes in Result Sets
3.3.7 Getting the Most Recent Data
3.4 Making Batch Updates
3.4.1 Using Statement Objects for Batch Updates
3.4.2 Batch Update Exceptions
3.4.3 Sample Code 21
3.5 SQL99 Data Types
3.5.1 DISTINCT Type
3.5.2 Using SQL99 Data Types
3.5.3 Blob, Clob, and Array Objects
3.5.4 Creating an SQL Structured Type
3.5.5 Creating a DISTINCT Type
3.5.6 Sample Code 22
3.5.7 Using References to Structured Types
3.5.8 Sample Code 23
3.5.9 Using SQL99 Types as Column Values
3.5.10 Sample Code 24
3.5.11 Inserting SQL99 Types into a Table
3.5.12 Sample Code 25
3.6 Using Custom Mapping
3.6.1 Implementing SQLData
3.6.2 Using a Connection's Type Map
3.6.3 Using Your Own Type Map
3.7 Using a DataSource Object
3.7.1 Using a DataSource Object to Get a Connection
3.7.2 Deploying a Basic DataSource Object
3.7.3 Deploying Other DataSource Implementations
3.7.4 Getting and Using a Pooled Connection
3.7.5 Sample Code 26
3.7.6 Deployment for Distributed Transactions
3.7.7 Using Connections for Distributed Transactions
3.7.8 Sample Code 27
3.8 JDBC 3.0 Functionality
3.8.1 Using Savepoints
3.8.2 Sample Code 28
3.8.3 Using Automatically Generated Keys
3.8.4 Sample Code 29
4 MetaData Tutorial
4.1 Using a ResultSetMetaData Object
4.1.1 Using the Method getColumnCount
4.1.2 Sample Code 9
4.1.3 Using Other ResultSetMetaData Methods
4.1.4 Getting Column Type Information
4.1.5 Sample Code 10 and 11
4.1.6 Sample Code 12
4.1.7 Getting Other Information
4.1.8 Using ResultSetMetaData Features
4.1.9 Getting Other Information
4.2 Using s DatabaseMetaData Object
4.2.1 Categories of DatabaseMetaData Methods
4.2.2 Methods That Return a String
4.2.3 Methods That Return an int
4.2.4 Methods That Return a boolean
4.2.5 Methods That Return a ResultSet Object
4.2.6 Sample Code 13
4.2.7 Getting Information about DBMS Data Types
4.2.8 Sample Code 14
4.2.9 Getting Information about Primary and Foreign Keys
4.2.10 Sample Code 15
4.2.11 Sample Code 16
4.3 Methods Added in the JDBC 2.0 Core API
4.3.1 Getting Information about ResultSet Objects
4.3.2 Getting Other Information
4.4 Methods Added in the JDBC 3.0 API
4.4.1 Getting Information about ResultSet Objects
4.5 Using a ParameterMetaDataObject
4.5.1 Sample Code
4.6 Generic Applications
4.6.1 Sample Code 17 and 18
4.6.2 Sample Code 19
5 Rowset Tutorial
5.1 Types and Uses of Rowsets
5.2 Using a Rowset
5.2.1 Creating a Rowset and Setting Properties
5.2.2 Rowsets and Event Notification
5.2.3 Obtaining a Scrollable and Updatable Rowset
5.2.4 Using a Rowset for Scrolling and Updating
5.2.5 Updating a Rowset
5.3 An EJB Example
5.3.1 A Distributed Application
5.3.2 Differences in Rowsets
5.3.3 EJB and Distributed Transactions
5.3.4 A Stateless SessionBean Object
5.3.5 Overview of an EJB Application
5.3.6 The Remote Interface
5.3.7 The Home Interface
5.3.8 The Client Class
5.3.9 The Enterprise Bean
Part Two
6 Array
6.1 Array Overview
6.1.1 Creating an Array Object
6.1.2 Getting Base Type Information
6.1.3 Materializing Array Data
6.1.4 Four Versions of the Method getArray
6.1.5 Four Versions of the Method getResultSet
6.1.6 Using Array Methods
6.1.7 Storing Array Objects
6.2 Array Interface Definition
6.3 Array Methods
7 BatchUpdateException
7.1 BatchUpdateException Overview
7.1.1 What a BatchUpdateException Object Contains
7.1.2 Retrieving BatchUpdateException Information
7.2 BatchUpdateException Class Definition
7.3 BatchUpdateException Constructors
7.4 BatchUpdateException Methods
7.4.1 Inherited Methods
7.4.2 Methods Defined in BatchUpdateException
8 Blob
8.1 Blob Overview
8.1.1 Creating a Blob Object
8.1.2 Materializing Blob Data
8.1.3 Storing a Blob Object
8.1.4 Finding Patterns within a Blob Object
8.1.5 Methods for Modifying a Blob Object
8.1.6 Locators and Updates
8.2 Blob Interface Definition
8.3 Blob Methods
9 CallableStatement
9.1 CallableStatement Overview
9.1.1 Creating a CallableStatement Object
9.1.2 Named Parameters
9.1.3 IN Parameters
9.1.4 Making Batch Updates
9.1.5 OUT Parameters
9.1.6 Numbering of Parameters
9.1.7 INOUT Parameters
9.1.8 Retrieving OUT Parameters after Results
9.1.9 Retrieving NULL Values as OUT Parameters
9.1.10 Getting Information about Parameters
9.2 CallableStatement Definition
9.3 CallableStatement Methods
9.3.1 Inherited Methods and Fields
9.3.2 Methods Defined in CallableStatement
10 Clob
10.1 Clob Overview
10.1.1 Creating a Clob Object
10.1.2 Materializing Clob Data
10.1.3 Storing a Clob Object
10.1.4 Updating a Clob Object
10.1.5 Locators and Updates
10.2 Clob Interface Definition
10.3 Clob Methods
11 Connection
11.1 Connection Overview
11.1.1 Opening a Connection
11.1.2 URLs in General Use
11.1.3 JDBC URLs
11.1.4 The odbc Subprotocol
11.1.5 Registering Subprotocols
11.1.6 Sending SQL Statements
11.1.7 Transactions
11.1.8 Transaction Isolation Levels
11.1.9 Using Savepoints
11.1.10 Freeing DBMS Resources
11.1.11 Using Type Maps
11.2 Connection Interface Definition
11.3 Connection Methods
11.4 Connection Fields
12 ConnectionEvent
12.1 ConnectionEvent Overview
12.2 ConnectionEvent Interface Definition
12.3 ConnectionEventConstructors
12.4 ConnectionEvent Methods
12.4.1 Methods Inherited from java.util.EventObject
12.4.2 Methods Defined in javax.sql.ConnectionEvent
13 ConnectionEventListener
13.1 ConnectionEventListener Overview
13.1.1 Methods for Event Notification
13.1.2 Registering a ConnectionEventListener Object
13.2 ConnectionEventListener Interface Definition
13.3 ConnectionEventListener Methods
14 ConnectionPoolDataSource
14.1 ConnectionPoolDataSource Overview
14.1.1 Connection and PooledConnection Objects
14.1.2 Reusing Statements
14.1.3 Properties for Connection and Statement Pooling
14.1.4 Closing a Pooled Statement
14.2 ConnectionPoolDataSource Interface Definition
14.3 ConnectionPoolDataSource Methods
15 DatabaseMetaData
15.1 DatabaseMetaData Overview
15.1.1 Creating a DatabaseMetaData Object
15.1.2 ResultSet Objects as Return Values
15.1.3 String Patterns as Arguments
15.1.4 Pseudo Columns
15.1.5 Features Added in the JDBC 2.0 Core API
15.1.6 Getting Advanced Type Information
15.1.7 Methods and Fields Added in the JDBC 3.0 API
15.1.8 Methods Modified in the JDBC 3.0 API
15.2 DatabaseMetaData Interface Definition
15.3 DatabaseMetaData Methods
15.4 DatabaseMetaData Fields
16 DataSource
16.1 DataSource Overview
16.1.1 Properties
16.1.2 Using JNDI
16.1.3 Creating and Registering a DataSource Object
16.1.4 Connecting to a Data Source
16.1.5 DataSource Implementations
16.1.6 Logging and Tracing
16.1.7 Advantages of Using JNDI
16.2 DataSource Interface Definitions
16.3 DataSource Methods
17 DataTruncation
17.1 DataTruncation Overview
17.1.1 Data Truncation with No Warning or Exception
17.1.2 Data Truncation on Reads
17.1.3 Data Truncation on Writes
17.1.4 What a DataTruncation Object Contains
17.1.5 Retrieving DataTruncation Information
17.2 DataTruncation Class Definition
17.3 DataTruncation Constructor
17.4 DataTruncation Methods
17.4.1 Inherited Methods
17.4.2 Methods Defined in DataTruncation
18 Date
18.1 Creating a Date Object
18.1.1 Creating a Date Object
18.1.2 Deprecated Methods
18.1.3 Retrieving a Date Object
18.1.4 Advanced Features
18.2 Date Class Definition
18.3 Date Constructors
18.4 Date Methods
19 Distinct Types
19.1 Distinct Types Overview
19.1.1 Creating a Distinct Type Object
19.1.2 Storing Distinct Objects
19.1.3 Using Distinct Data Types
19.1.4 Custom Mapping of Distinct Types
20 Driver
20.1 Driver Overview
20.1.1 Loading and Registering a Driver
20.1.2 JDBC Implementation Alternatives
20.2 Driver Interface Definition
20.3 Driver Methods
21 DriverManager
21.1 DriverManager Overview
21.1.1 Keeping Track of Available Drivers
21.1.2 Establishing a Connection
21.1.3 DriverManager Methods Are Static
21.2 DriverManager Class Definition
21.3 DriverManager Methods
22 DriverProperteryInfo
22.1 DriverProperteryInfo Overview
22.1.1 Creating a DriverPropertyInfo Object
22.1.2 Getting and Setting Fields
22.2 DriverProperteryInfo Class Definition
22.3 DriverProperteryInfo Constructor
22.4 DriverProperteryInfo Fields
23 ParameterMetaData
23.1 ParameterMetaData Overview
23.1.1 Creating a ParameterMetaData Object
23.1.2 Getting Information from a ParameterMetaData Object
23.1.3 Using Parameter Metadata Wisely
23.2 ParameterMetaData Interface Definition
23.3 ParameterMetaData Methods
23.4 ParameterMetaData Fields
24 PooledConnection
24.1 PooledConnection Overview
24.1.1 Application Code for Connection Pooling
24.1.2 How Connection Pooling Works
24.1.3 The Life Cycle of a PooledConnection Object
24.2 PooledConnection Interface Definition
24.3 PooledConnection Methods
25 PreparedStatement
25.1 PreparedStatement Overview
25.1.1 Creating PreparedStatement Objects
25.1.2 Passing IN Parameters
25.1.3 Parameter Metadata
25.1.4 Data Type Conformance on IN Parameters
25.1.5 Using setObject
25.1.6 Sending JDBC NULL as an IN Parameter
25.1.7 Sending Very Large IN Parameters
25.1.8 Using PreparedStatement Objects in Batch Updates
25.1.9 Pooling Prepared Statements
25.2 PreparedStatement Interface Definition
25.3 PreparedStatement Methods
26 Ref
26.1 Ref Overview
26.1.1 Creating an SQL Reference
26.1.2 Creating a Ref Object
26.1.3 Storing a Ref Object
26.1.4 Dereferencing a Ref Object
26.1.5 Sample Code 30
26.1.6 Modifying a Ref Object
26.2 Ref Interface Definition
26.3 Ref Methods
27 ResultSet
27.1 ResultSet Overview
27.1.1 Rows and Columns
27.1.2 Cursors
27.1.3 Cursor Movement Examples
27.1.4 Determining the Number of Rows in a Result Set
27.1.5 Retrieving Column Values
27.1.6 Which Method to Use for Retrieving Values
27.1.7 Using the Method getObject
27.1.8 Types of Result Sets
27.1.9 Concurrency Types
27.1.10 Result Set Holdability
27.1.11 Providing Performance Hints
27.1.12 Creating Different Types of Result Sets
27.1.13 Using a Prepared Statement to Create Result Sets
27.1.14 Requesting Features That Are Not Supported
27.1.15 Updating Column Values
27.1.16 Deleting a Row
27.1.17 Inserting Rows
27.1.18 Positioned Updates
27.1.19 Queries That Produce Updatable Result Sets
27.1.20 What Is Visible to Transactions
27.1.21 Visibility of Changes Made by Others
27.1.22 Visibility of a Result Set's Own Changes
27.1.23 Detecting Changes
27.1.24 Refetching a Row
27.1.25 Using Streams for Very Large Row Values
27.1.26 NULL Result Values
27.1.27 Optional or Multiple Result Sets
27.1.28 Closing a ResultSet Object
27.1.29 JDBC Compliance
27.2 ResultSet Interface Definitions
27.3 ResultSet Methods
27.4 ResultSet Fields
28 ResultSetMetaData
28.1 ResultSetMetaData Overview
28.1.1 Creating a ResultSetMetaData Object
28.1.2 Using ResultSetMetaData
28.2 ResultSetMetaData Interface Definition
28.3 ResultSetMetaData Methods
28.4 ResultSetMetaData Fields
29 RowSet
29.1 RowSet Overview
29.1.1 The Event Model for Rowsets
29.1.2 Properties for a Rowset
29.1.3 Setting Parameters for the Command String
29.1.4 Traversing a RowSet Object
29.1.5 Executing a Command
29.1.6 Using a RowSet Object's Metadata
29.2 Standard Implementations
29.2.1 Overview of the JdbcRowSet Implementation
29.2.2 Overview of the CachedRowSet Implementation
29.2.3 Uses for a CachedRowSet Object
29.2.4 Creating a CachedRowSetImpl Object
29.2.5 Populating a CachedRowSet Object
29.2.6 Accessing Data
29.2.7 Modifying Data
29.2.8 Customizing Readers and Writers
29.2.9 Other Methods
29.2.10 WebRowSet Implementation
29.2.11 FilteredRowSet Implementation
29.2.12 JoinRowSet Implementation
29.3 RowSet Interface Definitions
29.4 RowSet Methods
29.5 RowSet Fields
30 RowSetEvent
30.1 RowSetEvent Overview
30.1.1 RowSet Events
30.1.2 Creating a RowSetEvent Object
30.2 RowSetEvent Interface Definition
30.3 RowSetEvent Constructor
30.4 RowSetEvent Methods
31 RowSetInternal
31.1 RowSetInternal Overview
31.2 RowSetInternal Interface Definition
31.3 RowSetInternal Methods
32 RowSetListener
32.1 RowSetListener Overview
32.1.1 Registering and Deregistering a Listener
32.1.2 Using RowSetListener Methods
32.2 RowSetListener Interface Definition
32.3 RowSetListener Methods
33 RowSetMetaData
33.1 RowSetMetaData Overview
33.2 RowSetMetaData Interface Definition
33.3 RowSetMetaData Methods
33.4 RowSetMetaData Fields
34 RowSetReader
34.1 RowSetReader Overview
34.1.1 The Reader/Writer Framework
34.1.2 Reading Data for a Disconnected Rowset
34.2 RowSetReader Interface Definition
34.3 RowSetReaderMethods
35 RowSetWriter
35.1 RowSetWriter Overview
35.2 RowSetWriter Interface Definition
35.3 RowSetWriter Methods
36 Savepoint
36.1 Savepoint Overview
36.1.1 Creating a Savepoint Object
36.1.2 Using a Savepoint Object
36.1.3 Removing Savepoint Objects
36.1.4 Retrieving a Savepoint Object Identifier
36.2 Savepoint Interface Definition
36.3 Savepoint Methods
37 SQLData
37.1 SQLData Overview
37.1.1 Creating a Custom Mapping
37.1.2 Retrieving a Custom-mapped Object
37.1.3 Storing an Object with a Custom Mapping
37.2 SQLData Interface Definition
37.3 SQLData Methods
38 SQLException
38.1 SQLException Overview
38.1.1 What an SQLException Object Contains
38.1.2 Retrieving SQLException Information
38.1.3 What an SQLException Means
38.2 SQLException Class Definition
38.3 SQLException Constructors
38.4 SQLException Methods
39 SQLInput
39.1 SQLInput Overview
39.1.1 Creating an SQLInput Object
39.1.2 Using reader Methods
39.2 SQLInput Interface Definition
39.3 SQLInput Methods
40 SQLOutput
40.1 SQLOutput Overview
40.2 SQLOutput Interface Definition
40.3 SQLOutput Methods
41 SQLPermission
41.1 SQLPermission Overview
41.1.1 Creating an SQLPermission Object
41.2 SQLPermission Class Definition
41.3 SQLPermission Constructors
42 SQLWarning
42.1 SQLWarning Overview
42.1.1 What an SQLWarning Object Contains
42.1.2 Retrieving SQLWarning Information
42.2 SQLWarning Class Definition
42.3 SQLWarning Constructors
42.4 SQLWarning Methods
43 Statement
43.1 Statement Overview
43.1.1 Creating Statement Objects
43.1.2 Executing Statements Using Statement Objects
43.1.3 Statement Completion
43.1.4 Retrieving Automatically Generated Keys
43.1.5 Closing Statements
43.1.6 SQL Escape Syntax in Statements
43.1.7 Sending Batch Updates
43.1.8 Giving Performance Hints
43.1.9 Executing Special Kinds of Statements
43.2 Statement Interface Definition
43.3 Statement Methods
43.4 Statement Fields
44 Struct
44.1 Struct Overview
44.1.1 Custom Mapping
44.1.2 Creating an SQL Structured Type
44.1.3 Storing Instances of a Structured Type
44.1.4 Creating a Struct Object
44.1.5 Mapping SQL Inheritance
44.1.6 Ordering of Attributes
44.1.7 Storing a Struct Object
44.2 Struct Interface Definition
44.3 Struct Methods
45 Time
45.1 Time Overview
45.1.1 Creating a Time Object
45.1.2 Deprecated Methods
45.1.3 Retrieving a Time Object
45.1.4 Advanced Features
45.2 Time Class Definition
45.3 Time Constructors
45.4 Time Methods
46 Timestamp
46.1 Timestamp Overview
46.1.1 Creating a Timestamp Object
46.1.2 Retrieving a Timestamp Object
46.1.3 Advanced Features
46.2 Timestamp Class Definition
46.3 Timestamp Constructors
46.4 Timestamp Methods
47 Types
47.1 Overview of Class Types
47.1.1 Using the Constants in Class Types
47.1.2 Using the Constant OTHER
47.1.3 JDBC Types Added in the JDBC 2.0 Core API
47.1.4 JDBC Data Types Added in the JDBC 3.0 API
47.2 Types Class Definition
48 XAConnection
48.1 XAConnection Overview
48.1.1 Application Code in Distributed Transactions
48.1.2 Distributed Transaction Requirements
48.1.3 Creating an XAConnection Object
48.1.4 What an XAResource Object Does
48.1.5 How the Two-phase Commit Protocol Works
48.1.6 Using an XAResource Object to Commit
48.1.7 The XAResource Interface
48.1.8 Steps in a Distributed Transaction
48.1.9 Distributed Transactions and EJB
48.2 XAConnection Interface Definition
48.3 XAConnection Methods
49 XADataSource
49.1 XADataSource Overview
49.1.1 Obtaining an XADataSource Object
49.1.2 XADataSource Objects and Resource Managers
49.2 XADataSource Interface Definition
49.3 XADataSource Methods
50 Mapping SQL and Java Types
50.1 Mapping Overview
50.2 Mapping SQL Types to Java Types
50.3 Basic JDBC TYpes
50.3.1 CHAR , VARCHAR , and LONGVARCHAR
50.3.2 BINARY, VARBINARY, and LONGVARBINARY
50.3.3 BIT
50.3.4 TINYINT
50.3.5 SMALLINT
50.3.6 INTEGER
50.3.7 BIGINT
50.3.8 REAL
50.3.9 DOUBLE
50.3.10 FLOAT
50.3.11 DECIMAL and NUMERIC
50.3.12 DATE, TIME, and TIMESTAMP
50.4 Advanced JDBC Data Types
50.4.1 BLOB
50.4.2 CLOB
50.4.3 ARRAY
50.4.4 DISTINCT
50.4.5 STRUCT
50.4.6 REF
50.4.7 JAVA_OBJECT
50.5 JDBC Types Added in the JDBC 3.0 API
50.5.1 BOOLEAN
50.5.2 DATALINK
50.6 Examples of Mapping
50.6.1 Simple SQL Statement
50.6.2 1079
50.6.3 SQL Statement with INOUT Parameters
50.7 Custom Mapping
50.8 Dynamic Data Access
50.9 Storing Java Objects in a Database
50.10 Tables for Type Mapping
50.10.1 JDBC Types Mapped to Java Types
50.10.2 Java Types Mapped to JDBC Types
50.10.3 JDBC Types Mapped to Java Object Types
50.10.4 Java Object Types Mapped to JDBC Types
50.10.5 Conversions by setObject
50.10.6 Conversions by ResultSet getter Methods
50.10.7 JDBC Types Mapped to Database-specific SQL Types
Appendix A: For Driver Writers
A.1 Requirements for All Drivers
A.1.1 Guidelines
A.1.2 Implement Methods in the Interfaces
A.2 Requirements for JDBC 1.0 API Compliance
A.3 Requirements for JDBC 2.0 API Compliance
A.4 Requirements for JDBC 3.0 API Compliance
A.5 API That is Already Implemented
A.6 Additional Requirements
A.6.1 Implement a Static Initializer
A.6.2 Support Extensions to SQL92 Entry Level
A.6.3 Support Scalar Functions
A.6.4 Provide Locks for Positioned Updates and Deletes
A.6.5 Support Multithreading
A.6.6 Throw Exceptions for Truncated Input Parameters
A.6.7 Use Default Behaviors for SQL99 Data Types
A.7 Permitted Variants
A.7.1 When Functionality Is Not Supported
A.7.2 Variation in Fundamental Properties
A.7.3 Adding Functionality
A.8 Security Responsibilities of Drivers
A.8.1 Check Shared TCP Connections
A.8.2 Check All Local File Access
A.8.3 Assume the Worst
A.9 Use SQLException for Exceptions
A.10 Implementation Suggestions
A.10.1 Prefetch Rows
A.10.2 Provide "Finalize" Methods
A.10.3 Avoid Implementation-dependent States
A.11 Connection and Statement Pooling Implementations
A.12 JDBC Test Suite
A.13 Connectors
A.13.1 J2EE Connector Architecture
Appendix B: Summary of Changes
B.1 Overview of JDBC 3.0 API Changes
B.2 Summary of New Functionality
B.2.1 Savepoint Support
B.2.2 Connection Pooling and Reusing Prepared Statements
B.2.3 Retrieval of Parameter Metadata
B.2.4 Automatically Generated Keys
B.2.5 Ability to Have Multiple Open ResultSet Objects
B.2.6 Holdable Cursor Support
B.2.7 New Updating Capabilities
B.2.8 New Data Types
B.3 Complete List of JDBC 3.0 API Changes
B.3.1 New Interfaces
B.3.2 New Methods and Fields
B.4 Overview of JDBC 2.0 Core API Changes
B.5 Summary of New Functionality
B.5.1 Scrollable Result Sets
B.5.2 Batch Updates
B.5.3 Programmatic Updates
B.5.4 Other New Features
B.5.5 Support for Advanced Data Types
B.5.6 What Are the SQL99 Data Types?
B.5.7 Summary of Support for the SQL99 Data Types
B.5.8 Mapping of the New SQL99 Types
B.5.9 SQL Locators
B.5.10 Support for Storing Java Objects
B.6 JDBC 2.0 Core API Changes
B.6.1 What Did Not Change in the JDBC 2.0 API
B.6.2 Additions to Existing Interfaces and Classes
B.6.3 Deprecated Methods and Constructors
B.6.4 New Interfaces, Classes, and Exceptions
B.7 JDBC Optional Package Features
B.7.1 JNDI
B.7.2 Connection Pooling
B.7.3 Support for Distributed Transactions
B.7.4 Rowsets
B.8 Complete List of Optional Package API
B.9 Post JDBC 1.0 API Changes
B.9.1 Numeric to Bignum to BigDecimal
B.9.2 AutoClose Mode Dropped
B.10 Early Design Decisions
B.10.1 ResultSet getter Methods
B.10.2 PreparedStatement Methods for Setting Column Values
B.10.3 CallableStatement.registerOutParameter Method
B.10.4 Support for Large OUT Parameters
B.10.5 isNull versus wasNull
B.10.6 Java Type Names or JDBC Type Names
B.11 Where to Send Suggestions
Glossary
Index