Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between pages "Getting Started with DTP" and "File:DerbyExpanded.jpg"

(Difference between pages)
(Connecting to Apache Derby)
 
 
Line 1: Line 1:
=Requirements=
 
This page describes steps to get started with DTP 0.7 and the 0.9 streams. We assume that you have installed the appropriate version of the Eclipse platform, EMF and GEF as described on the [http://www.eclipse.org/datatools/downloads.html DTP download]page for your specific DTP build. We also assume that you have downloaded [http://db.apache.org/derby/ Apache Derby] version 10.x, and are generally familiar with it. We also assume that you are familiar with using Eclipse features such as preference pages, editors, views, and so on.
 
  
=Introduction=
 
While DTP is not solely about databases, we have used relational databases as our primary set of examples in DTP 0.7 and 0.9. Further, we have selected Apache Derby as our sample database. Therefore, this guide will show the basic steps required for connecting to, and working with, Apache Derby using DTP.
 
=Connecting to Apache Derby=
 
The following are the essential steps for connecting to Apache Derby using DTP.
 
==Defining a Driver Template==
 
* Once Eclipse+DTP is running, open the Preferences dialog and select ''Connectivity-->Driver Definitions'':
 
 
[[Image:DriverPrefs.jpg | left]]
 
 
Since this is the first time to create a driver definition, there will be no entries under ''Derby Embedded''. Select ''Derby Embedded'' and click on ''Add'', launching the driver definition wizard:
 
 
[[Image:DriverWiz1.jpg | left]]
 
 
Select ''Derby Embedded JDBC Driver...'' for the version of Apache Derby you have, change the name of the driver name (if you wish), and click on ''OK''. This opens the driver details dialog:
 
 
[[Image:DriverDefDetails.jpg | left]]
 
 
Clear the sample ''derby.jar'' location and point to the correct one for your Apache Derby install. An embedded Apache Derby database doesn't require a user name or password, so those properties can be left blank. You might want to alter the ''url'' to point to another location for the embedded database.
 
==Creating a Connection Profile for Apache Derby Embedded==
 
Once you have created an Apache Derby embedded driver definition, you can then use that as the basis to create a connection profile. Open the ''Perspective'' selection dialog in Eclipse, and choose the ''Database Development'' perspective. Once open, this perspective should look like the following:
 
 
[[Image:DBPerspective.jpg]]
 
 
The ''Data Source Explorer'' (DSE) is found on the lefthand side. Right click on the ''Databases'' category and select ''New''. This opens the new connection profile wizard:
 
 
[[Image:CPWizard.jpg]]
 
 
Select ''Derby Embedded Database'' and click ''Next''. After you give the connection profile a name and, optionally, a description, a dialog will open where the driver definition is to be selected:
 
 
[[Image:SelectDriverDef.jpg]]
 
 
Drop the combo box and choose the Apache Derby driver definition that you previously created, and click on ''Finish''. The connection profile has now been created.
 
==Connecting to Apache Derby==
 
With the connection profile in place, you are now ready to connect to the embedded Apache Derby instance. Expand the ''Databases'' node in the DSE, select the connection profile you created, right click, and select ''Connect''. After a few moments (the initial contents for the database instance are being created), you should be able to expand into the connection profile an examine the contents of the embedded Apache Derby database. The following shows an example expansion set:
 
 
[[Image:DerbyExpanded.jpg]]
 

Latest revision as of 12:15, 17 April 2006

Back to the top