Development Environment: Windows2008R264-bit + MyEclipse10 + jdk1.7.0 _ 67 + MySql5.5 software installation: Problem Solving
Development Environment: Windows2008R2 64-bit + MyEclipse10 + jdk1.7.0 _ 67 + MySql5.5 software installation: Solution to the Failover Problem
Development Environment: Windows2008R2 64-bit + MyEclipse10 + jdk1.7.0 _ 67 + MySql5.5
Software Installation: Installation
Solution: This article mainly solves the problem that the database cannot be connected when an Eclipse plug-in compliant with OSGI specifications is created, and provides some guidance to new users who are new to OSGI technology.
Download source code: Click the open link
Note: The software installation process is ignored. This document assumes that you have installed the development software and can use the client software to connect to the mysql database.
Procedure:
1. Use the Navicat for MySQL software to connect to the locally installed database localhost and create the database test and table user for testing.
2. Open MyEclipse and create a plug-in Project
3. Add the mysql-connector-java-5.1.6-bin.jar package required for Mysql database connection to the lib directory of the Project root directory
4. Double-click the MANIFEST. MF file in the project, open it, switch to the Runtime tab, and then click the "Add" button to Add the mysql-connector-java-5.1.6-bin.jar file just copied to the lib directory of the project.
5. Add the database operation code DatabaseBundle. java file under the src directory, and then call the database operation code in the startup function in the Activator. java file.
6. Configure the MyEclipse plug-in runtime, and select the plug-in project to be started and related plug-ins.
7. Run the plug-in project and view the running result on the console.
8. Open the database and view the database operation results of the plug-in.
Note: I used stop 273 in the console (current plug-in serial number. After Entering ss in the console, you can find the serial number of the current plug-in project based on the plug-in name in the result) command and start 273 command, so two records are inserted in the database.