Configuration of Jsp+mysql+tomcat under Windows system
Source: Internet
Author: User
Configuration of Jsp+mysql+tomcat under Windows system
1. Download jdk1.5 version from Sun website
http://192.18.97.52/ECom/EComTicketServlet/BEGIN7A4284CD66CD005A87083C005C567D8A/-2147483648/603537147/1/ 531770/531614/603537147/2ts+/westcoastfsend/jdk-1.5.0-oth-jpr/jdk-1.5.0-oth-jpr:1/jdk-1_5_0-windows-i586.exe
2. Download tomcat5.5.4 version from Tomcat official station
Http://www.apache.org/dist/jakarta/tomcat-5/v5.5.4/bin/jakarta-tomcat-5.5.4.exe
3. Download MySQL driver from MySQL Mirror
Http://mysql.ihostunit.com/Downloads/Contrib/mm.mysql-2.0.4-bin.jar
First, install the JDK before, need to configure the environment variable, in My Computer-> properties-> Advanced-> environment variable-> system variable add the following environment variables (assuming your JDK installed in E:JDK):
Then set JAVA_HOME=E:JDK
Then execute the JDK executable file, follow the prompts and keep next on OK.
You can then write a simple Java program to test whether the JDK has been installed successfully:
public class test{
public static void Main (String args[]) {
System.out.println ("This are a test program.");
}
}
Save the above program as a file with a file name of Test.java.
Then open the Command Prompt window, the CD to your Test.java directory, and then type the following command
Javac Test.java
Java Test
At this point, if you see the print this are a test program, the installation is successful, if you do not print out this sentence, you need to carefully check your configuration.
Second, the execution of Tomcat executable file is also followed by the prompts to continue next, start Tomcat. (The same as the Apache management tools)
Then enter the http://localhost:8080 in the browser
If you can see that kitten, it means Tomcat has been installed successfully. jsp files can be parsed correctly
Note If you do not display correctly, please check if your machine has 8080 ports in other places that are occupied by other applications, the solution is (1) for Tomcat to switch to a port (2) Turn off the 8080-port-consuming application
Third, install MySQL driver
Make sure that MySQL is installed on your computer before you install MySQL (recommended mysql4.0 version above)
Put the Mm.mysql-2.0.4-bin.jar in the E:jdklib.
Then set the Classpath=e:jdkmm.mysql-2.0.4-bin.jar
Then start Tomcat after restarting the computer, and save the following code to the E:tomcat 5.5webappsROOT directory (assuming your Tomcat is installed in e:tomcat5.5), the filename is testmysql.jsp.
<%@ page contenttype= "text/html;charset=gb2312"%>
<%@ page language= "java" import= "java.sql.*"%>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service