Tags:

    Reverse Engineering a MS SQL Server Database with Entity Modeler

    Typically, a WO Project of some kind is necessary to do the proper debugging of MS SQL Server databases used in the WO/ JDBC world.   Direct to Web (D2W) is a tool that can adequately assist the developer in debugging most JDBC databases ensuring the database model is correct, and therefore any subsequent project using that model will also be correct.

    In this example, we use the MS SQL Server demonstrated in the lesson,____.    Start by opening Eclipse.   Create a new project of type Wonder D2W.   

    Creating a new Wonder D2W: \cite{Setting up a new ERD2W Application}

    1. Click on the File menu and select the New sub menu.
    2. Select the "Other" item in order to bring up all the types projects.
    3. Open the WOLips section in the project selection dialog, and select WOnderD2WApplication.
    4. Proceed through the D2W dialog
    5. Add a copy of the MS SQL JDBC driver
    6. Add an EOModel in the Resources directory,  in this example call it EmployeeD2W

    Connecting the EO Model to the database

    The next major step in reverse engineering and debugging the MS SQL Database for JDBC use is to connect the EO Model to the database. 

    1. Open the EO Model.  There should be a model group bearing the name of the EO Model and a database configuration named default.
    2. Rename the database configuration to MSSQL to provide clarity in this exercise.
    3. Ensure that the adaptor selected is an JDBC adapter
    4. Type in the driver name:  com.microsoft.sqlserver.jdbc.SQLServerDriver.   Available at Microsoft.
    5. Type in the URL, which in this case is jdbc:sqlserver://cs4354db.cs.ttu.edu:1433;databaseName=<Your eRaider Name>
    6. Type in your user name, which in this case is <Your eRaider Name>_user
    7. Type in your SQL Server password.   Do not confuse this for your eRaider password which is a separate thing.
    8. Save at this point.
    9. Now Right click on the Entity Model Group, and select reverse engineer.
    10. At this point, deselect all the tables and select the tables that you are interested in.


    Verifying the Reverse Engineered Model.

    Right click on the Entity Model Group.

    Select Verify Model and notice any discrepancies. 


    Adding class name information to the Reversed Engineered Model


    The purpose of adding class name information to the EO Model is to inform Java under Web Objects, Java Client, or JBND how to use the entities to the EO Model.    These are classes supplied by Java (Sun) and Java Foundation (NeXT/ Apple).


    Running Direct to Web to Determine the Database Effectiveness.