Chapter 1 Introduction


What is JDBC?

JDBC (Java Database Connectivity) from the Java Software Division of Sun MicroSystems, Inc. is a specification for an application program interface (API) that allows Java applications to access multiple database management systems using Structured Query Language (SQL). The JDBC driver manager handles multiple drivers that connect to different databases.

A set of interfaces is included in the standard JDBC API so you can open connections to databases, execute SQL commands, and process results. The interfaces are described in Table 1-1.

Table 1-1: JDBC interfaces
Interface Description
java.sql.Driver Locates the driver for a database URL
java.sql.Connection Connection to a specific database
java.sql.Statement Executes SQL statements
java.sql.PreparedStatement Handles parameterized SQL statements
java.sql.CallableStatement Handles database stored procedure calls
java.sql.ResultSet Gets the results of SQL statements
java.sql.DatabaseMetaData Used to access a variety of information about a connection's DBMS and database
java.sql.ResultSetMetaData Used to access a variety of information describing a ResultSet's attributes

Each relational database management system requires a driver to implement these interfaces. All JDBC calls are sent to the JDBC driver manager, which passes the call to the specified driver.

There are four types of JDBC drivers:

 


Copyright © 2001 Sybase, Inc. All rights reserved.