Technical Support
Discussion Forum
Online Training
Read About Java
Java In-Depth
Product Discounts
Membership Information JDC Resources DukeDollars

Java Cup Logo

JDC Home Page

JDC Applets
(chat, newsreader, calendar)

Log Out

Online Training
shadowSearchFAQFeedback

Course Notes Table of Contents | Exercises
JDBC Short Course Index | Online Training Index

Using MetaData
Working Applet | Help
Solution

Prerequisites

Skeleton Code

The administration at MageLang University maintains a database of information about the course activities of the university's professors. This exercise results in an application that examines the different information kept for the university's instructors through the use of the ResultSetMetaData interface.

This exercise uses the instructors table in the database.

Perform the following tasks:

  1. Copy odbc.datasource file from the previous exercise.

  2. Load the driver and connect to database.

  3. Create a Statement to perform a query.

  4. Execute the "select * from instructors" query.

  5. Get the metadata for the ResultSet.

  6. Examine the metadata to find out the number and datatype of columns, number of nullable columns, and number of numeric columns. You can discover more if you want to.

  7. Print the results.

  8. Close the statement.

  9. Close the connection.

The task numbers above are linked to the step-by-step help page. Also available is a complete solution, which meets these requirements, and Expected Behavior.


Copyright © 1997 MageLang Institute. All Rights Reserved
May-97 Copyright © 1996, 1997 Sun Microsystems Inc. All Rights Reserved