|Re: Eclipse Scout RC4: MySql support? [message #691589 is a reply to message #685030]
||Fri, 01 July 2011 19:38
| Lukas Huser
Registered: March 2010
To build your own fragment containing the MySql jdbc driver you can try the following:|
0. Download the current MySql jdbc driver, e.g. mysql-connector-java-5.1.16-bin.jar
If you are in the Scout perspective, switch to the Java perspective first.
1. Create a new fragment project in eclipse: File -> New -> Other... (or hit [Ctrl+N])
2. Choose Plug-in Development -> Fragment Project in the wizard, click 'next'
3. Choose a project name, e.g. com.example.myproject.server.jdbc.mysql.fragment
4. Untick checkbox 'Create a java project', keep the other settings, click 'next'
5. Fill the 'Properties' section
- Set the Version to '5.1.16' (or whatever version of MySql you are using)
- Set a name for the fragment, e.g. 'MySql jdbc connector'
- Set a Provider (or keep empty)
6. Fill the 'Host Plug-in' section
- Set Plug-in ID to org.eclipse.scout.rt.server (this is important!)
- Minimum and maximum version can be left empty
7. Finish the wizard. A new fragment project is created in your workspace (it should contain a folder META-INF with the MANIFEST.MF file and also a build.properties file)
8. Create a 'lib' folder in your project: Choose New -> Folder from the context menu of the fragment project
9. Drag and drop the MySql library to the lib folder
10. Open the MANIFEST.MF file (double-click). The manifest editor should open, it has multiple tabs (at the bottom). Switch to the Runtime tab.
11. Add the MySql library to the bundle class path: There is a section called 'Classpath' on the right. Use the Add.. button and select the jar file from the lib folder. Save the changes.
12. Switch to the MANIFEST.MF tab in the manifest editor to see the manifest file in plain text. It should look similar to this:
Bundle-Name: Mysql jdbc connector
13. You're done!
You can now add the new fragment to the product dependencies:
Open the product configuration file of the server bundle (e.g. com.example.myproject.server -> products -> development, open the .product file)
Add the new fragment in the Dependencies tab. Switch to the Overview tab, click the 'Synchronize' link in the 'Testing' section, then click the link to 'Launch an eclipse application in debug mode'.
Note: this assumes that you do not rely on a custom SqlStyle for MySql, but merely adds the required dependencies to connect to the MySql database (similar to the fragments provided in previous Scout distributions).
I have not actually tested the steps above myself, but I hope it works for you
Powered by FUDForum
. Page generated in 0.18906 seconds