Chapter 20: Database Programming


OVERVIEW

When information is organized as rows and columns of a table, we have a database, at least a database in its simplest form. For reasons we will state shortly, a single table does not suffice for most applications and one must resort to multiple tables, each designed to represent optimally some aspect of the information. Large databases employ highly optimized representations for the tabulated information. These representations are often proprietary and hidden from the user of a database. What's provided to a user is a database driver that knows how to communicate with the tabulated information through the proprietary representations.

In this chapter, we will first briefly explain further the notion of a database and SQL, the Structured Query Language, that is now in widespread use for communicating with databases. This will be followed by an introduction to JDBC and how it can be used for creating a database and then retrieving information from it. JDBC, which although a trademarked name in its own right, is often thought of as an acronym for Java DataBase Connectivity, consists of Java's classes that can be used for directly invoking SQL statements on a database, retrieving the results when the statements call for retrieval, and analyzing the results. In order to be accessible via JDBC, a database must support what's known as a JDBC driver, or a bridge between JDBC and the driver native to the database.

Finally, we will show some C++ classes from Mysql++ for the same kind of database programming that is achieved with JDBC in Java.




Programming With Objects[c] A Comparative Presentation of Object-Oriented Programming With C++ and Java
Programming with Objects: A Comparative Presentation of Object Oriented Programming with C++ and Java
ISBN: 0471268526
EAN: 2147483647
Year: 2005
Pages: 273
Authors: Avinash Kak

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