Development environment: WINDOWS2008R2 64-bit +myeclipse10+jdk1.7.0_67+mysql5.5
Software Installation: Myeclipse-10.0-offline-installer-windows.exe,jdk-7u67-windows-x64.exe,mysql-5.5.28-winx64.msi,mysql-connector-net-6 .3.7.msi,navicat_for_mysql_11.0.10.exe
Problem solving: This article is primarily to address the problem of creating an Eclipse plug-in that conforms to the OSGi specification, and to give a certain degree of guidance to those who have new access to OSGi technology
SOURCE download: Click to open the link
Note: The software installation process is ignored, this article assumes that you have installed the development software, and can use the client software to connect to the MySQL database
Operation Steps:
1. Use navicat for MySQL software to connect locally installed database localhost, to create test database tests and table user
2. Open MyEclipse and create a plugin project
3. Add the Mysql-connector-java-5.1.6-bin.jar package required for MySQL database connection to the Lib directory in the project root directory
4. Double-click the MANIFEST.MF file in the project, switch to the Runtime tab after opening, and then click the "Add" button to add the Mysql-connector-java-5.1.6-bin.jar file that you just copied to the Lib directory in the project.
5. Add the database operation code Databasebundle.java file in the SRC directory, and then invoke the code of the operational database class in the Startup function in the Activator.java file
6, set MyEclipse plug-in runtime configuration data, select the plug-in project to launch and related plug-ins
7. Run the plug-in project and view the results of the operation in the console
8. Open the database and view the plug-in operation Database results
Note: Because I used stop 273 in the console (the current plug-in sequence number, after entering the SS in the console, according to the plug-in name in the results can find the current plug-in item ordinal) command and start 273 command, so the database inserted 2 records.
Myeclipse10+jdk1.7+osgi+mysql implementation of database additions and deletions