Building and Running the Project

   

The Pesticide project is available on the enclosed CD-ROM. Copy the project directory from the CD-ROM to your hard disk. Under Windows, start the server by double-clicking pesticide.bat . Next, open a browser and type one of following URLs (see Figure 8.4):

http://localhost:8080/ buglist /cool

http://localhost:8080/buglist/fast

http://localhost:8080/buglist/fr

Figure 8.4. Navigate the list of bugs .

graphics/08fig04.gif

Warning

This project uses Xalan 1.0 as the XSLT processor. If you are using another processor, you will need to adapt XslServletLiaisonImpl .

The project also uses Jetty as the Web server. However, because it is based on servlets, it should be easy to adapt to another Web server. You can add servlet support to most Web servers through JRun.


The project on the CD-ROM includes a database, but if you need to re-create it, you can use Listing 8.9. Use HypersonicSQL Database Manager to execute the script. To connect to the database, perform the following (see Figure 8.5):

  • Select HypersonicSQL Standalone.

  • The URL is jdbc:HypersonicSQL:db/pesticide .

Figure 8.5. Use the Database Manager to connect to the database.

graphics/08fig05.gif

Listing 8.9 Creating the Initial Database
 CREATE TABLE software (id INTEGER IDENTITY,name VARCHAR); CREATE TABLE programmer (id INTEGER IDENTITY,name VARCHAR); CREATE TABLE bug (id INTEGER IDENTITY,name VARCHAR,created DATE, description LONGVARCHAR, graphics/ccc.gif solution LONGVARCHAR,solved BIT, softwareid INTEGER,programmerid INTEGER); INSERT INTO software (name) VALUES ('XML Editor 1.0 [Win]'); INSERT INTO software (name) VALUES ('XML Editor 1.0 [Mac]'); INSERT INTO software (name) VALUES ('XSL Editor 1.0 [Win]'); INSERT INTO programmer (name) VALUES ('John Doe'); INSERT INTO programmer (name) VALUES ('Jack Smith'); INSERT INTO bug (name,created,description,solved,softwareid, programmerid) SELECT 'User graphics/ccc.gif login', '2000-05-10', 'Creating a new user throws an exception "Access Denied"', FALSE, graphics/ccc.gif software.id, programmer.id FROM software, programmer WHERE software.name='XML Editor 1.0 graphics/ccc.gif [Win]'AND programmer.name='John Doe'; INSERT INTO bug (name,created,description,solved,solution, softwareid,programmerid) graphics/ccc.gif SELECT 'Window size lost', '2000-05-10', 'Does not properly save the window size and graphics/ccc.gif placement between sessions', TRUE,'Added new registry key', software.id, programmer.id graphics/ccc.gif FROM software, programmer WHERE software.name='XML Editor 1.0 [Win]'AND graphics/ccc.gif programmer.name='John Doe'; INSERT INTO bug (name,created,description,solved,softwareid, programmerid) SELECT 'Crash graphics/ccc.gif at startup', '2000-05-11', 'Random crash at startup when low-memory', FALSE, software.id, graphics/ccc.gif programmer.id FROM software, programmer WHERE software. name='XML Editor 1.0 [Win]'AND graphics/ccc.gif programmer.name='John Doe'; INSERT INTO bug (name,created,description,solved,solution, softwareid,programmerid) graphics/ccc.gif SELECT 'Splash screen', '2000-05-07', 'Splash screen does not go away until the user graphics/ccc.gif clicks it', TRUE, 'Added timer', software.id, programmer.id FROM software, programmer graphics/ccc.gif WHERE software.name='XML Editor 1.0 [Mac]'AND programmer.name='Jack Smith'; INSERT INTO bug (name,created,description,solved,softwareid, programmerid) SELECT 'Import graphics/ccc.gif error', '2000-05-10', 'Cannot open legacy XSL files', FALSE, software.id, programmer.id graphics/ccc.gif FROM software, programmer WHERE software.name='XSL Editor 1.0 [Win]'AND graphics/ccc.gif programmer.name='Jack Smith'; INSERT INTO bug (name,created,description,solved,solution, softwareid,programmerid) graphics/ccc.gif SELECT 'Mangled display', '2000-05-13', 'For large style sheets, the display is not graphics/ccc.gif readable', TRUE, 'Added zoom', software.id, programmer.id FROM software, programmer WHERE graphics/ccc.gif software.name='XSL Editor 1.0 [Win]'AND programmer.name='Jack Smith'; 

Warning

The project uses Hypersonic SQL for the database. Because Hypersonic SQL is a JDBC database, it should be easy to adapt it to other JDBC databases (including Access, Oracle, and SQL Server).

However, you will need to adapt Listing 8.9 and the servlets to your database flavor of SQL. In particular, the identity column must be converted into the auto-increment columns for your database.

You might also want to take advantage of foreign keys, which Hypersonic SQL currently does not support.


   


Applied XML Solutions
Applied XML Solutions
ISBN: 0672320541
EAN: 2147483647
Year: 1999
Pages: 142

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net