Exit Print View

Sun GlassFish Enterprise Server v3 Application Development Guide

  This Document Entire Library
Print View

Document Information

Preface

Part I Development Tasks and Tools

1.  Setting Up a Development Environment

2.  Class Loaders

3.  Using Ant with Enterprise Server

4.  Debugging Applications

Part II Developing Applications and Application Components

5.  Securing Applications

6.  Developing Web Services

7.  Using the Java Persistence API

8.  Developing Web Applications

9.  Using Enterprise JavaBeans Technology

10.  Using Container-Managed Persistence

11.  Developing Java Clients

12.  Developing Connectors

13.  Developing Lifecycle Listeners

Part III Using Services and APIs

14.  Using the JDBC API for Database Access

General Steps for Creating a JDBC Resource

Integrating the JDBC Driver

Supported Database Drivers

Making the JDBC Driver JAR Files Accessible

Automatic Detection of Installed Drivers

Creating a JDBC Connection Pool

Modifying a JDBC Connection Pool

Testing a JDBC Connection Pool

Flushing a JDBC Connection Pool

Creating a JDBC Resource

Creating Applications That Use the JDBC API

Statements

Using an Initialization Statement

Setting a Statement Timeout

Statement Caching

Statement Tracing

Connections

Disabling Pooling

Associating Connections with Threads

Custom Connection Validation

Sharing Connections

Marking Bad Connections

Handling Invalid Connections

Connection Wrapping

Wrapping Connections

Obtaining a Physical Connection From a Wrapped Connection

Using the Connection.unwrap() Method

Transactions

Using Non-Transactional Connections

Using JDBC Transaction Isolation Levels

Other Features

Allowing Non-Component Callers

Restrictions and Optimizations

Disabling Stored Procedure Creation on Sybase

15.  Using the Transaction Service

16.  Using the Java Naming and Directory Interface

17.  Using the Java Message Service

18.  Using the JavaMail API

Index

Chapter 14

Using the JDBC API for Database Access

This chapter describes how to use the Java Database Connectivity (JDBC) API for database access with the Sun GlassFish Enterprise Server. This chapter also provides high level JDBC implementation instructions for servlets and EJB components using the Enterprise Server. If the JDK version 1.6 is used, the Enterprise Server supports the JDBC 4.0 API.

The JDBC specifications are available at http://java.sun.com/products/jdbc/download.html.

A useful JDBC tutorial is located at http://java.sun.com/docs/books/tutorial/jdbc/index.html.


Note - The Enterprise Server does not support connection pooling or transactions for an application’s database access if it does not use standard Java EE DataSource objects.


This chapter discusses the following topics: