Using Forte for Java with the Easysoft JDBC-ODBC Bridge to Access ODBC Data Sources

The following links cover two topics related to the use of the Easysoft JDBC-ODBC Bridge with Forte for Java and present modified versions of relevant pages from the Forte on-line documentation.

Adding the Easysoft JDBC-ODBC Bridge driver to Forte

The first step in setting up the Easysoft JDBC-ODBC Bridge is to install the JOB server on the machine on which your ODBC data sources are located. This will typically be a machine different from the one on which you will run Forte for Java.

You must place the Easysoft JDBC-ODBC Bridge driver classes contained in EJOB.jar into the Forte for Java lib/ext directory before you start Forte for Java. You cannot mount the driver file in Forte Explorer to start Forte for Java, or place the driver file in the classpath environment variable.

The Easysoft JDBC-ODBC Bridge driver classes should be downloaded from the machine on which you have installed the JOB Server. Ensure that the JOB Server is running and use your web browser to connect to the web server of the installed JOB Server using a URL of the form:

http://yourmachine:8031/

Note that if you changed the default port for the Easysoft JDBC-ODBC Bridge web server during installation then you will need to use your revised port number.

Click on the link EJOB.jar on the navigation bar of the server administrator and select Save this file to disk. Navigate to the Forte for Java lib/ext directory. Ensure the file name is set to EJOB.jar. On Windows platforms you must additionally set the file type to All Files:

Save As dialog box c:\forte4j\lib\ext directory

To add the Easysoft JDBC-ODBC Bridge driver:

  1. Open File>Explorer and select the Runtime tab:

    Forte Explorer Runtime tab with the Drivers tree expanded

  2. Right click on Drivers.

    Note: Using NetBeans will require the NetBeans Database Explorer module to be installed from the web site to make the Runtime>Databases>Drivers tab visible.

  3. Choose Add driver.

    The Add JDBC Driver dialog box is displayed, enabling a new driver to be added.

    Enter the following fields:

    Field Description Entry
    Name The IDE uses this name for display purposes only Easysoft JDBC-ODBC Bridge
    Driver The fully qualified driver class name easysoft.sql.jobDriver
    Database URL prefix A template for the database URL prefix jdbc:easysoft://machine/DSN[:unicode=on]

    The Database URL prefix template field can represent an invalid URL, the correct value for which can be completed later when a connection is made. For additional attribute value pairs, refer to Getting Started.

    Add JDBC Driver dialog box

    The driver (usually in a JAR or ZIP archive) must be in the Forte for Java CLASSPATH.

  4. Click OK to add the new driver to the list:

    The Easysoft JDBC-ODBC Bridge now displays in the Drivers list in the Runtime tab

    You can see " Easysoft JDBC-ODBC Bridge " in the list of drivers.

  5. Drivers can be removed manually by selecting them in Forte Explorer and clicking Delete, or you can open the property sheet and modify their configuration.

Note that adding a new driver just creates a template for new connections. Forte for Java does not actually try to use that driver or check to make sure it is the correct one until a connection is made using the driver.

To test a connected driver:

  1. Right-click on the driver or connection in Forte Explorer and select Test Driver from the context menu.
  2. In the displayed dialog box, enter the connection information (database URL, user name and password) and click OK.
  3. If all values shown in the output correspond with the actual database, you can use the driver.
  4. If an "unsupported exception" appears, test to make sure that the data displayed in the output window is valid (for example, that the number of tables or columns in the table corresponds with the actual data). The system returns the "Internal test driver failed" message whenever it finds a return value of 0 or an exception. If your database is empty or a table has no foreign references, the driver might not be the problem.

Connecting to an ODBC data source

There are two ways to open the New Database Connection dialog box, which allows Forte for Java to be connected to a database:

Then enter the following:

  1. Ensure the correct driver name is selected in Driver.
  2. Provide the JDBC URL for the database connection in Database URL.

    New Database Connection dialog box with jdbc:easysoft://hanna/northwind as the Database URL

    This URL typically begins with jdbc:, followed by a short code name for the driver, followed by another colon.

    The rest of the URL depends on the type of driver you are using.

    Full details of the JDBC URL for the Easysoft JDBC-ODBC Bridge driver can be found in Getting Started.

    To help you get started, existing drivers are provided with templates for the correct URL format; if in doubt, refer to the documentation for the driver you are using.

  3. Provide a User Name and Password if required by your database configuration.
  4. Click Remember password during this session to have the IDE remember your password.

    Note: The password is saved only for the current Forte for Java session. After restarting Forte for Java the password must be entered again. This feature can be turned on or off in the properties of each connected database in the Explorer.

  5. Click OK to connect Forte for Java to the database.
  6. If the connection is successful, a new node appears on the same level as Drivers. The icon for a connected database shows complete:

    northwind database in the Databases list in the Forte Explorer Runtime tab

    If the connection attempt fails, Forte for Java displays a dialog box indicating the connection is broken.

  7. By expanding the nodes underneath the new database connection you can see nodes for tables, views and procedures:

    Right-click the Categories table, then click View Data to display the table data

  8. Right clicking to display the pop-up menu and selecting View Data displays the result of a query showing the data in the table:

    Command Editor displaying the results of a select Description, Picture from Categories query

To correct the connection:

To disconnect from the database connection:

Article Feedback

* Did this content help you?
* Please select one option based on your first choice:

(* Required Fields)