The first step in accessing the database is to set up the connection. From that connection, EGL will create a starting set of data parts and logic parts, and you will write a simple data access program to test the connection.
First, you need a new EGL project to hold the data access code.


This tutorial uses the sample Derby database that is used in the tutorial Introducing EGL (a quick-start guide). In these steps, you unzip another copy of this database to a location on your computer. You also use the Data Access Application wizard to connect to the database and create data parts and logic parts based on that database. For more information on these parts, see Introducing EGL (a quick-start guide).
It doesn't matter where you save the database, as long as you can find it again later.
shared_resources/plugins/com.ibm.etools.egl.tutorial0001.doc_version/resources/EGLDerbyR7.zip
You do not need to change the User ID or Password fields.
install_location/runtimes/base_v61/derby/lib
shared_resources/plugins/com.ibm.datatools.db2.cloudscape.driver_version/driver


You must still configure the build descriptor to use this database connection at run time.

To make sure you have the database connection working, follow these steps to run a test program and print the rows of the database to the console.

package progams;
import eglderbyr7.data.Customer;
program databaseTest type BasicProgram {}
function main()
customer Customer;
open allResults for customer;
SysLib.writeStdout("#"::" Customer name");
forEach (customer)
SysLib.writeStdout(customer.CustomerId::" "
::customer.FirstName::" "::customer.LastName);
end
end
end
Before you can run the program, you must disconnect the database tools from the database. Derby allows only one connection at a time, and the tools EGL used to create the data parts and set the values for hte build descriptor remain connected until you close the connection.

If you see an error message instead of the output in the Console view, see Troubleshooting.