Chapter4.Database Programming


Chapter 4. Database Programming

  • The Design of JDBC

  • The Structured Query Language

  • JDBC Installation

  • Basic JDBC Programming Concepts

  • Query Execution

  • Scrollable and Updatable Result Sets

  • Metadata

  • Row Sets

  • Transactions

  • Advanced Connection Management

  • Introduction to LDAP

In the summer of 1996, Sun released the first version of the Java Database Connectivity (JDBC) API. This API lets programmers connect to a database and then query or update it, using the Structured Query Language or SQL. (SQL, usually pronounced like "sequel," is an industry standard for relational database access.)

Java and JDBC have an essential advantage over other database programming environments: Programs developed with Java and JDBC are platform independent and vendor independent.

The same database program written in Java can run on an NT box, a Solaris server, or a database appliance powered by the Java platform. You can move your data from one database to another, for example, from Microsoft SQL Server to Oracle, or even to a tiny database embedded in a device, and the same program can still read your data. This capability is in sharp contrast to traditional database programming. Too often, developers write database applications in a proprietary database language, using a database management system that is available only from a single vendor.

JDBC has been updated several times. As part of the release of JDK 1.2 in 1998, a second version of JDBC was issued. As this book is published, JDBC 3 is the most current version, with JDBC 4 under development. JDBC 3 is included with JDK 1.4 and 5.0.

We must caution you that the JDK offers no tools for "visual" database program development. For form designers, query builders, and report generators, you need to turn to third-party tools.

In this chapter:

  • We explain some of the ideas behind JDBCthe Java Database Connectivity API.

  • We introduce you to (or refresh your memory of) SQL, the industry-standard Structured Query Language for relational databases.

  • We provide enough details and examples to let you start using JDBC for common programming situations.

  • We finish with a brief introduction to hierarchical databases, the LDAP protocol, and JNDI (the Java Naming and Directory Interface).

NOTE

Over the years, many technologies were invented to make database access more efficient and fail-safe. Standard relational databases support indexes, triggers, stored procedures, and transaction management. JDBC supports all these features, but we do not discuss them in detail in this chapter. One can fill an entire book with a discussion of advanced database programming for the Java platform, and many such books have been written. For further study, we recommend JDBC API Tutorial and Reference by Maydene Fisher, Jon Ellis, and Jonathan Bruce [Addison-Wesley 2003].




    Core JavaT 2 Volume II - Advanced Features
    Building an On Demand Computing Environment with IBM: How to Optimize Your Current Infrastructure for Today and Tomorrow (MaxFacts Guidebook series)
    ISBN: 193164411X
    EAN: 2147483647
    Year: 2003
    Pages: 156
    Authors: Jim Hoskins

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net