Import Database Schema from ODBC

Return to Introduction  Previous page  Next page

Analysis of legacy database systems is possible using Enterprise Architect?/span>s reverse engineering capabilities. By connecting to a live database via ODBC, you can import the database schema into a standard UML model. Subsequent imports enable you to maintain synchronization between the data model and the live database.

Enterprise Architect supports importing database tables from an ODBC data source. Tables are imported as stereotyped classes with suitable data definitions for the source DBMS.

Import Database Tables and Stored Procedures

To import database tables and stored procedures, follow the steps below:

Note: Import of stored procedures and views is supported for DB2, SQL Server, Firebird/Interbase, Informix, Ingres, Oracle 9i and 10g, MySQL, PostgreSQL, Sybase Adaptive Server Enterprise (ASE) and Sybase Adaptive Server Anywhere (ASA).

1.Select any package in the Logical View.
2.To import into:
·The package only, right-click on the package to display the context menu, and select the Code Engineering | Import DB Schema from ODBC menu option.
·A diagram, right-click on the diagram in the selected package to open the context menu, and select the Import DB schema from ODBC menu option.

Note: Alternatively you can select the Project | Database Engineering | Import DB Schema from ODBC menu option.

The Import DB Schema from ODBC Source dialog displays.

3.In the Database Name field, click on the drop-down arrow and select an ODBC data source.
4.When synchronizing existing classes, select the appropriate checkbox to determine whether the model comments, default values or constraints are to be synchronized with the ODBC tables.
5.To also import stored procedures, select the Include User Stored Procedures checkbox. To import user views, select the Include User Views checkbox.

Note: It is only possible to import into a diagram if it is in the selected package. If a diagram from another package is open, a message displays to give the option to cancel the import or to continue importing into the package only. The Import DB Schema from ODBC Source dialog includes checkbox options to import into the diagram and package, or into the package only.
If no diagram is open, the Package Only button defaults to selected and the options are disabled. If the open diagram is in the selected package, you can select either option.

6.Click on the Import button to start the import. Select a suitable ODBC data source from the ODBC dialog (ODBC must be installed and configured on your machine for this to work correctly).