|
Training Index
Selecting
by Magelang Institute
[Table of Contents]
Prerequisites
Skeleton Code
This exercise results in an application that displays a cumulative grade
graph for the students at MageLang University. The database contains a
single table that contains the names, classes, and
grades of all the students. You will need to convert the "A"-"B"-"C" style
grades to the numerical equivalence before averaging the grades for the report's graph.
To create the bar chart of the students' average gradess, use the NetCharts
package from NetFactory.

www.netcharts.com
After the initial setup, the next several tasks should be familiar.
These tasks will not be listed in full later.
Perform the following tasks:
Unzip NetCharts into your current directory.
Copy the odbc.datasource file from the previous exercise.
Import the JDBC package.
Load the sun.jdbc.odbc.JdbcOdbcDriver class.
Create a Connection to the DriverManager.
Create a Statement to perform the query.
Execute a query to select everything from the students table and get the results.
Find out in which columns the name, class, and grade
fields are located.
Gather results.
Generate a bar chart from the results. A helper routine, showChartData, is
provided, which requires two comma-delimited strings. The first, names,
is a list of names, while the other, averages, is a list of their averages.
You need to keep each individual's entries at the same position in each list.
Note: The names and averages variables in the skeleton are
StringBuffer variables, not String for performance reasons.
StringBuffer.append is much quicker than using the "+" with
Strings.
Close the statement.
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 © 1996 Magelang Institute. All Rights Reserved.
|