Creating the Forum Example

printer-friendly version of this section  Print  e-mail this section  E-Mail  add a public, group or private note  Add Note  add a bookmark about this section  Add Bookmark    

JSTL: JSP Standard Tag Library Kick Start
By Jeff Heaton

Table of Contents
Appendix C.  Installing MySQL


Now that you've installed MySQL and created a forum database, you must install the database. You do this using a script file provided at the Sams Web site. This script file, which is explained in greater detail in Chapter 7, contains all of the SQL necessary to create your forum database. The script is designed to be called against either a blank database or a database that already has a forum. If you run this script against an existing forum database, it will reset the database back to its original state.

To run this script, you must be at a command prompt. Make sure you are in a directory that contains createforum.sql. From the command prompt, issue this command:

mysql  u forumuser <createforum.sql 

Once this command executes, you will have the tables necessary to test the forum application. To ensure that you installed everything correctly, you should perform a query against the t_users table. To do this, enter MySQL with the following command:

mysql  u forumuser 

Now that you are inside MySQL, you must set the correct database:

use forum; 

At this point, you can perform a basic SQL SELECT statement, such as the following:

select * from t_users; 

If all of these commands execute properly, your screen should look like the one shown in Figure C.5.

Figure C.5. Setting up the forum database.

graphics/cfig05.jpg

You now have MySQL properly installed and the forum database ready for use. One configuration issue remains: You must install a driver so that Java can get to MySQL.


    printer-friendly version of this section  Print  e-mail this section  E-Mail  add a public, group or private note  Add Note  add a bookmark about this section  Add Bookmark    
    Top

    [0672324504/app03lev1sec3]

     
     


    JSTL. JSP Standard Tag Library Kick Start
    JSTL: JSP Standard Tag Library Kick Start
    ISBN: 0672324504
    EAN: 2147483647
    Year: 2001
    Pages: 93
    Authors: Jeff Heaton

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