[DB] How do I install and connect to Apache Derby?

  1. MyEclipse IDE > FAQ – Development
Viewing 1 post (of 1 total)
  • Author
  • #347760 Reply


    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.

    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 Embedded 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 MyEclipse installation folder (for the example above, this would be “derbyDB”). To setup Derby as a normal server service, please see the Derby Documentation.

    • This topic was modified 6 years, 5 months ago by support-tony.
Viewing 1 post (of 1 total)
Reply To: [DB] How do I install and connect to Apache Derby?

This topic is marked as closed to new replies, however your posting capabilities still allow you to do so.

You must be logged in to post in the forum log in