1: Preferred you need to download the JDBC Drive (mysql-connector-java-5.1.7-bin.jar) This file
(Baidu Cloud Disk http://pan.baidu.com/s/1hs9DxS4, password c22r)
2: Once you have downloaded the above JDBC Drive, you are ready to start the operation.
First open eclipse, create a project,
My project's name is demo, right click on Project demo, then new Find Floder, then
Then paste the downloaded JDBC drive under this Lib directory, then click on the jar that you just pasted and find the build path to continue to find the add to build path,
The results appear as shown, and after the addition is complete, you can use Eclipse to connect to my SQL database.
3. Test code
Packagetest.cn; Public classTest { Public Static FinalString dbdriver = "Org.gjt.mm.mysql.Driver"; Public Static voidMain (string[] args) {Try{class.forname (dbdriver); } Catch(ClassNotFoundException e) {//TODO auto-generated Catch blockE.printstacktrace (); } } }
Operations Summary/Metabase driver for Eclipse connection to my SQL database