This section lists possible problems in working with the tutorial
application. If you are not getting the results that you expect, here are
some things you can try to fix the problem.
- Make sure that your EGL code has no validation or generation errors, marked
by red X icons in the code editor or by errors in the EGL Generation Results
view. If a source file is listed in the EGL Generation Results view with a
red X icon rather than a green check mark icon, it did not generate properly.
Most of the EGL code used in this tutorial is included at the end for your
reference; see Resources.
- Make sure all of your files are saved and then generate the entire project
by right-clicking the project and then clicking Generate.
- Make sure that you have followed all of the steps in Lesson 1: Set up the database connection,
including:
- Set all the build descriptor options by opening the build descriptor for
the project and selecting your database connection in the Load
DB options using Connection list. Save and generate the project
after making any changes to the build descriptor.
- Add the Derby JAR file to the Java™ build path for the project.
- Check that the database connection is correct:
- Click .
- In the Preferences window, expand EGL and click SQL
Database Connections.
- In the Connection list, select your connection,
which is usually named EGLDerbyR7, unless you have already created a connection
to the sample database (such as in the tutorial Introducing EGL (a quick-start
guide)), in which case the connection is named EGLDerbyR71.
- Make sure that the properties for that connection match the locations
of the relevant files on your computer. Your connection should look like this,
with your own locations for the derby.jar file and the EGLDerbyR7 folder (which
contains the database):
- If the properties don't match the actual locations of the files, click Edit,
correct the settings, and click Test Connection to
ensure that the connection works.
- Check that the data parts and logic parts have been created correctly:
- Make sure that you have all of the files in the eglderbyr7 package, as
in this picture:
- As an example, open the Customer.egl file in the eglderbyr7.data package
and compare the Customer Record part to the following record:
record Customer type sqlRecord {
tablenames=[["EGL.CUSTOMER"]],
keyItems=[CustomerId]
}
CustomerId CustomerId {column="EGL.CUSTOMER.CUSTOMER_ID"};
FirstName FirstName {column="EGL.CUSTOMER.FIRST_NAME",
sqlVariableLen=yes, maxLen=30, isSqlNullable=yes};
LastName LastName {column="EGL.CUSTOMER.LAST_NAME",
sqlVariableLen=yes, maxLen=30, isSqlNullable=yes};
Password Password {column="EGL.CUSTOMER.PASSWORD",
maxLen=8, isSqlNullable=yes};
Phone Phone {column="EGL.CUSTOMER.PHONE",
sqlVariableLen=yes, maxLen=14, isSqlNullable=yes};
EmailAddress EmailAddress {column="EGL.CUSTOMER.EMAIL_ADDRESS",
sqlVariableLen=yes, maxLen=50, isSqlNullable=yes};
Street Street {column="EGL.CUSTOMER.STREET",
sqlVariableLen=yes, maxLen=30, isSqlNullable=yes};
Apartment Apartment {column="EGL.CUSTOMER.APARTMENT",
sqlVariableLen=yes, maxLen=10, isSqlNullable=yes};
City City {column="EGL.CUSTOMER.CITY", sqlVariableLen=yes,
maxLen=30, isSqlNullable=yes};
State State {column="EGL.CUSTOMER.\"STATE\"", maxLen=2,
isSqlNullable=yes};
Postalcode Postalcode {column="EGL.CUSTOMER.POSTALCODE",
sqlVariableLen=yes, maxLen=10, isSqlNullable=yes};
Directions Directions {column="EGL.CUSTOMER.DIRECTIONS",
sqlVariableLen=yes, maxLen=255, isSqlNullable=yes};
end
If your parts aren't correct, step through the EGL Data Access Application
wizard again carefully to recreate them and overwrite the incorrect ones.
For example, if the tableNames property on your
Record parts and the column property on the fields
within those Record parts do not include the EGL. prefix
to each table name, you forgot to select the Qualify table names
with schema check box.