astah* Database Reverse Component User Guide
- Import table definitions in DB to astah* models -

19 October, 2009
Change Vision, Inc.


[Overview]

As a sample of astah* API, "astah* Database Reverse Component" has been created. By this tool, table definitions in DB can be imported to astah* models. How to connect to DB and import table definitions to astah* models will be introduced below.

[astah* API Sample Program License Agreement]

[Steps for importing DB]

[Step1 Set environment for running the application]

In order to run the application, J2SE and databases should be installed in advance. Because this application uses JDBC driver to connect to databases, JDBC drivers for databases should be installed in advance, too. All links for downloading JDBCs used for our test are listed at the end of this page.

[Step2 Run the application]

Please double click the run.bat file below to run the application.
C:\Program Files\astah-professional\api\sample\db_reverse\run.bat

[Step3 Connect to databases]

Click "Connect" button after items below have been set. "Connection Succeeded" will be shown when the connection to DB has been established. If the connection failed, please modify the error items and click "Connect" button again.

[Step4 Import table definitions]

If the connection to the DB is established, click "Import" button after the items below have been set.
"Import Successfully" will be shown when the DB reverse has succeeded.

[Result of import]

This application reverses table definitions in DB to astah* models. An ER diagram will not be created automatically. To create an ER diagram and view all reversed entities, please select [Auto Create ER Diagram] in the ER model popup menu in the structure tree of astah*. Or, to show some models in the ER diagram, drag & drop them from the structure tree to the ER Diagram editor.

[Notes]

[Save or add items for connecting database - Config.properties]

The file below contains items for connecting database like DB URL.
By modifying the file, DB connection items can be added or modified.
Sample:
Add DB connection by items below and reverse to C:\db_reverse.asta.

  • Connect using: Oracle2
  • URL: jdbc:oracle:thin:@localhos:1521:XE
  • User: tester
  • JDBC Driver: oracle.jdbc.driver.OracleDriver
  • Driver path: C:\JDBC\ojdbc14.jar

Keys added in Config.properties for the new DB connect are below.

  • DB_Types=Oracle,Oracle2,MS\ SQLServer,MySQL,PostgreSQL,HSQLDB,H2\ Database\ Engine,Others[set\ schema],Others[set\ category]
  • Target_Model=C:\db_reverse.asta
  • Oracle2.URL=jdbc:oracle:thin:@localhost:1521\:XE
  • Oracle2.User=tester
  • Oracle2.JDBC_Driver=oracle.jdbc.driver.OracleDriver
  • Oracle2.Driver_Path=C:\JDBC\ojdbc14.jar

[Compile application]

If the source code of the application has been modified, please compile it again. To compile the application, double click compile.bat below.

[About support]

This application is provided as an API sample so that it will not be a support subject. Your bug report or questions regarding the environment (DB, JDBC) may not be answered.

[JDBCs for testing the application]

JDBCs below were used to test the application.
  • Since JUDE/Professional 5.4b1, Oracle10g, Microsoft SQL Server 2005, MySQL Server 5.0, PostgreSQL 8.3.1 are available with JDBC-ODBC Bridge Driver(sun.jdbc.odbc.JdbcOdbcDriver) and basic operations have been tested on these environments.
  • We recommend to use the JDBC driver for the PostgreSQL since you are unable to get relations of non-PK's
    and unique attribute's if you use the JDBC-ODBC Bridge Driver for the PostgreSQL.
    DB Name JDBC Friver Name jar
    Oracle10g oracle.jdbc.driver.OracleDriver ojdbc14.jar
    Oracle10g sun.jdbc.odbc.JdbcOdbcDriver %JAVA_HOME%/jre/lib/rt.jar
    Microsoft SQL Server 2005 com.microsoft.sqlserver.jdbc.SQLServerDriver sqljdbc.jar
    Microsoft SQL Server 2005 sun.jdbc.odbc.JdbcOdbcDriver %JAVA_HOME%/jre/lib/rt.jar
    MySQL Server 5.0 com.mysql.jdbc.Driver mysql-connector-java-5.1.6-bin.jar
    MySQL Server 5.0 sun.jdbc.odbc.JdbcOdbcDriver %JAVA_HOME%/jre/lib/rt.jar
    PostgreSQL 8.3.1 org.postgresql.Driver postgresql-8.3-603.jdbc3.jar
    PostgreSQL 8.3.1 sun.jdbc.odbc.JdbcOdbcDriver %JAVA_HOME%/jre/lib/rt.jar
    H2 Database Engine Version 1.0.72 org.h2.Driver h2.jar
    H2 Database Engine Version 1.0.72 org.h2.Driver h2.jar
    HSQLDB 1.8.0 org.hsqldb.jdbcDriver hsqldb.jar
    HiRDB Version 8 08-02 JP.co.Hitachi.soft.HiRDB.JDBC.PrdbDriver pdjdbc.jar

    [About JDBC driver]

    Because this application uses JDBC driver to connect to DB, JDBC driver for DB should be installed.

    DB URLs to download JDBC driver
    Oracle10g http://www.oracle.com/technology/global/jp/software/tech/java/jdbc/index.html
    Microsoft SQL Server 2005 http://www.microsoft.com/downloads/details.aspx?FamilyID=6d483869-816a-44cb-9787-a866235efc7c&DisplayLang=ja
    MySQL Server 5.0 http://dev.mysql.com/downloads/connector/j/5.1.html
    PostgreSQL 8.3.1 http://jdbc.postgresql.org/download.html
    H2 Database Engine http://www.h2database.com/
    HSQLDB http://hsqldb.org/
    http://sourceforge.net/project/showfiles.php?group_id=23316