In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces how to integrate Mysql4.0.13 and Tomcat4.1.24 to build Jsp environment under Windows2000. It is very detailed and has certain reference value. Friends who are interested must finish it!
Specific implementation steps:
First, software preparation:
Suppose you have a hardware and software environment that can run win2000 properly.
1.J2sdk1.4.1: download from j2se/1.4.1/DOWNLOAD.html "> http://java.sun.com/j2se/1.4.1/download.html
2.Mysql4.0.13: download from http://www.mysql.com
3.Tomcat4.1.24: download from apache.org/ "> http://jakarta.apache.org/
4.mm.mysql-2.0.4-bin.jar: download from http://mysql.ihostunit.com/Downloads/Contrib/mm.mysql-2.0.4-bin.jar
Second, software installation:
1. Install J2sdk:
Follow the installation wizard to install (generally installed under C:j2sdk1.4.1, easy to operate)
two。 Install Mysql:
Follow the installation wizard to install (choose the installation directory as CRV for convenient operation; after successful installation, the path is: C:mysql)
3. Install Tomcat:
Follow the installation wizard to install (change the installation directory to C:Tomcat4. 1, during which you will be asked to enter the password of Admin (system administrator)
4. Place the Jdbc driver for Mysql:
Put the mm.mysql-2.0.4-bin.jar file under C:j2sdk1.4.0-rclib (in fact, it doesn't matter where you put it, mainly by pointing it in the system variable, but many people say it's good to put it here, so I put it here)
Third, the first configuration and testing:
Configure the above installed software environment for the first time and test its environment:
(1) configuration-environment variables:
1. Create a new system variable JAVA_HOME with a value of: C:j2sdk1.4.1 (if you do not install it according to the above path, please change it to your installation path)
two。 Create a new system variable TOMCAT_HOME with a value of: C:Tomcat4 (if you do not install it according to the above path, please change it to your installation path)
3. System variable CLASSPATH, added, its value is: C:Tomcat 4.1 commonclasseswitting Tomcat 4.1commonlib
4. System variable CLASSPATH, added, its value is: C:j2sdk1.4.0-rclibmm.mysql-2.0.4-bin
(2) Test the default service:
1. Please start the Tomcat4.1 (find Apache Tomcat4.1 to run Start Tomcat in the start-program) service:
Open the browser and enter: http://localhost:8080 check in the address bar: you can see the welcome interface of Tomcat in the browser at this time. It indicates that Tomcat is working properly (note that the default port of Tomcat is 8080, please change it if it is occupied by other programs)
two。 Start the Mysql service (the Mysql service starts with the operating system by default, and winmysqladmin.exe is minimized on the system tray):
Enter CMD, go to the C:mysqlin directory, execute mysql, enter, and output some welcome messages if normal, indicating that Mysql is working properly.
Fourth, integrated configuration:
Configure Mysql4 and Tomcat4 to work together for you:
1. Copy mm.mysql-2.0.4-bin.jar to the common/lib directory of Tomcat
two。 Test whether the connection is normal. Save the following code in the test.jsp to C:Tomcat 4.1webappsroot directory:
3. Enter http://localhost:8080/test.jsp in the address of the browser. If a blank page appears after running, it means that the integration of Mysql4 and Tomcat4 is successful.
Fifth, full-line testing:
1. Start Tomcat4.1
two。 Set up database and table
First, create a table in mysql and insert several pieces of data. The sql code is as follows:
Create database test;-- operation
Use test;-- operation
Create talbe user (id int (4) auto_increment primary key,name varchar (20));-run
INSERT INTO user (name) VALUES ('test');-- run
Ok, you have created the database test, created the table user, and inserted a record.
3. Display records in the database
Save the following code in the test2.jsp to C:Tomcat 4.1webappsROOT directory:
4. Open your browser and type http://localhost:8080/test.jsp in the address bar. If test is displayed on the page after running, it means that the database was read successfully.
VI. Supplementary notes:
1. Suppose you already have a project in the E: estoa directory (including index.jsp and other jsp files and bean, such as servlet and javabean under WEB-INFclasses)
Set up Tomcat to support your project, open the C:Tomcat4.1confserver.XML file, and add before and after "
And save it.
Description: Context (represents a web application): docBase defines the path of the application; path represents the prefix of the url of this web application, so the requested url
This property is very important for http://localhost:8080/oa navigable. If it is true, tomcat will automatically detect the / WEB-INF/lib of the application.
Changes to the / WEB-INF/classes directory, automatic loading of modified or new bean and servlet, we can see the changes that bean brings to jsp without restarting tomcat
two。 Start Tomcat4.1 and enter http://localhost:8080/oa in the browser's address. If there are no errors, such as jsp and bean, your index.jsp/index.html will be changed.
The contents of the file are executed and displayed.
These are all the contents of the article "how to integrate Mysql4.0.13 and Tomcat4.1.24 to build a Jsp environment under Windows2000". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.