JDBC

JDBC is a Java API for executing SQL statements¹. 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 " +
                 "VALUES (?,?)");

insertPerson.setString(1, "999999999");
insertPerson.setString(2, "Doug Barry");
insertPerson.executeUpdate();

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 (new window).

For an architectural example of how JDBC can be used, see using JDBC with application servers (new window).

¹ JDBC is a trademarked name and is not an acronym. JDBC, however, is often mistakenly thought to stand for "Java Database Connectivity."

Related content for: JDBC

More on the general topic: DBMS standards
SQL-92
SQLJ
SQL:1999
ADO.NET
Java Data Objects (JDO)
ODMG 3.0
Detailed comparison of ODMG 3.0 and JDO
Summary comparison of DBMS standards

Read more free articles on this site

There are nearly 400 pages of articles on this site with over 40 pages on database concepts and standards.

Search this site for more articles

Custom Search

Browse this site for more articles

Click on the topics below to browse the articles on this site.The arrows show the path to the current article: JDBC.

Web Services and Service-Oriented Architectures
Online briefings
Search results
Online articles -->
Consulting
Mentoring
Speaking
Stencils for the Savvy Manager's Guide
Links
Mail list
Privacy policy
Sitemap
Contact
Web Services articles
XML standards and vocabularies
Application server articles
Database concepts and standards -->
Object database articles
Relational database articles
Object-relational mapping articles
XML database articles
XML middleware articles
Article Sponsorship
Reprint policy
Basic concepts for using a DBMS
Database models
DBMS standards -->
Article suggestions
SQL-92
JDBC
SQLJ
SQL:1999
ADO.NET
Java Data Objects (JDO)
ODMG 3.0
Detailed comparison of ODMG 3.0 and JDO
Summary comparison of DBMS standards

Related recent articles from Google News


Hadoop Gets the SQOOP from Cloudera
InternetNews.com
Bisciglia said SQOOP will work with any database that has a JDBC (Java Database Connectivity) driver. The first thing that SQOOP does is to inspect the ...

and more »

Jitterbit 3.0 focuses on integration management
SDTimes.com
Lastly, the new version provides Java Database Connectivity support, so users can work out of any JDBC-compliant database or connect to Microsoft SQL Server ...

and more »

IT Jungle

Configuring Run SQL Scripts for Ad Hoc Queries
IT Jungle
These options are changed in the JDBC Setup window, which is displayed by clicking on Connection in the toolbar and then JDBC Setup in the drop-down, ...

and more »

SYS-CON Media (press release)

Cloud Computing Expo: Network-Centric Computing Model
SYS-CON Media (press release)
SQL is used for both data definition and data manipulation while ODBC and JDBC are used as a Call Level Interface for the C/C++ and Java programming ...

and more »

JavaOne - my personal favorite sessions
Java World
I also caught an interesting session from the guys at LinkedIn called JDBC? We Don't Need No Stinkin' JDBC: How LinkedIn Scaled with memcached, SOA, ...

and more »

More related news: JDBC - Google News

Related books at Amazon.com


Expert Oracle JDBC Programming
by R.M. Menon
Average Customer Review: 5 stars based on 5 reviews.
Customer Review: This book is about Oracle JDBC programming, not generic database neutral JDBC programming but Oracle specific. There are many JDBC books available and many Oracle and Oracle programming books but this concentrates narrowly on JDBC for Oracle, and how to get the best performance out of that combination. It is aimed at an audience that...

JDBC(TM) API Tutorial and Reference (3rd Edition) (Java Series)
by Maydene Fisher, Jon Ellis, Jonathan Bruce
Average Customer Review: 4.5 stars based on 22 reviews.
Customer Review: JDBC is one of the most mature and widely used Java APIs. Even after the arrival of more recent tools and technologies like EJB's CMP and JDO, JDBC still remains a simple, fast, and reliable way of storing objects' state in an RDBMS. While conceptually this technology is quite straightforward, its evolution has made it more complex ...

Professional Java Server Programming J2EE Edition
by Subrahmanyam Allamaraju, Andrew Longshaw, Daniel O'Connor, Gordon Van Huizen, Jason Diamond, John Griffin, Mac Holden, Marcus Daley, Mark Wilcox, Richard Browett
Average Customer Review: 4 stars based on 30 reviews.
Customer Review: This book is one the most comprehensive ones that I've bought. It provides you with most of the possible technologies that you could use in a basic J2EE application. I love the section on the J2EE architecture. For newbies I typcially request that they read that section first. It does justice to basic topics like JDBC & Servlets & t...

CodeNotes for J2EE: EJB, JDBC, JSP and Servlets
by Gregory Brill
Average Customer Review: 4.5 stars based on 6 reviews.
Customer Review: I like this book very much because it gets right to the point. Sometimes when reading through massive programming books, I find myself wondering how relevant the current topic is. Is this really something that is widely used in the real world, or is this fluff? Every page of this book contains just the important stuff with no filler....

Database Programming with JDBC and Java
by George Reese
Average Customer Review: 3 stars based on 40 reviews.
Customer Review: The text covers JDBC with enough depth, without burdening the reader with useless details available in any reference (in fact the reference is attached in an appendix, so there is no need to go looking online). Unlike other books it doesn't bore the reader with introduction to obvious concepts and examples. I highly recommend this f...

More related books: Search Amazon.com for JDBC

 

Copyright © 2000-2009 Barry & Associates, Inc. All Rights Reserved.
You can use this material for your work or classes. Click here for our reprint policy.
www.service-architecture.com

 

 

Newletter Sign Up

 

 

Barry & Associates, Inc.