Configuration of jsp + mysql + tomcat in windows

Source: Internet
Author: User

Configuration of jsp + mysql + tomcat in windows
1. Download jdk1.5 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 tomcat 5.5.4 from tomcat Official Website
Http://www.apache.org/dist/jakarta/tomcat-5/v5.5.4/bin/jakarta-tomcat-5.5.4.exe
3. Download the mysql driver from the mysql Image
Http://mysql.ihostunit.com/Downloads/Contrib/mm.mysql-2.0.4-bin.jar
1. Before installing jdk, You need to configure the environment variables, choose my computer> Properties> advanced> environment variables> system variables to add the following environment variables (assuming your jdk is installed on e: jdk ):
Set JAVA_HOME = e: jdk
Then execute the jdk executable file and follow the prompts until next is OK.
Then, you can write a simple java program to test whether jdk has been installed successfully:
Public class Test {
Public static void main (String args []) {
System. out. println ("This is a test program .");
}
}
Save the above program as a file named Test. java.
Then open the Command Prompt window, cd to the directory where your Test. java is located, and then type the following command
Javac Test. java
Java Test
If This is a test program is printed, the installation is successful. If This is not printed, You need to carefully check your configuration.
2. Execute the tomcat executable file and start tomcat after following the prompts. (The same as apache management tools)
Enter http: // localhost: 8080 in the browser
If you can see the kitten, it indicates that tomcat has been installed successfully and the jsp file can be parsed normally.
Note: if it cannot be properly displayed, check whether port 8080 of your machine is occupied by other applications. Solution: (1) Change tomcat to a port (2) turn off the application that uses port 8080
3. Install the mysql driver
Before installing mysql, make sure that mysql is installed on your computer (mysql or later is recommended)
Put mm. mysql-2.0.4-bin.jar in e: jdklib
Then set CLASSPATH = e: jdkmm. mysql-2.0.4-bin.jar
Restart the computer and start tomcat. Save the following code to the E: Tomcat 5.5web1_root directory (assuming that your tomcat is installed in e: tomcat 5.5). The file name is testmysql. jsp.
<% @ Page contentType = "text/html; charset = GB2312" %>
<% @ Page language = "java" import = "java. SQL. *" %>

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.