...
- Download the MySQL Connector/J JDBC driver from http://dev.mysql.com/downloads/connector/j/
- After unpacking the file you have downloaded, you will find a file called something like
mysql-connector-java-5.1.22-bin.jar
. - If you are running Tomcat 6.x or Tomcat 7.x, copy the file into
<tomcat-install>/lib.
On Tomcat 5.5, copy this file into thecommon/lib
directory of your Tomcat installation.
3. Create database
Create the TermWeb database by opening a DOS prompt and enter the following:
mysql -u root -p < createdb.sql
This creates an empty database called termweb and a user termwebuser with password termwebpwd. The user name and password can be changed as desired. The user currently needs all permissions (except GRANT) in the database.
Import the
termweb.sql
file to the database, by running the following at the DOS prompt:mysql -u termwebuser -p termwebpwd termweb < termweb.sql
The database is now set up.
4. Configure Tomcat
For Tomcat 6.x and Tomcat 7.x, edit
<tomcat-install>/conf/context.xml
.
If you are running Tomcat 5.5 you edit<tomcat-install>/conf/server.xml
.Within the
Context
tags, insert the DataSourceResource
tag:<Resource name="jdbc/TermWebDS"
auth="Container"
type="javax.sql.DataSource"
username="termwebuser"
password="termwebpassword"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/termweb?autoReconnect=true&
useUnicode=true&characterEncoding=utf8"
maxActive="20"
maxIdle="10"
validationQuery="Select 1"/>- Replace the username and password parameters with the correct values for your database.
- In the url parameter, replace the word 'termweb' with the name of the database your TermWeb data will be stored in.
Include Page Tomcat Data Source Configuration Properties Tomcat Data Source Configuration Properties
...