Java Reference
In-Depth Information
A PPENDIX F: S ETTING U P YOUR D ATABASE
If you are going to use the SQLWorkloadManager for the Heaton Research Spi-
der, you will need to create a proper database. Specifically, this database should have the
SPIDER_WORKLOAD and SPIDER_HOST tables. This chapter shows how to create
this database on a variety of database servers.
Data Definition Language (DDL) scripts contain the commands necessary to create the
tables needed by the spider. DDL varies greatly from database vendor to database vendor.
DDL scripts are provided in this chapter for three of the major database vendors. If you wish
to use the spider on a database not listed here, you will have to develop your own DDL script
based on the tables needed by the spider. Usually, you can just modify one of the scripts here
as a starting point.
All of the DDL and configuration files presented in this chapter are contained on the
companion download for this topic.
Setting Up MySQL
MySQL is a free database that you can obtain from the following URL:
http://www.mysql.com
To setup a database in MySQL, use the following DDL script in Listing F.1.
Listing F.1: MySQL DDL Script
SET NAMES latin1;
SET FOREIGN_KEY_CHECKS = 0;
CREATE TABLE `spider_workload` (
`workload_id` int(10) unsigned NOT NULL auto_increment,
`host` int(10) unsigned NOT NULL,
`url` varchar(2083) NOT NULL default '',
`status` varchar(1) NOT NULL default '',
`depth` int(10) unsigned NOT NULL,
`url_hash` int(11) NOT NULL,
`source_id` int(11) NOT NULL,
PRIMARY KEY (`workload_id`),
KEY `status` (`status`),
KEY `url_hash` (`url_hash`),
 
Search WWH ::




Custom Search