Download Tomcat
Run using Maven: clean install
or clean package
to generate a .war file.
Place the BoardNew-1.0.war file in the apache-tomcat-8.0.28\webapps directory
Start the Tomcat server: apache-tomcat-8.0.28\bin\startup.bat
In the directory apache-tomcat-8.0.28\webapps, directory named "board" will be automatically created.
Copy the configuration files Ads.hbm.xml, Users.hbm.xml, and hibernate.cfg.xml to apache-tomcat-8.0.28\webapps\BoardNew-1.0\WEB-INF\classes.
Open MySQL and start the mysqld.exe server. Open the cmd console, where you will run mysql and enter the following 4 commands sequentially:
create database bulletin_board;
use bulletin_board;
create table users (
user varchar(20) not null primary key,
password varchar(40) not null
) engine=InnoDB;
create table ads (
id int not null primary key auto_increment,
adName varchar(40) not null,
headline varchar(30) not null,
rubric varchar(10) not null,
adText varchar(400) not null,
adTime bigint not null
) engine=InnoDB;
In the configuration file apache-tomcat-8.0.28\webapps\BoardNew-1.0\WEB-INF\classes\hibernate.cfg.xml, find the following lines:
<property name="connection.url">jdbc:mysql://127.0.0.1:3306/bulletin_board?autoReconnect=true&useUnicode=true&createDatabaseIfNotExist=true&characterEncoding=utf-8</property>
<property name="connection.user">admin</property>
<property name="connection.password">password</property>
Change the port 3306 to the port of your MySQL server, admin (between the tags) to your username, and password (between the tags) to your password.
Open the ready site in your browser: http://localhost:8080/BoardNew-1.0/