CSIS 626 Project: Installation Instructions

The student scheduler application requires the following tools to be installed:

  1. Java Software Development Kit (SDK)
  2. MySQL server
  3. JDBC for MySQL
  4. Apache Tomcat Server

After installation, proceed to Populating the Database for instructions on populating the database with the required data.

Then proceed to Rev 4.0 for the current final working version which contains the code and instructions for running the program.

Installing MySQL

  1. Go to http://dev.mysql.com/downloads/index.html
  2. Under MySQL database server & standard clients:
       Download MySQL 4.0 (mysql-4.0.18-win.zip)
  3. Unzip mysql-4.0.18-win.zip and run Setup.exe
  4. Install for Typical
  5. Copy C:\mysql\my-small.cnf and rename to C:\my.cnf
  6. For Windows XP: Right Click on My Computer -> Properties -> Advanced -> Environment Variables. Edit the Path to include c:\mysql\bin

Starting MySQL server

  1. At Command Prompt
       C:\mysql\bin>mysqld --console

Stopping MySQL server

  1. At Command Prompt
       C:\mysql\bin>mysqldadmin -u root shutdown

Starting MySQL command line tool

  1. At Command Prompt
       C:\mysql\bin>mysql test
       (where test is the name of the database)

Securing MySQL server
(The default privileges on Windows give all local users full privileges to all databases without specifying a password.)

  1. At Command Prompt
       C:\mysql\bin>mysql mysql
       mysql> DELETE FROM user WHERE Host='localhost' AND User='';
       mysql> FLUSH PRIVILEGES;
       mysql> GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'your_password' WITH GRANT OPTION;
       mysql> QUIT
       C:\mysql\bin>mysqladmin -u root password your_password
  2. After you've set the password, if you want to shut down the mysqld server, you can do so using this command:
       C:\mysql\bin>mysqladmin -u root --password=your_pasword shutdown

Installing JDBC for MySQL

  1. Go to http://dev.mysql.com/downloads/index.html
  2. Under MySQL Connector/J -- for connecting to MySQL from Java
       Download MySQL Connector/J 3.0 (mysql-connector-java-3.0.11-stable.zip)
  3. Create folder C:\JDBC
  4. Unzip and extract all files to C:\JDBC
  5. Copy
       C:\JDBC\mysql-connector-java-3.0.11-stable\mysql-connector-java-3.0.11-stable-bin.jar
    to
       C:\Sun\jdk\jre\lib\ext\

Testing that all this works

Don't forget to start the MySQL server!

  1. Save these files into your Java work directory;
       TestDB.java   SimpleDataSource.java   database.properties
  2. Compile for TestDB.java
  3. At Command Prompt
       C:\JavaPrograms>java TestDB database.properties
  4. The output should show one line of output "Romeo"

Installing Apache TomCat Server

  1. Go to http://jakarta.apache.org/site/binindex.cgi
  2. Scroll down and under Tomcat 5.0.19, download 5.0.19zip
  3. Unzip into C:\
  4. From Desktop, Right Click on My Computer and select Properties
  5. Click on the Advanced Tab and then click on Environment Variables
  6. If a JAVA_HOME variable does not exist create one with the value set to the Java JDK path (e.g., C:\Sun\AppServer\jdk)

Starting up Tomcat 5

  1. At Command Prompt
       C:\jakarta-tomcat-5.0.19\bin>startup
  2. After startup, the default web applications included with Tomcat 5 will be available by visiting: http://localhost:8080/

Shutting down Tomcat 5

  1. At Command Prompt
       C:\jakarta-tomcat-5.0.19\bin>shutdown

Testing our Java applications on Tomcat

  1. Ensure the web server is shut down
  2. Create folder C:\jakarta-tomcat-5.0.19\webapps\csis626
  3. Save date.jsp into that directory
  4. Create folder C:\jakarta-tomcat-5.0.19\webapps\csis626\WEB-INF
  5. Save web.xml into that directory
  6. Create folder C:\jakarta-tomcat-5.0.19\webapps\csis626\WEB-INF\classes
  7. Start Tomcat
  8. Point your browser to http://localhost:8080/csis626/date.jsp
  9. The current date and time should be displayed

IMPORTANT NOTE REGARDING PACKAGES

Tomcat 5 does not let you place beans into the default package. Instead, you need to place each bean into a named package. Follow this procedure:

  1. Make a subdirectory WEB-INF/classes/csis626 to hold source and class files.
  2. Place the declaration
    package csis626;
    as the first line of each source file
  3. Compile the files as follows:
  4. When referencing a bean in a JSP page, use the fully qualified class name, for example
       <jsp:useBean id="zone" class="csis626.TimeZoneBean" scope="session"/>
  5. To compile servlets, add .../common/lib/servlet.jar to your class path.