Quick Links
Database Reversing Tool for Astah Professional
This application is created as a sample tool by using Astah API, therefore Chang Vision, Inc. shall not provide technical support for any issues that arose during using this application.
Astah DB Reversing tool is created as a sample tool by using Astah API. This tool enables you to connect to the database and import the contents of database tables into Astah professional.
- Before you start
- JDBC drivers
- Creating a Database
- Importing Database
- Opening .asta file in Astah professional
- Modification on astah DB reversing tool
Before you start
Read the "License Agreement for the Astah API Sample Programs"
("API_sample_program_license_agreement-e.txt", which is stored in astah install folder. )JDBC drivers
A JDBC driver needs to be installed in advance to use this astah DB Reversing tool to convert table definitions of database into astah models. Please download an appropriate JDBC driver and set up by yourself.
Creating a Database
This step will guide you how to create a database and tables using the HSQLDB that we used for our test. If you already have an existing database that contains tables you want to import, skip to next step.
- Download HSQLDB
Download the latest version of HSQLDB from the following URL.
http://hsqldb.org/ - Install the HSQLDB database
Install the required J2SE first, then open the HSQLDB zip file you downloaded.
(* We open the files under "C:\hsqlb-2.2.5\hsqlb" in this instruction) - Run HSQLDB from command prompt
Open a command prompt and type as below.cd C:\hsqldb-2.2.5\hsqldb\bin
When it works successfully, a dialog as shown below will appear.
runServer Running HSQLDB Database Manager from command prompt
Open a command prompt and type as below.cd C:\hsqldb-2.2.5\hsqldb\bin
Change the Type to "HSQL Database Engine Server" then click [OK]
runManager
- Executing SQL statement from HSQLDB Database Manager
Type SQL statements as described below in the right text are of next dialog.
DROP TABLE A IF EXISTS;
DROP TABLE B IF EXISTS;
DROP TABLE C IF EXISTS;
CREATE TABLE A (
ID INT NOT NULL PRIMARY KEY,
Name VARCHAR(10)
);
CREATE TABLE B (
ID INT NOT NULL PRIMARY KEY,
Name VARCHAR(10),
FOREIGN KEY (ID) REFERENCES A (ID)
);
CREATE TABLE C (
ID INT,
Name VARCHAR(10),
FOREIGN KEY (ID) REFERENCES A (ID)
); Press [Execute] button, then a dialog as shown below will appear.

Select [View] - [Refresh Tree] from Main Menu.
You see that Table A, B and C are created.
- Close HSQLDB Database Manager
Close HSQLDB Database Manager window.
- Download HSQLDB
Importing Database
- Running Astah DB reversing tool
Double-click the "astah Install Folder\api\sample\db_reverse\run.bat” file to run astah DB reversing tool.
(i.e. C:\Program Files\astah-professional\api\sample\db_reverse\run.bat)
(Example) In case you use HSQLDB :
- Setting up the information
Fill in the required information for the connection, and then click [Connect].[URL] jdbc:hsqldb:hsql://localhost
[User] sa
[Password] N/A
[JDBC Driver] org.hsqldb.jdbcDriver
[Driver path] C:\hsqldb-2.2.5\hsqldb\lib\hsqldb.jar
[Target Model] C:\result.asta - Connecting to Database
Press the [Import] button. [Import] button will be available once the connection to the database is established completely.
- Importing database tables into astah
A message [Import Successfully] will appear when the database reversing is completed successfully.
- Running Astah DB reversing tool
Open the .asta file in Astah Professional
- Run Astah pofessional and open the .asta file that is created
- Create ER Diagrams with all reversed tables
Click on the [ER Model] in the Structure Tree then select [Auto Create ER Diagram] from its Pop-Up Menu. If you want to create ER Diagrams with certain ER Entities only, create a new ER Diagram then drag and drop ER Entities you want to show from the Structure Tree onto the new ER Diagram. - Show Type and Length of Tables in the Diagram
Press [Ctrl + A] to select all tables in the Diagram then select [Type & Length Visibility] from its Pop-Up Menu. Table and Length will appear in each tables.
- Re-arrange Layout
Select [Alignment] - [Auto Layout] from Main Menu to rearrange the model layout.
- Let's zoom in to see the Table A, B and C in the Diagram.
You can see primary keys, Attributes, Identifying Relationships and Non-Identifying Relationships are created properly in the Diagram.
Modifications on astah DB reversing tool
- Read the License Agreement for astah API Sample Programs
Before you modify the tool, read the "License Agreement for astah API Sample Programs" ( "API_sample_program_license_agreement-e.txt", which is stored in astah install folder. ) - Where source code is stored
Source code written in Java and Astah API of Astah DB reversing tool re stored at :
astah Install folder\astah-professional\api\sample\db_reverse\*.java
(i.e.: C:\Program Files\astah-professional\api\sample\db_reverse\*.java ) - Making Modification to source code
As referred in the License Agreement for astah API Sample programs, users are able to modify the source code of the astah DB reversing tool to fit their purposes, however all copyrights and applicable rights to intellectual property with respect to the astah DB reversing tools will belong to the Change Vision, Inc. For more details, read the License Agreement for astah API Sample Programs. - Compiling by using Batch file
Compiling is available by double-clicking the batch file stored at
astah Install folder\astah-professional\api\sample\db_reverse\compile.bat
(i.e. :C:\Program Files\astah-professional\api\sample\db_reverse\compile.bat ) - Compiling by using Eclipse and other applications
Since astah DB reversing tool is designed with astah API, in order to compile by using Eclipse and other applications, you need to set up the "astah-api.jar" to the ClassPath.
astah-api.jar is stored at :
astah Install folder\astah-professional\astah-api.jar
(i.e.:C:\Program Files\astah-professional\astah-api.jar)
Also to launch the application, you need to set up astah-pro.jar to the Classpath.
astah-pro.jar is stored at :
Install folder\astah-professional\astah-pro.jar
(i.e.:C:\Program Files\astah-professional\astah-pro.jar)
- Read the License Agreement for astah API Sample Programs


![Subscribe to our blog! [Subscribe]](/resources/images/main/rss.png)


