1 - Construct the Database info file
The database info file contains both the information
necessary to create a connection to the database
and the SQL statements to execute in order to
retrieve the data values.
are 4 pieces of info required to make the Database
Connection which are specified by the following
Database: - This is the database connection
path and name.
eg. If you have a MySQL database called Sales
you may have,
Driver: This is the location of the JDBC Driver for your database system. In order for the graphing servlet to connect to your database
it is vital that you have the correct JDBC driver set up and configured for you system. For further information on JDBC
database drivers please click here.
User: The username which the graphing
servlet will use to connect to the database
Password: The database password for the
Series SQL Statements
For each series of data an SQL Statement should
be specified. The graph servlet will execute each
statement and take the first data item of each
record returned as the value for that data item.
For instance if you have a table which holds monthly
sales figures for 2 products X and Y then your
statements may look like,
Select Value from SalesBar where Year=2004 and
Product='X' ORDER BY Month
series2: Select Value from SalesBar where Year=2004
and Product='Y' ORDER BY Month
If 6 records are returned for each record set
this would mean that there are 6 bars for each
series of data.
For a template Database Info file please click
back to top