Home > Database > Mysql Tutorial > body text

Ubuntu下Eclipse部署MySQL JDBC驱动

WBOY
Release: 2016-06-07 17:05:33
Original
970 people have browsed it

1.MySQL JDBC驱动包下载地址:http://dev.mysql.com/downloads/connector/j/ 版本:mysql-connector-java-5.1.17.zip 2.下载后

1.MySQL JDBC驱动包下载地址:

   版本:mysql-connector-java-5.1.17.zip

2.下载后任意目录解压到/mysql-connector-java-5.1.17/mysql-connector-java-5.1.17-bin.jar;

    /mysql-connector-java-5.1.17/目录下还有docs和src文件夹,src文件夹里有lib目录;

3.前提:mysql和eclipse环境都安装好,,参照前面blog关于Ubuntu安装j2ee环境和mysql的文章;

4.打开eclispe,进入菜单windows->prefrences,进入Java->Build Path->user libraries,选择新建,命名为mysql,路径为:/mysql-connector-java-5.1.17/mysql-connector-java-5.1.17-bin.jar;

5.创建java project,命名为mysqlcon,右键其,选择Build Path->Add libraries,从列表中选择user library,在next界面中选择上面部署的mysql安装包即可;

6.开发,mysqlcon工程下新建class,命名为my,包为cn,即cn.my的java文件:

VALUES(?,?)}

能正确显示和插入即成功!

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!