Install Derby

 

  1. Download  Derby 10.0 from:

 

                        http://db.apache.org/derby/releases/release-10.0.2.1.html

 

  1. Extract the downloaded file to your file system.  It is not necessary to configure the Derby server as we will be using the embedded driver which creates a database directly in the file system.

 

Connect to Derby using DTP

 

Please note that DTP currently only allows one Derby connection per Eclipse session.  The Derby embedded JDBC driver has special requirements when closing a connection that have yet to be implemented in DTP.  Therefore, it is recommended that users do not use the test connection button in the connection configuration UI as this will create the only allowed connection and the user will need to restart Eclipse in order to reconnect and view the database objects in the Data Source Explorer.

 

To configure a connection to a Derby database:

  1. In the Data Source Explorer, right-click on the Databases node and select the New… menu item.
  2. In the resulting dialog select the SQL Model-JDBC Connection profile type and click Next.
  3. Enter a connection name and click Next.
  4. Click the “…” button and click the Add… button in the resulting dialog.
  5. Now select “Derby Embedded JDBC Driver for Derby 10.0” from the Available Driver Templates list and click OK. 
  6. In the “Provider Driver Details” dialog, edit the “Driver File” specified so that it points to a valid location of the derby.jar file. Click OK.
  7. Click OK again on the Available Driver Definitions dialog.
  8. In the wizard select “Derby Embedded JDBC Driver for Derby 10.0” from the combo box labeled “Select a driver from the drop-down:”.
  9. In the URL, replace “C:\DerbyDatabases\MyDB” with a valid location on your system and click Finish.

 

Note that if the final directory (in this case MyDB) does not exist then the database will be created.  If it does exist then it must be a valid Derby database.  Avoid the mistake of specifying the final directory as an empty directory because a connection failure will result. 

 

  1. Right-click on the connection in the Data Source Explorer and select the Connect menu item.  When the connection is open, expand the nodes in the tree to view the database objects.