This chapter is composed of :
The purpose of this chapter is to show you how to create and update a Database Connection in the workspace.
To start the Database Connection wizard, select :
File->New->Other->Database->Database Connection
or
Select an object in the Package Explorer View or the Navigator View then right-click and select :
New->Other->Database->Database Connection
The New Database Connection wizard is composed of the following pages :
The New Folder page lets you choose a target inside your workspace.
You can type an existing path or you can select an existing node in the resource tree.
This selection is mandatory.
Once you have selected a parent node, you can type the name of a new node.
This node will be created as a child of your selected parent node.
It will be considered as the parent node of your new Database Connection.
This value is optional.
The Advanced button lets you create a link to an existing folder in the file system.
The Browse button opens a folder selector.
The Variables button opens a variable selector.
With this dialog box you can select or create a new Path variable.
Here is the result in your Database Folder page:
This described mechanism is the standard Eclipse way of working when you create a Folder.
The Database Connection page has the same fields as the Database Connection wizard page in the Database Explorer.
However the Reverse check box is inherited from the Connection Global Preferences.
This means that a Database Reverse is optionally performed when you create a Database Connection in the workspace.
The Database Schema page has the same fields as the Database Schema wizard page in the Database Explorer.
The Database Schema DTD page has the same fields as the Database Schema DTD wizard wage in the Database Explorer.
Once you have defined your connection and pressed the Finish button, your Database Connection is created.
Two or three files are defined in your workspace :
A folder is optionally defined.
If you requested a Reverse, a connection will be established to your database and a reverse will be performed.
A report is printed in the DatabaseConsole.
When you want to modify the parameters of an existing Database Connection, select any of its related files, right-click and select
Database->Update
In the Introduction of this chapter you learned that a selection is contextual.
In the Overview of this documentation, you saw the UML Class Diagram of a Database Connection.
Each file belonging to a Database Connection could be the starting point to open its Database Connection.
Right-Clicking on an SQL file or a Schema DTD will let you select the Database->Update command.
This mechanism is managed by an Index.
3.1. Database Connection Update
The Database Connection Update page has the same fields as the Database Connection wizard page in the Database Explorer.
The Database Schema Update page has the same fields as the Database Schema wizard page in the Database Explorer.
3.3. Database Schema DTD Update
The Database Schema DTD Update page has the same fields as the Database Schema DTD wizard wage in the Database Explorer.
In update mode the wizard doesn't know which kind of DTD you previously selected.
Select a Database Object in the Package Explorer View or the Navigator View then right-click and select :
Database->Refresh
If a Database Connection file is refreshed, then it will be parsed.
If a Database Schema or a Database Schema DTD file is refreshed, then the Database Schema file will be parsed.
As a general rule this command reads the selected Database Object.
Select a Database Object in the Package Explorer View or the Navigator View then right-click and select :
Database->Reverse
The Database Meta Data will be reversed and a merge process will be performed with the current content of your Database Schema.
A report will be displayed in the DatabaseConsole.