Landlord is a novice, followed by a textbook to write a small chat software with the database, and finally finished, in the use of Eclipse to build the jar, but always connect not MySQL, online Baidu visit the forum found that the eclipse's own export can not be packaged with third-party jar, So I began to toss ....
===========================================================
1. Download Fatjar Widget
This is a very convenient package of small plug-ins, specific download installation, please Baidu, in addition to the 4.4 version of Eclipse, the other version of Eclipse can go to the official website of the link to download, thank you for the three brother of the 4.4 version of the Fatjar
Official Portal:
sourceforge.net/projects/fjep/files/
4.4 Version Portal:
http://www.oschina.net/code/snippet_570396_36930
2. Add a MySQL jar
After installing the Fatjar, you need to add the third-party jar that you want to add, note, not in Eclipse can run, even if added, the landlord before the same thought, the results of a toss of the afternoon also did not result (the principle of what, I do not know), methods such as (Steal a picture, Don't blame It): Right click on the item you want to process = "Build Path =" ADD external archive, and then find your database connection jar, open it.
3. Packaging with the Fatjar plugin
Specific methods and Baidu experience are the same, choose a name, Next,next ... But in the filelist step finally appeared mysql-connector!!!!!!!
4. Run the jar
Finally, we can connect the database normally.!!!!!
==============================================================
Purely individual self-study opinion, the opinion is wrong, do not blame, want to quote, casual ~ ~ can solve the problem just fine!
Eclipse Packaging uses the MySQL database of the Jar,jar cannot connect to the database on the workaround