Visual Cafe for Java EXplorer


Visual Cafe for Java EXplorer, Database Development Edition Coriolis, 1998

by William B. Brogden, Jeffrey A. Louie, and Ed Tittel


Database Applets and v2.5 of Visual Cafe.

The applets in this book are created and tested with VCFJ, DDE v2.0. Some minor modifications may be necessary to run the database applets with v2.5.

1) Open the project and click on the packages (center) tab in the project window. Right click on the applet source file and select "Edit Source." Edit the database applet source file and disable dynamic IP addressing (see page 361 in our book for the gory details). If you are running the dbANYWHERE server at the IP address the code should look like this:

myServer= new"dbaw://");

2) Click on the objects (leftmost) tab in the project window. Click on the applet object and select "Edit Applet" to open the form editor. Click on the right hand lower corner of the form editor and resize (enlarge) the applet. This will force a parse of the form and modify the source code to be compliant with the v2.5 dbANYWHERE API.

For instance, the applet will use the new Session constructor:

                java.beans.Beans.isDesignTime() ); 

and the RelationViewPlus component.

Note: You can find the changes using the compare tool.

Choose Tools|Compare Files.

3) Execute the applet.

Symantec's Enhanced JDBC API

V2.5 of VCFJ, DDE supports a new enhanced high level database API, the "JDBC" API. You can still use the dbANYWHERE API by selecting the dbANYWHERE API code generation option from the menu bar (Tools|Environment Options.|Database Tab). High level JDBC API versions of the database applets discussed in this book are available - see the bottom of this page (eg. Download the AddressJDBC project).

True N-Tiered Solution

If you are interested in trying your hand at a true n-tiered server side solution, download Sun's JavaWebServer1.1 trial and our JDBC project AddressServlet.


Cannot Find Java Files:

Question: Why can't the compiler find the database project java files?

Answer: You need to use the 32 bit version of WinZip to unzip the database project files. The 16 bit version of WinZip will truncate the java extension to .jav.

Cannot Write To Files:

Question: Why can't I open the database projects from the book CD? The IDE complains that the file is not writable.

Answer: If you simply drag the files from the CD to your hard disk, the file permissions are set to read only. This is not a problem if you use the installer. You can set the file permissions by right clicking on the file icon and selecting properties.

Password Dialog Won't Go Away:

Question: Why is it that when I execute a database project, I keep getting a recurring password dialog box? I have verified the password and user_id by opening the file with SQL Central.

Answer: This behaviour can be seen when the system has insufficient memory.


Thanks to John P. for his contributions!

Getting Connected, Missing Colon

There is a missing colon in the URLs on page 466. They should read:

String url= "jdbc:dbaw://"+
     "WATCOM/SQL Anywhere 5.0 Sample/SQL Anywhere 5.0 Sample";
String url= "jdbc:dbaw://"+
     "Sybase_SQLANY/SQL Anywhere 5.0 Sample/SQL Anywhere 5.0 Sample";  

Database Applets, Errors in Cardinality

The database applet RelationView cardinality property should be set to one-to-many for a parent/child relationship and many-to-one for a child/parent relationship. The text on page 393 incorrectly states that the relationship between the PENDING_ORDER_ITEMS table and PRODUCT table is one-to-many. It is many-to-one.

Addressbook.db Database, Missing Phone_Types Table

The Addressbook.db database on the book CD does not quite conform to the description in the book due to a missing Phone_Types table. This does not affect the function of the AddressBook applet. You can download an updated version of the database (AddressServlet) from this page.

Incomplete Figure, 18.3

Page 290, Figure 18.3 "Viewing the DBMS plan that implements ORDER BY with the index Last_First_MI_Index" is incorrect. Please refer to Figure 18.4.

Error in Figure Caption, 22.4

Page 423, Figure 22.4 "A FormattedTextField component with the character mask "333/-3333". This should read "A FormattedTextField component with the character mask "999/-9999" as discussed in the text.

Project files updated for VC 2.5 by JLouie 4.26.98

New versions of the database projects written to the high level JDBC API.

Order Entry Project about 150k

Invoice JDBC project about 50k

Feedback JDBC project about 125k

Address JDBC project about 152k

Java Servlets

Here is a sample JDBC Java Servlet (Requires JavaWebServer1.1). For debugging, this servlet works best with IE4.0.

JDBC AddressServlet about 641k

Go Top

Email the Authors:
Jeff Louie
William Brogden