Using JDBC to Create Database Objects
By James W. Cooper2003-05-24
Accessing the Database
Once you have connected to the database, you can request information on the names of the tables and on the names and contents of their columns, and you can run SQL statements that either query the database or add to or modify its contents. The objects that you can use to obtain information from the database are:
| DatabaseMetaData | Information about the database as a whole: table names, table indexes, database product name and version, actions supported by database. |
| ResultSet | Information about a table or result of a query. You access the data row by row, but you can access the columns in any order. |
| ResultSetMetaData | Information about the column names and types in a ResultSet. |
While each of these objects has a large number of methods that allow you to get very detailed information about the elements of the database, there are a few major methods in each object that give you the most significant information about your data. However, if you are looking for more information than we show here, we encourage you to study the documentation for descriptions of the remaining methods.
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
