Build and Deployment
Building and deploying the application is very easy. We assume that you already have your system configured with a Java SDK version 1.4 or later and also that you already have Apache Ant installed. You can download the source code for the sample application from the "Download Code" section of the Wrox "Programmer to Programmer" website located at www.wrox.com. Just unzip the downloaded archive in a location of your choice.You will also need to download a recent production release of the MySQL Connector/J JDBC driver from the MySQL website located at www.mysql.com. Unzip the downloaded archive and copy the JAR file named mysql-connector-java-x.x.xx-xxxx.jar (the exact name will vary depending on the downloaded version) to the lib yesdirectory in the directory where you have unzipped the sample application.
Creating and Loading the Database Tables
We are assuming that you have created the spring database following the preceding instructions. To create the tables we need to run the sample application, copy the create-ticket-mysql.sql file from the db directory of the sample application, and download to the directory where you have MySQL installed. Now you can run the following command:Windows: bin\mysql -u spring -p spring < create-ticket-mysql.sql
Linux: ./bin/mysql -u spring -p spring < create-ticket-mysql.sql
You will be prompted for the password for the "spring" user — it was earlier set to be "t1cket". After this script completes, you can perform the same procedure for load-ticket-mysql.sql. This script file will load the necessary test data. There is also a clear-ticket-mysql.sql to delete the test data and a drop-ticket-mysql.sql script for dropping all the tables.