1. MySQLJDBC driver package: dev. mysql. comdownloadsconnectorj version: mysql-connector-java-5.1.17.zip2. After downloading
1. MySQL JDBC driver package: http://dev.mysql.com/downloads/connector/j/ version: mysql-connector-java-5.1.17.zip 2. Download
1. MySQL JDBC driver package:
Version: mysql-connector-java-5.1.17.zip
2. Download any directory decompress to/mysql-connector-java-5.1.17/mysql-connector-java-5.1.17-bin.jar;
/Mysql-connector-java-5.1.17/directory also has docs and src folder, src folder has lib directory;
3. Prerequisites: the mysql and eclipse environments have been installed. refer to the previous blog article on installing the j2ee environment and mysql In Ubuntu;
4. Open eclispe, go to the menu windows-> prefrences, go to Java-> Build Path-> user libraries, select new, name mysql, Path:/mysql-connector-java-5.1.17/mysql-connector-java-5.1.17-bin.jar;
5. Create a java project named mysqlcon, right-click it, select Build Path-> Add libraries, select user library from the list, and select the mysql installation package deployed above in the next interface;
6. for development, create a new class under the mysqlcon project, name it my, and set the package to cn, that is, the java file of cn. my:
VALUES (?,?)}
Displayed and inserted correctly!