1. Download MySQL for JDBC driver.
Http://dev.mysql.com/downloads/connector/j/3.1.html
MySQL connector/j is distributed as a. zip or. tar.gz archive containing
The sources and class files as well as a class-file only "binary". jar
Archive named "Mysql-connector-java-3.1.10-bin.jar".
2. Unzip the downloaded file, such as: Mysql-connector-java-3.1.10.zip
You'll need to use the appropriate GUI or command-line utility to un-archive
The distribution (for example, WinZip to the. zip archive, and "Tar" for
The. tar.gz archive).
3. mysql for JDBC driver has two kinds of installation hairstyles:
Once you have un-archived the distribution archive,
You can install the driver in one of the ways:
The first method: Copy all files and directories from the COM and org two directories to anywhere, such as copying all files and directories in the COM and org two directories to any place, such as a D:/MYSQLFORJDBC
Set classpath=.; d:/mysqlforjdbc;%classpath%
Either copy the "com" and "org" subdirectories and all of their contents
To anywhere you like, and put the directory holding the "com" and "org"
Subdirectories in your classpath, or ...
The second method: Copy the Mysql-connector-java-3.1.10-bin.jar to a place, such as: D:/program Files/apache software Foundation/tomcat 5.0/common/ Lib under
Set classpath=.;D:/ Program Files/apache software Foundation/tomcat 5.0/common/lib/mysql-connector-java-3.1.10-bin.jar;%classpath%
or copy the Mysql-connector-java-3.1.10-bin.jar directly to the%java_home%/jre/lib/ext.
%java_home% is the J2SDK installation directory, as my d:/j2sdk1.4.2_06 copy to D:/j2sdk1.4.2_06/jre/lib/ext
(Debug Java program use)
Put Mysql-connector-java-3.1.10-bin.jar in your classpath, either by adding the
Full path to it to your CLASSPATH enviornment variable, or putting it
In $JAVA _home/jre/lib/ext.
trackback:http://tb.blog.csdn.net/trackback.aspx?postid=447246
How to install the MYSQL5.0 JDBC driver