In its present form the Derby Core plug-in contains only three jar files - derby.jar, derbytools.jar, derbynet.jar. The functionality of the core plug-in makes available these jar files, and thus the Derby database to Eclipse users. Using only this plug-in means manually adding the Derby jar files to the Java Build path in Eclipse. The plug-in is available for download (or to build) at the Apache Derby web site. Note: the core plug-in does not add these jars to an Eclipse user's classpath. They are installed in the Eclipse plug-ins directory, but are not associated with any particular project.
Another set of plug-ins which is currently available as sister plug-ins to the Derby Core plug-in is the IBM Integration plug-in for Derby. These plug-ins contain db2jcc.jar, db2jcc_license_c.jar, ui.jar and the html help files. The db2jcc.jar file contains the IBM DB2 JDBC Universal driver which acts as a client to the Derby Network server.
By installing the IBM Integration plug-ins in addition to the Derby Core plug-in the following functionality is provided:
These plug-ins are available for download as one zip file at the IBM developerWorks web site.
With the creation of the Derby Network Client, we are proposing that the Derby Core plug-in and the IBM Integration plug-in be changed into three new plug-ins. The new Derby core plug-in will contain derby.jar, derbytools.jar, derbynet.jar and derbyclient.jar. The new UI plug-in, Derby tools plug-in (this name has not been finalized and is open for discussion), will contain ui.jar and the help plug-in will contain the html help files.
Currently there are two plug-ins required to make use of the Derby tools like ij and sysinfo and to start the Derby network server from within Eclipse. The core plug-in adds the Derby jar files and the IBM Integration plug-in adds the DB2 network client jar files and the UI components to the Eclipse platform.
There are several reasons for having two plug-ins:
We believe it is best to have two plug-ins, a UI and a Core, as this follows the pattern generally adhered to for Eclipse plug-ins. The core functionality is separated from the UI functionality. A third plug-in, the help, would document the functionality associated with the UI plug-in.
Listed below are the scenarios to first build the plug-ins and second, download the plug-ins from the Apache Derby web site.
Presently there is only one plug-in hosted at Apache, the Derby core plug-in. The core plug-in can be downloaded via a web page as a zip file, from the Apache web site downloads page. The source for the existing Derby plug-in can be checked out via SVN and built using the same ant script used to build the derby jar files. The source for the new plug-in should also be able to be checked out, as well as downloaded in its binary form.
Starting with the release of the plug-in that contains the new Derby network client, we would like to propose some changes to the way the source tree holds the new ui plug-in, as well as ways to obtain the binary version of both the core and ui plug-ins. To obtain or update the 'binary' version of the plug-ins an Eclipse Update Manager site would need to exist at the Apache web site. To check out the source to build the ui plug-in will require a new branch off of the trunk directory at the Apache Derby source tree. Additional information about these options are discussed below.
The most commonly used and efficient way for Eclipse users to download plug-ins is to use the Eclipse Update Manager feature. This tool allows users to point Eclipse to a web site (common http URL) to download a plug-in and any plug-in it depends upon. For instance, if we have two plug-ins we can allow users to download only the core plug-in, or both plug-ins. If they choose to download the UI plug-in they will either have to download the core plug-in, or else Eclipse will check to see if they already have the core plug-in and allow the download to continue.
We know how to do this, all we need is to determine if we want to have an Update Site now, when it is possible the URL for Apache Derby may change in the future. If we change the URL we will have to redirect users to a new URL when it changes.
We propose creating a new directory/location off the current source tree to get all source files from subversion as an Eclipse plug-in project. Once the source files are imported into the Eclipse workspace as a plug-in project the user would be able to build the plug-in from the source. The html documentation for the help plug-in would be included in this source.
The specific details will be worked out on derby-dev@db.apache.org if the vote accepting this contribution passes.
Some examples of this style of checking out source code suitable to import as an Eclipse project are at the Apache Forrest site, Web Tools Project (Eclipse) and the DBEdit (SourceForge) plugins sites.
Some proposed structures, subject to community approval, for the source tree at Derby could be,
The first option is the way forrest has the source tree for Eclipse plug-ins and the second option is something we thought would be nice if Derby ever had a plug-in for something like the NetBeans IDE. For instance the second structure would lend itself to adding a /trunk/plugins/netbeans directory for the NetBeans IDE and would make the use of the term plugins generic. The idea is to put these options as a vote to the Derby list as well as to ask for other suggestions.
derby.jar, derbynet.jar, derbytools.jar and derbyclient.jar are added to the Eclipse project Java Build Path when the Apache Derby nature is added to the Eclipse project.
The 'ui' plugin adds the derbytools.jar to the project build/run path, this enables the Derby tools like 'ij' and 'sysinfo' to be run within the Eclipse environment. The ability to run the 'dblook' utility has not been yet been provided.
The Derby core plug-in will contain derby.jar, derbytools.jar, derbynet.jar and derbyclient.jar. The UI plug-in will contain ui.jar and the help plug-in with contain the html help files. The version of the core plug-in will be the version of the Derby release which is offered at the time of release of the plug-in, currently thought to be 10.1.0.0. The version of the UI and help plug-ins will be 1.0.0.
The information contained in the Eclipse help files associated with the plug-in and the sample program have been changed to reflect the new Derby client database connection URL.
Since the core plug-in will now have an addtional jar file contained in it, namely derbyclient.jar, the java class, DerbyEclipsePlugin.java, that creates the plugin.xml file for the existing core plug-in will need to be modified to include derbyclient.jar.
At this time the functionality between the previous versions of the plug-in and the newer versions will be identical except for any differences due to changes in behaviour of the Derby Client replacing the DB2 Universal Driver client.
Below is a list of manual testing steps which have been completed at the time of this contribution. The timing of this testing should occur whenever a new binary version of the plug-ins is made available at http://db.apache.org/derby/derby_downloads.html, or more frequently if desired, such as when a new milestone of Eclipse is released.
connect 'jdbc:derby://localhost:1527/myDB;create=true;user=me;password=mine';
connect 'jdbc:derby://localhost:1527/myDB;user=me;password=mine'; create table foo (id integer, name varchar(20)); insert into foo values (1, 'derby'); insert into foo values (2, 'derby plug-ins'); disconnect; exit;Right click the file just created and select Apache Derby >> Run SQL Script using 'ij'. Verify the script ran correctly, including connecting to the existing myDB database and inserting values into the foo table.
connect 'jdbc:derby://9.10.111.11:9999/differentDB;create=true;user=me;password=mine';Substitute the actual values entered in the Properties window in step 11 above. Verify the database, differentDB, was actually created in the directory for derby.system.home entered in step 11. For instance, either in /eclipse/mynewdir or in C:/temp, there should now be a differentDB directory.
The html files included with the help plug-in have been updated with the following changes to reflect the changes due to the addition of the derby network client being used to connect to the network server, instead of the DB2 JDBC Driver:
This document has listed a few items which need to be resolved, and others that have not yet been mentioned. These items which need action or further discussion on the derby-dev mailing list are shown below.