How to install the MYSQL5.0 JDBC driver

Source: Internet
Author: User

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

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.