Previous | Next
WireHose Developers Guide

The adaptor dictionary

Each EOModel in a WebObjects application contains information in its index.eomodeld file called the "connection dictionary", which tells WebObjects which database on which host to connect to, which JDBC driver to use, etc.

WireHose can replace the database adaptor and connection dictionary on the fly when each EOModel is loaded. This allows you to switch between multiple databases by specifying a different adaptor dictionary on the command line when launching your application, as, for example, during development versus deployment.

An adaptor dictionary file is plain text in plist format, with two keys, "adaptorName" and "connectionDictionary". There are sample adaptor dictionaries for FrontBase, OpenBase and Oracle located in the WireHoseExtras/SampleData/sql directory.

Note: You can use the WHAdaptorDict property to specify the name of the adaptor dictionary to use at runtime. You can specify either the name of an adaptor dictionary in your application's Bundle Resources, or the full pathname to the desired file.

To set up the adaptor dictionary for Hello World:

  1. Select the adaptorDict.plist file in the Resources group in the Files pane in the Hello World project.

  2. Uncomment the appropriate lines for your database.

    If you're using OpenBase:

    URL = "jdbc:openbase://"; 
    driver = "com.openbase.jdbc.ObDriver";

    If you're using FrontBase:

    URL = "jdbc:FrontBase://localhost/HelloWorld/user=HelloWorld";
    driver = "jdbc.FrontBase.FBJDriver";

Previous | Next