Setting up MySQL:

coldwaterphewServers

Nov 17, 2013 (3 years and 6 months ago)

77 views

Some path names are case sensitive. Please use the similar path names wherever
appropriate.


Setting up MySQL:

Download and install MySQL


http://www.mysql.com/


While installation, at the end, install the MySQL serve
r as a service and when prompted
for the root user name and password, enter the following details.


Username: root

Password: root123


Go the MySQL prompt from start menu and create a database named ‘asedb’ using the
following command in SQL.


create datab
ase asedb;

connect asedb;


The command connect is used to connect to a different database other than the current
one.


Execute the create table and insert value SQL statements in the file “insert values.txt”



Setting up Apache Tomcat:

Download and instal
l Apache Tomcat


http://tomcat.apache.org/


Download and install JDK 1.5 latest version.

http://java.sun.com


Download the mysql driver for JDBC.

http://dev.mysql.com/downloads/connector/j/3.1.html


mysql
-
connector
-
java
-
3.1.14
-
bin.jar


Place this jar file in the following directories

c:
\
program files
\
java
\
jre1.5.0_08
\
lib
\
ext

C:
\
Program Files
\
Apache
\
Tomcat 6.0
\
webapps
\
ads
\
WEB
-
INF


set environment variables from My Computer > Properties > Advanced > Environment
Variables.

JAVA_HOME=c:
\
program files
\
java
\
jre1.5.0_08

CLASSPATH=.;c:
\
program files
\
java
\
jre1.5.0_08
\
lib
\
ext
\
mysql
-
connector
-
java
-
3.1.14
-
bin.jar;%CLASSPAT
H%


Copy the files login.html, handleLogin.jsp in the following folder

C:
\
Program Files
\
Apache
\
Tomcat 6.0
\
webapps
\
ads


Where ads is the directory of our HRMS system web application. All the jsps and htmls
go into this directory.


Place all the Java files a
nd Java class files in the following folder

C:
\
Program Files
\
Apache
\
Tomcat 6.0
\
webapps
\
ads
\
WEB
-
INF
\
classes
\
ads


Remember ads is the top package of the classes we are creating. If we don’t mention any
package, then the default folder for classes is only upt
o classes level.


You are all set to run our sample application ‘login.html’


Make sure Apache Tomcat server is initialized and running as a service and MySQL
server is also running as a service.

You can start using the command prompt or from Start menu.


Open IE and paste the following URL


http://localhost:8080/ads/login.html


You should see a login screen and entering the valid user id and password which is


User: 111 or 112 or 113 or 114

Pwd: abc


Yo
u will see the particular user’s screen