Student achievement management system [JSP+Servlet+MySQL]

One, environment configuration

Software Requirements

  • Eclipse IDE for Java Developers - 2020-12
  • MySQL 8.0
  • apache-tomcat-9.0.41
  • Navicat Premium 15

Software installation and various configurations

Eclipse

First install the JDK to make your computer support java compilation.
Enter the JDK download official website
Insert picture description here
. Choose the version according to your computer's number (x86 version for 32-bit, X64 version for 64-bit). After the
download is complete, double-click the downloaded file to enter the installation ( The specific process is omitted, just follow the prompts of the installation wizard to install)
Note that you need to remember the installation path of the JDK, and you need to use it in the subsequent environment variable configuration.
My installation path is to
Insert picture description here
configure the environment variable. Right-click this computer and select properties. Click Advanced System Settings, click Environment Variables , and enter the following screen. Insert picture description here
In the'System Variables', create a new JAVA_HOME, if it already exists, click Edit. The variable value is the installation path.

Insert picture description here
In the system variable PATH added in% JAVA_HOME% \ bin
Insert picture description here
in the 'system variables', create the CLASSPATH, If there is already the click Edit.
Variable value;.% JAVA_HOME% \ lib \ dt.jar;% JAVA_HOME% \ lib \tools.jar; (pay attention to the small points in the front, do not miss)
Insert picture description here
The configuration of the JDK environment variables is completed after this step is executed. In order to verify whether the JDK configuration is completed, Windows+R, enter "cmd", respectively in the command line Enter "java", "javac", and "java -version". If it is the same as the figure below, the JDK configuration is successful.

  • java command

Insert picture description here

  • javac command

Insert picture description here

  • After the java -version command
    Insert picture description here
    , you can install the
    eclipse download address.
    Insert picture description here
    Enter the page and click Download. The interface will prompt you whether to donate to eclipse. You can ignore it.
    Insert picture description here
    After a while, you can start the download and double-click the downloaded file to enter eclipse. Install, select this version to install.
    Insert picture description here
    Select the storage path, click install to complete the installation.
    Insert picture description here
    Then open eclipse to configure and
    Insert picture description here
    perform the above operations to enter the following interface, click "1" to select the download address, and check "2" all (this I have already downloaded it), and then click "next" below to
    Insert picture description here
    perform the following operations and then click "install" below to start downloading. The download process is relatively long, and the waiting process can enter the following MySQL or Tomcat installation and configuration
    Insert picture description here

database

Because my computer installed MySQL a long time ago, I am not sure about the specific installation process of MySQL. You can refer to this blog
and the Navicat installation and configuration reference blog.

Tomcat

Official website download address
Insert picture description here
Check the top two for the green version (this version needs to be configured with environment variables), and the next one is for the installation version.
I installed the green version. Here I also need to choose to install it according to the number of bits of my computer. The previous one is 32-bit and the next is 64-bit. After the
Insert picture description here
download is complete, it is a compressed package. I unzip it to the Tomcat folder on the F drive. , Remember your decompression location, you need to use it when configuring environment variables.
Open the environment variables page. The operation is the same as the operation of the JDK configuration above.
In the'System Variables', create a new TOMCAT_HOME, if it already exists, click Edit. The
variable value is decompressed path
Insert picture description here
in the 'system variables', create CATALINA_HOME, if there is already the click edit.
variable value of the extracting path
Insert picture description here
added in the pATH% CATALINA_HOME% \ bin
Insert picture description here
added% CATALINA_HOME% \ lib \ servlet- api.jar CLASSPath in the ( There is no semicolon behind)
Insert picture description here
Install the Tomcat9 service item
Windows+R in the system , enter "cmd" to enter the command line, enter "service install Tomcat9" to download the tomcat9 service item (change according to the version downloaded by yourself),
Insert picture description here
open the "Service" page, and start tomcat service. Configuration is now complete
Insert picture description here

2. Project execution

Migration project

The code connection is https://github.com/G-lory/StudentAchievementManagementSystem
Open eclipse, and proceed as follows.
Insert picture description here
Select the unzipped project, select the entire folder directly, click "finish" after the selection is complete, and
Insert picture description here
find that there is an error here because it is missing Servlet library
Insert picture description here
Right-click the project name, and the operation is as follows.
Insert picture description here
Then import the servlet library in libraries. The servlet library can be found in tomcat. The specific path is as shown
Insert picture description here
in the figure below. Note that there is a mysql-connecter-java database library in the libraries, which is brought by the code author Yes, the existence of this database will not have any impact on the generation of our web pages, but an error will be reported when connecting to our data later: java.sql.SQLException: Access denied for user'root'@'localhost' (using password: YES ) site:blog.csdn.net , this problem has bothered me for a long time, so we delete it here
Insert picture description here

Go back to the page and see that there is no error
Insert picture description here
. The operation is as follows, delete the "WebContent" folder in the directory, and change the name of the "WebRoot" folder to "WebConten"
Insert picture description here

After the operation is completed, there is no problem with the code

Configure tomcat environment

Click "Windows" and select the last item "preferences" to enter the following page.
Insert picture description here
Click "add", select the same item as your tomcat version, click "next" to
Insert picture description here
find your tomcat installation package, import it, and finally click "finish" and
Insert picture description here
click "Apply and close" to complete the configuration,
Insert picture description here
proceed as follows to start the configuration of "server",
Insert picture description here
double-click "server"
Insert picture description here
Insert picture description here
to complete the display,
Insert picture description here
then right-click to select this
Insert picture description here
item , and the operation is as follows . Configure the project on tomcat
Insert picture description here
So far, the configuration is complete

Connect to the database

Open Navicat and create a new connection. The default connection name is just fine, because the database connection name in the code is the default, and the password is set by yourself when installing MySQL. If you forget, please reset it by Baidu.╮(╯▽╰)╭Right
Insert picture description here
click just To create a connection, select "new database", name "studentmanagement" and
Insert picture description here
click "confirm", right-click on the newly created database, select "new query" and
Insert picture description here
enter the code for creating the table into it, return the code for creating the table to eclipse, and open the " WebContent----sql", open "scoreInfo.sql", copy and run the marked codes separately.
Insert picture description here
Open src–com.wenr.util–DBUtil, and change the password of the database here, that is, the password of MySQL
Insert picture description here
Then it can run successfully

Three, running results

run on eclipse

Right-click the project name, "Run As", then select "1 Run on Server" and
Insert picture description here
select "finish". The
Insert picture description here
interface is as follows, the account and password are both "001", and the login identity is "Administrator"
Insert picture description here
Insert picture description here

Run on the browser

Copy the address directly from eclipse to the browser to realize the operation on the browser. The
Insert picture description here
function can be realized as follows:
Insert picture description here

Reference

Student Score Management System 3.0 (JSP+Servlet+MySQL)
Navicat Premium 15 Permanent Activation Edition Installation Tutorial
Apache Tomcat Installation and Configuration Tutorial

Guess you like

Origin blog.csdn.net/java_creater/article/details/112298978
Recommended