Getting Started-2-Tier |
When you begin to build a database application, you need to create a repository. A repository lets you take advantage of the contents of the database. You can directly, or via the screen wizard, use the database-derived objects in the repository to create screens.
In this lesson, you learn how to create a repository and populate it with imported database objects. The import process creates a screen, or repository entry, in the open repository for each database table that you import. The repository entry contains widgets representing each column defined in the database table.
In this lesson you learn how to:
vidsales
database tables into the repository.
Depending on whether you invoke the Panther editor from Windows or UNIX, use one of these procedures:
Start the editor
The editor workspace opens.
Create a repository where you can store imported database objects.
Create a repository
The New Repository dialog opens.
data.dic
as the name of a repository in the File Name field.
On startup, Panther automatically opens any local repository with the name data.dic
. To open a repository with a different name, edit your initialization file and set the application variable SMDICNAME
to the repository's path.
Note: Creating a new repository automatically closes any repository that is open.
More About Repositories
You can control the look and feel of application objects by modifying objects in a repository. From this centralized location, you can use and reuse the objects throughout the development of your application. Changes that you make to repository objects automatically propagate to the various screens that contain copies of the objects. This greatly simplifies both application development and maintenance.
In order to import database definitions, the editor must be directly connected to one of the database engines that Panther supports, including its own database engine JDB.
A Panther client can establish a connection to the database engine directly and through Panther's web application server. In this lesson, you will connect to JDB directly; in Lesson 2, you set up the web application server so it can connect to a database engine and let you test application screens from your browser.
The Choose Engine dialog opens.
vidsales
in the File Name field, then choose Open.
You are now connected to the database.
Note:
If the vidsales
database is not in your current directory, locate it with the dialog.
More About JDB
JDB is Panther's single-user SQL database. You can use it to quickly prototype your application and refine multi-user database applications without the need for an external third-party database.
When you import database objects into the repository, you can take advantage of the data definitions already in the database. The import process creates one screen in the repository for each selected database object. The contents of the resulting repository screens can be used to build application screens that access data. The next few steps show how to import database information into the Panther editor.
More About Importing Database Objects
You can import database table definitions into the repository at the outset of your development process, and reimport whenever the database schema changes.
Also, if your database engine supports other database object types, such as views and synonyms, you can import those as well.
All application objects that inherit from repository objects are maintained without having to access the database or manually edit screens. Development can continue even when the database is inaccessible or unavailable.
All application objects that inherit from repository objects are maintained without having to access the database or manually edit screens. Development can continue
The Import Database Objects dialog opens. All tables in the vidsales
database are listed.
When you select a table, the detail information for the table is displayed in Column Descriptions: column name, data type, and length. You can select multiple tables simultaneously: click+drag or Shift+click to select contiguous objects; Ctrl+click to select noncontiguous objects.
The status line informs you of each table imported into the repository and notifies you when the import process is completed.
You can use the repository table of contents (TOC) to select and open repository screens successively for copying and editing purposes. The TOC can remain open during your editing session.
This menu option toggles the display of the Repository table of contents. The TOC opens and displays a list of all screens in the open repository.
In this lesson, you performed these tasks:
vidsales
database so that you could import its definitions into a repository.
vidsales
database tables into the repository.
You learned:
What did you learn?