Post new topic   This topic is locked: you cannot edit posts or make replies.
Author Message

Joined: Mar 09, 2011
Posts: 1023

Note: MyEclipse comes with Derby included as an integrated test database. There is no need to do anything to configure this sandbox version, though there are associated preferences. If you want a simple database on which to test, use this embedded version of Derby (there is a Derby Database Server Tutorial, in the workbench help). Otherwise, you may install an external version and follow this guide.

The Apache Derby is a great Java-based multi-use database (along with HSQLDB). Both of these databases can be set to run in-memory (embedded) or as a service like a more typical DBMS install. This tip will cover how to install and run Derby in-memory.

This is extremely helpful when testing an application and you need a temporary DB to run all your tests against.

Installing Apache Derby

    1) Go here for the latest stable Derby release and download the BIN ZIP file.
    2) After downloading it, unzip the file to some location (it will create a db-derby-<VERSION>-bin subdirectory)

Believe it or not, now we are done with the installation. Since the DB is going to run in-memory, just making "connect" calls via the embedded JDBC driver will actually create the DB for us, we don't need to do any more installing or initialization.

Connecting to Apache Derby
These instructions look long, but they are very straight forward and most of them you only need to do once...

  1. In MyEclipse, switch to the "MyEclipse Database Explorer" perspective:


  2. Click the "New" menu item in the DB Browser view:


  3. Fill in the fields as shown in the screenshot below
  4. In the "Driver JARs" panel, click "Add JARs..."
  5. Find your derby.jar file in the /lib directory under the derby directory we unzipped from the section above.
  6. Use the "Driver classname" drop-down box to select the org.apache.derby.jdbc.EmbeddedDriver class:


  7. Hit Finish

Now you can select the Derby connection and hit the "Open Connection" button to connect to your Derby DB.

Note:Any created database will be created as a folder with the same name in the fMyEclipse installation folder. To setup Derby as a normal server service, please see the Derby Documentation.
 View user's profile Send private message  
Reply with quote Back to top
All times are GMT - 6 Hours
Post new topic   This topic is locked: you cannot edit posts or make replies.
® 2014 - Genuitec, LLC.