Reason: In the vast amount of information on the Internet, but cannot find a copy of the latest MySQL (the best combination with PHP) 4.0.13 and tomcat (a very useful JSP running platform) 4.1.24. In addition to my work, I summarized my practical experience in setting up a jsp environment (the preferred choice for SUN Enterprise applications) and referred to MySQL (the best combination with PHP) of previous versions) tomcat (a very useful JSP running platform) related configuration articles, wrote this configuration document. I hope that I can give a reference to a wide range of beginners who like JAVA just like me, so as to avoid detours. The limited level and the rush of time are welcome!
Directory:
I. Software preparation
Ii. Software Installation
Iii. Initial Configuration and Testing
Iv. Integrated Configuration
V. Full-line testing
Vi. Additional instructions
7. Thanks
8. Description
Specific steps:
I. Software preparation:
Suppose you have a hard software environment that runs win2000 normally.
1. J2sdk1.4.1: Download To http://java.sun.com/j2se/1.4.1/download.html;
2. mySQL (the best combination with PHP) 4.0.13: to (the best combination with PHP ). com "target =" _ blank "> http://www.MySQL (best combination with PHP ). download com;
3. tomcat (a very useful JSP running platform) 4.1.24: to (the most popular WEB server platform on Unix ). org/"target =" _ blank "> http://jakarta.apache (the most popular WEB server platform for Unix ). org/download;
4. mm. mySQL (the best combination with PHP)-2.0.4-bin. jar: to (the best combination with PHP) .ihostunit.com/Downloads/Contrib/mm.MySQL (the best combination with PHP)-2.0.4-bin. jar "target =" _ blank "> http: // MySQL (the best combination with PHP) .ihostunit.com/Downloads/Contrib/mm.MySQL (the best combination with PHP)-2.0.4-bin. jar download;
Ii. software installation:
1. Install J2sdk:
Follow the Installation Wizard to install the tool (usually under C: j2sdk1.4.1 for ease of operation );
2. Install MySQL (the best combination with PHP ):
Follow the Installation Wizard to install it (select the installation directory as C: For easy operation; after the installation is successful, the path is C: MySQL (the best combination with PHP ));
3. install tomcat (a good JSP running platform ):
Follow the Installation Wizard (change the installation directory to C: omcat (a good JSP running platform) 4. 1. In this case, you will need to enter the Admin password (system administrator );
4. Place the Jdbc driver for MySQL (the best combination with PHP:
Set mm. mySQL (the best combination with PHP)-2.0.4-bin. put the jar file in C: j2sdk1.4.0-rclib (in fact, it doesn't matter where it is put. It can be pointed out mainly in the system variables, but many people say it is better to put it here, so I put it here );
Iii. Initial Configuration and testing:
Configure the software environment for the first time and test the environment:
(1) configuration-environment variables:
1. Create a New System variable JAVA_HOME with the value: C: j2sdk1.4.1 (if you have not installed it in the above path, change it to your installation path );
2. create a system variable tomcat (a very useful JSP running platform) _ HOME with the value C: omcat (a very useful JSP running platform) 4 (if you do not follow the above path, change it to your installation path );
3. add the system variable CLASSPATH with the value: C: omcat (a very useful JSP running platform) 4.1 commonclasses; C: omcat (a very useful JSP running platform) 4.1 commonlib
4. Add the system variable CLASSPATH. The value is C: j2sdk1.4.0-rclibmm. MySQL (the best combination with PHP)-2.0.4-bin;
(2) Test the default service:
1. start tomcat (a very useful JSP running platform) 4.1 (find apache in the Start-program (the most popular WEB server platform on the Unix platform) tomcat (a very useful JSP running platform) 4.1 run Start tomcat (a very useful JSP running platform) Service:
Open your browser and enter http: // localhost: 8080 in the address bar. Check that the welcome page of tomcat (a useful JSP running platform) is displayed in the browser. it indicates that tomcat (a very useful JSP running platform) works normally (note that tomcat (a very useful JSP running platform) has a default port of 8080. If other programs are occupied, change );
Least on the system tray ):
Go to CMD, go to the C: MySQL (the best combination with PHP) in directory, execute MySQL (the best combination with PHP), and press Enter. If it is normal, output some welcome information, it indicates that MySQL (the best combination with PHP) works normally;
Iv. Integrated Configuration:
Configure MySQL (the best combination with PHP) 4 and tomcat (a very useful JSP running platform) 4 so that they can work together for you:
1. Copy mm. MySQL (the best combination with PHP)-2.0.4-bin. jar to the common/lib directory of tomcat (a useful JSP running platform;
2. test whether the connection is normal. Save the following code as test. jsp (preferred for SUN Enterprise applications) to the 4.1webdeskroot directory of C: omcat (a useful JSP running platform:
<% @ Page contentType = "text/html; charset = gb2312" %>
<%
Java. SQL. Connection conn;
Java. lang. String strConn;
Class. forName ("org. gjt. mm. MySQL (the best combination with PHP). Driver"). newInstance ();
Conn = java. SQL. DriverManager. getConnection ("jdbc: MySQL (the best combination with PHP): // localhost/test", "root ","");
%>
<% -- MySQL (the best combination with PHP) is connected here. 4 The test Library is provided by default. The user and password use the default root and null. -- %>
3. Enter "target =" _ blank "> http: // localhost: 8080/test. jsp (preferred for SUN Enterprise Applications) after running, a blank page appears, indicating MySQL (the best combination with PHP) 4. tomcat (a very useful JSP running platform) 4. integration successful;