Http://www.missyuan.net/html/bc/jsp/20070114/594_8.html
Classpath:
.; % Java_home % \ Lib \ DT. jar;
% Java_home % \ Lib \ tools. jar;
(.;
C: \ j2sdk1.4.2 _ 14 \ Lib \ mysql-connector-java-3.1.14-bin-g.jar;
D: \ Program Files \ Java \ mysqlforjdbc \ mysql-connector-java-3.1.14-bin.jar;
Java_home:
C: \ j2sdk1.4.2 _ 14
Path:
% Java_home % \ bin; C: \ Program Files \ mysql server 4.1 \ bin
Create a folder WEB-INF under the folder where the JSP file is located
Included
Copy mysql-connector-java-3.1.14-bin.jar
Create web. xml:
<? XML version = "1.0" encoding = "ISO-8859-1"?>
<! Doctype web-app
Public "-// Sun Microsystems, Inc. // DTD web application 2.3 // en"
Http://java.sun.com/dtd/web-app_2_3.dtd>
<Web-app>
<Display-Name> my web application </display-Name>
<Description>
A Application for test.
</Description>
</Web-app>
Create D: \ Program Files \ Java \ mysqlforjdbc
And copy the mysql-connector-java-3.1.14-bin.jar to it
In C: \ Tomcat 5.0 \ shared \ Lib
C: \ Tomcat 5.0 \ common \ Lib
Copy
Mysql-connector-java-3.1.14-bin.jar