Using JDBC to Create Database Objects
By James W. Cooper2003-05-24
Summary
In this article, we've discussed databases and ways of examining them and executing queries on them. We've seen that the JDBC provides a platform and a database-independent, object-oriented way to access these data, and we've looked at the major objects of JDBC: the ResultSet, ResultSetMetaData, and DatabaseMetaData. After writing a simple program using these objects, we designed higher-level resultSet and Database objects which we used to build a simple visual interface to display database information.
If you are familiar with the power of databases, you will realize that the SQL language allows you to carry out many more powerful operations than we've summarized here. For example, you could create new tables, add columns, and add, change, or delete rows, columns, or individual cells of a table. All of this becomes quite general and easy to manipulate using JDBC.
If you are using a platform-specific database driver like the JDBC-ODBC Bridge, you are restricted to writing applications, since applets cannot connect to this bridge running on another computer. Other client-server databases, like IBM's DB2, do allow you to connect to them using an applet JDBC.
Tutorial Pages:
» What is a Database?
» Getting Data out of Databases
» Kinds of Databases
» ODBC
» What Is JDBC?
» Installing and Using JDBC
» Types of JDBC Drivers
» Two-Tier and Three-Tier Models
» Writing JDBC Code to Access Databases
» Registering Your Database with ODBC
» Connecting to a Database
» Accessing the Database
» The ResultSet
» ResultSetMetaData
» DatabaseMetaData
» Getting Information on Tables
» Executing SQL Queries, Printing out ResultSets, A Simple JDBC Program
» Building Higher Level JDBC Objects
» Building a Database Object, A Visual Database Program
» Executing a Query
» The Query Result Dialog
» Example Files
» Summary
First published by IBM DeveloperWorks
