JDBC is a Java API for executing SQL statements..1 It consists of a set of classes and interfaces written in Java. Although JDBC resembles Microsoft Corporation's Open Database Connectivity (ODBC) API, JDBC provides a more natural Java interface. It does, however, build on ODBC, so people familiar with ODBC will find it easy to use JDBC. Both JDBC and ODBC are based on the X/Open SQL CLI (Call Level Interface).
Using JDBC, SQL statements can be sent to virtually any database management system (DBMS). It is used as an interface for both relational and object DBMSs.
JDBC uses the call-level approach when using the Java programming language. This is illustrated by the JDBC statements in this diagram.
An example of a JDBC statement that creates a new Person instance would be:
PreparedStatement insertPerson = con.prepareStatement(
"INSERT INTO PERSON " +
insertPerson.setString(2, "Doug Barry");
If you also wanted to manipulate this new Person instance in the host program, you would need Java code in addition to this code fragment that populates the instance in Java along with the instance in the database. Also see transparent persistence vs. JDBC call-level interface.
? JDBC is a trademarked name and is not an acronym. JDBC, however, is often mistakenly thought to stand for "Java Database Connectivity."
More on the general topic: DBMS Standards
- Java Data Objects (JDO)
- ODMG 3.0
- Detailed Comparison of ODMG 3.0 and JDO
- Summary Comparison of DBMS Standards