magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 1997 > 10 > Java Alley  

Connecting to Database with JDBC

By Bruce Eckel

Approximately half of all software development involves client/server operations. A great promise of Java has been the ability to build platform-independent client/server database applications. Java DataBase Connectivity (JDBC) in Java 1.1 makes it possible to build client/server database applications that are platform independent. Although there is a "standard" database language, Structured Query Language (SQL-92), features wars have often made it necessary to write vendor-specific code. Because JDBC is designed to be platform independent, you needn't worry about which database you're using while programming; it is, however, possible to make vendor-specific calls.

Like many Java APIs, JDBC is designed for simplicity. Method calls correspond to logical database operations: connecting to the database, creating a statement and executing the query, and viewing the result set.

Opening a Database

To allow platform independence, JDBC provides a driver manager that dynamically maintains all the driver objects that database queries need. For example, connecting to three different kinds of vendor databases requires three different driver objects. The driver objects register themselves with the driver manager at load time, and you can force loading using Class.forName().

To open a database, you must specify the following information:

  1. That you're using JDBC.
  2. The "subprotocol," the name of either the driver or a database-connectivity mechanism.



  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2