How do I set up JBuilder 3.5 to work with my JDBC drivers?

By: Aaron Ruddick

Abstract: How to get your JDBC driver and JBuilder working together.

Question:

How do I Set up JBuilder to work with my JDBC drivers?

Answer:

To set up JDBC drivers you will follow these steps:

  1. Modify the JBuilder35 jbuilder.config file

    At design time, JBuilder uses its own classpath to find JAR files. This classpath is created from entries in the jbuilder.config file, which can be found in the "bin" directory of your JBuilder install. To add your JDBC driver to this file, follow these steps:

    1. Make a backup copy of the jbuilder.config file.
    2. Add the path to the location of the database driver (i.e. interclient.jar) to the original jbuilder.config.

    Use one of the following commands in the jbuilder.config file:

    addjars <path to directory> - Adds all JAR files in the specified directory to the JBuilder classpath.
    addpath <path to jar> - Adds a single jar to the JBuilder classpath.

    The path statements should use forward slashes and can be either relative or absolute.

    Unix example:

    addjars ../../usr/interclient/
    -or-
    addpath ../usr/interclient/interclient.jar

    Windows example:

    addjars c:/interclient/
    -or-
    addpath c:/interclient/interclient.jar

  2. Create a JBuilder Library for your JDBC driver

    Projects that run from within JBuilder have their own classpath. JBuilder creates this classpath in part from the Libraries that you have defined. Therefore, to make sure your JDBC driver is available for your projects that use it, define a new Library for the driver and add it to your Project's list of required libraries. This is done from within JBuilder using the following steps:

    1. Start JBuilder and choose Project|Default Project Properties.
    2. Select the Required Libraries tab on the Paths page, then click the Add button.
    3. Click New to define a new Library for your JDBC driver.
    4. Type in a name for the Library in the Name field.
    5. Select the Class tab, then click Add.
    6. Browse to the archive that contains your JDBC driver (i.e. interclient.jar), and click OK.
    7. Click OK on each of the opened dialog boxes to close them.

    This creates a Library for your JDBC driver that you will be able to add to any of your projects that need the driver.

    Now JBuilder and your JDBC driver are set up to work together. The next step is to add a Database component, and set its connection properties so that it can use your JDBC driver to access data. For more information on this, see "Tutorial: Connecting to a database using InterClient" in the Database Application Developer's Guide.

Note: If you wish to access your database outside JBuilder using JDBC Explorer you will need to edit your jdbce.config file using the steps from above.


Server Response from: ETNASC03