MokaByte Numero 05 - Febbraio 1997
 

 
TEST: DBAnyWhere
 
di
Rick Loeck
seconda parte

 

Well, here we are starting a new year with some great RAD tools for Java in our hands. This is a double edge sword. Rapid Application Development tools mean we can all create software applications very quickly. The other edge of the sword is that we can deliver very bad applications very quickly too. This can be avoided by employing good engineering practices, such as requirements analysis and create complete specifications before you begin to code. To cover this entire subject even in a nutshell is beyond the scope of this article.

Visual Cafe Pro is available over the Internet from Symantec, http://www.symantec.com. The copy I have came on CD. There is a reason for this, it has several products on it: Netscape's Fastrack Server and Navigator Gold, SQL Anywhere, Visual Cafe Pro and dbANYWHERE workgroup server. Symantec has delivered the complete Java I*net (Internet/Intranet) development environment. Visual Cafe Pro is positioned as an enterprise development tool.

Visual Cafe Pro is a Rapid Application Development tool for Java. dbANYWHERE workgroup server is a middleware product. It is designed to run on a web server giving remote clients access to databases. The Netscape Fastrack server is a web server and Netscape Navigator Gold is a web browser and is an HTML editor. SQL Anywhere is a database engine. System requirements IBM PC or 100% compatible Windows 95 or Windows NT (Windows NT recommended) , 80486 processor minimum 16 MB RAM (32 MB RAM recommended) 60 MB hard disk space CD-ROM drive VGA video (SVGA recommended)

The installation is fairly straight forward. You run the installation program and it prompts you with a list of items you can install, Visual Cafe Pro (VCP), dbANYWHERE, Sybase SQL Anywhere and the Netscape products. Select the item you want to install and follow the instructions. The installation is very well done. Minimum installation would be Visual Café Pro and dbANYWHERE, that is if you have a browser, database engine and web server already installed.

Install VCP by clicking on it in the list of items you can install. Follow the prompts and it virtually installs itself. Near the end of installing VCP you are prompted to install Adobe Acrobat Reader 3.0. This is done because there is an online document that is in a .pdf file. Repeat this process for dbANYWHERE and if you need them, Sybase's SQL Anywhere and the Netscape products.

Visual Café and Visual Café Pro are both RAD tools. These provide the following features. Form-centric development environment Configurable Tool Palette containing your favorite form components Interaction Wizard allows you to visually specify actions based on component object and menu events Form and property sheet modifications generate real-time source code, with care you can edit this code Create custom templates for applications and objects and add it to the template palette Debugging windows have been enhanced: Variables window incorporates a tree view to collapse and expand the various scopes Watch window allows you to view and modify the values of your variables Watch window supports evaluation of expression statements including function calls Modify the value of a variable and continue debugging without reloading Set conditional breakpoints based on an expression

Once you have the components installed you are ready to start creating code. The printed documentation is rather thin. There is, as I mentioned earlier, a VCP Tutorial. It walks you through some of the basic operations. I found their information on the Internet to be very useful, it is complete with screen shots. The URL is: http://www.symantec.com/vcafeprowin/index_product.html. There is an abundance of on line help. Press F1 where ever you are and you get help about what you are currently trying to do. Putting VCP to work:

Get this all up and running you need to start the dbANYWHERE workgroup server. This is accomplished from the start button, selecting Programs -> Symantec dbANYWHERE Workgroup Server -> Symantec dbANYWHERE. If you are using the SQL Anywhere database server, you need to start it also. You start this from the start button, selecting Programs -> Sybase SQL Anywhere -> Standalone Sample database.

VCP has a complete set of tools for creating database aware applications. There is a table wizard, project wizard, dbNAVIGATOR and the dbAWARE widgets.

The table wizard allows you to add a form, this even supports master detail or header detail. This is where one table references another. A typical example is an invoice. There is an invoice table and an invoice detail table. The invoice contains information such as the ship to and billing addresses, where the invoice detail has information about each line item on the invoice.

dbNAVIGATOR is a hierarchical tool that allows you to pick and choose which table or fields to use on a form. It is a drag and drop tool, you select the fields you like by clicking and dragging them to a form. Once on the form you can configure the field by using the property sheet.

The project wizard lets you create a new project that is based on a database. It walks you through the process of creating this project. Prompting you to select options as you progress forward. Select New Project from the File Menu and you will get the following screen.

Creating a project the wizard has the following steps, screen shots are shown below.:
1) The wizard tells you what steps you will be performing.
2) You choose between an applet or an application
3) Configure dbANYWHERE
4) Select a data source, if this is the first time you are connecting to the data source you may need a user id and password. If you are using the SQL Anywhere database the user is dba and the password is sql.
5) Select a table, for this I have chosen DBA.employee.
6) You then select which columns you would like to edit, for this choose the top ten items.
7) You then are given the opportunity to set the label or field name that will be displayed to the user, we will leave them alone.
8) Select what functionality you would like user to have, this is in the form of buttons that are to appear on the form (previous, next, save, cancel, etc).
9) You are then given one last chance to change your mind. If you elect to finish, it goes off and creates a new project for you.

This is the fastest path to a database aware Java Applet or Application I have seen to date.


Step 1


Step 2


Step 3


Step 4

If this is the first time you have connected to this data source you may be prompted for a user name and password.


Step5

Step 6


Step 7


Step8


Step 9

Final Product

From here you can set additional functionality. Such as the employee ID should not be editable. Click on it and then select the properties sheet. You can set the Editable attribute to false. That's all there is to it.

Lets run this now by selecting Execute from the project window or by pressing Ctrl+F5 Verify that the employee ID is not editable, click on the field and try to change it. If you set the property you won't be able to. So, in the period of about ten minutes we have created a data entry front end for the employee database.

For purchase information see Symatec's web site http://www.symantec.com, Visual Café Pro is priced around $499 US.

Next Month I will be discussing a utility I call jSQL Net - It allows you to execute an SQL statement with the results being displayed in a scrollable grid. Biography
Rick Loek has been programming since '83. He spent several years at Patton & Patton Software http://www.patton-patton.com. He is currently working at OmniCell Technologies, http://www.omnicell.com and is the founder of the Silicon Valley Java Users Group http://www.best.com/~rickloek. Rick can be contacted at rickloek@best.com
 
  

 

MokaByte rivista web su Java

MokaByte ricerca nuovi collaboratori
Chi volesse mettersi in contatto con noi può farlo scrivendo a mokainfo@mokabyte.it