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

support-rkalla - Jan 23, 2007 - 03:52 PM
Post subject: [DB] How do I install and connect to Apache Derby?
Note: MyEclipse now come with Derby includes 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

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...

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

Note: Because this DB runs in memory (the way we have set it up) all state of the DB will be lost between disconnect and reconnect. If you need to persist your data to your hard drive or want to setup Derby as a normal server service, please see the Derby Documentation.
All times are GMT - 6 Hours
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits