This article is suitable for JSP beginners and newcomers with mysql-based JSP messages or other web programs: (i) required software: 1TOMCAT 5.0.29 (5.0.28 can also, on the official website Download) 2Mysql 4.0.23 (version 4.1 4.0 is a bit different, the official download) 3JDK: J2SDK1.4.2 (official download) 4JDBC driver: mm.mysql-2.0.4-bin.jar (this officially provided package is zip, you can go to Google Next, Contact QQ: 88526099)
(Ii) Installation and formulation: First install JDK, you can customize the installation to C: / J2SDK; install Tomcat5: Here you have to install JDK, otherwise Tomcat doesn't have a way to find JRE, the installation path can be customized, such as C: / Tomcat5 It is best not to write into Tomcat 5.0 to avoid accidents;
Environment Variable Settings: Click "My Computer" -> Advanced -> Environment Variables: (Edit) Java_Home = C: / J2SDK; Enter Java -Version in the Command Line after saving, display version information OK)
ClassPath =.;% Java_home% / bin;% java_home% / lib / dt.jar;% java_home% / lib / Tools.jar;% catalina_home% / common / lib / servlet-api.jar;% catalina_home% / Common / LIB / JSP-API.jar; c: /tomcat5/common/lib/mm.mysql-2.0.4-bin.jar; c: /j2sdk/lib/mm.mysql-2.0.4-bin.jar; C: / Tomcat5 / Common / lib; C: / J2SDK / JRE / LIB; (Point "." Cannot be lost)
Path =.;% Java_home% / bin; c: / mysql / bin
Catalina_base = c: / tomcat5;
Catalina_Home = C: / Tomcat5; Formulation: After installation, set the port and custom web file directory: Open the C: / Tomcat5 / Conf file, there is a server.xml inside, interested you can read E text, Mainly defined the path and port of the access, in fact, there is a port to choose when installing tomcat5, but if you define, it is best to choose a big point, such as 9000, what is it! IE access is 80, but if there is other web server, if you have other web servers, you can choose to deactivate the server and use 80 as the port of Tomcat5, or use the default 8080, then you To do something change when you visit your page, such as: http: // localhost: 8080; Is it going to see the Tomcat's big mountain cat page? Running :) After entering server.xml, search "port" keyword change 8080 to 80, find Put the mm.mysql-2.0.4-bin.jar downloaded below the J2SDK / LIB and Tomcat5 / Common / Lib Directory, OK. You can find a JSP file that tests the database connection, there is not much to say. Here, the configuration is over! About MySQL, if it is not very familiar with the database, or look at it, you can download a graphical interface management tool mysqlsystemtrayMonitor, which is more convenient.