Installing and setting up JBuilder for database applications

To step through and run many of the database tutorials included in this book, you'll need to install these software components:

If you have the Client/Server version of JBuilder, you may also want to install the following software components, depending on your needs:


Installing JBuilder, JDBC, and the JDBC-ODBC bridge

When you install JBuilder, select Typical. If you select Custom, you should select the following options:

JavaSoft worked in conjunction with database and database tool vendors to create a DBMS independent API. Like ODBC (Microsoft's rough equivalent to JDBC), JDBC is based on the X/Open SQL Call Level Interface (CLI). Some of the differences between JDBC and ODBC are:

According to JavaSoft's web site, JDBC is been endorsed by leading database, connectivity, and tools vendors including Oracle, Sybase, Informix, InterBase, DB2. Several vendors, including Borland, have announced availability of JDBC drivers in products like DataGateway. Existing ODBC drivers can be utilized via the JDBC-ODBC bridge provided by JavaSoft. Using the JDBC-ODBC bridge is not an ideal solution since it requires the installation of ODBC drivers and registry entries. ODBC drivers are also implemented natively which compromises cross-platform support and applet security.

Installing JDBC and the JDBC-ODBC bridge

JBuilder JBCL DataExpress components are implemented using the JavaSoft database connectivity (JDBC) Application Programmer Interface (API). To create a Java data application, the JavaSoft JDBC sql package must be accessible before you can start creating your data application. If your connection to your database server is through an ODBC driver, you also need the JavaSoft JDBC-ODBC bridge software. The JBuilder installation takes care of putting these things in the right place.

The JDBC portion of the setup program installs the classes from the java.sql package in the classes.zip file in the jbuilder\java\lib\ directory.

The JDBC-ODBC bridge portion of the setup program installs the JDBC-ODBC bridge classes in the same classes.zip file. The JdbcOdbc.dll file is installed in the jbuilder\java\bin directory.

For more information about JDBC or the JDBC-ODBC bridge, visit the JDBC Database Access API Web page at http://splash.javasoft.com/jdbc/.

Connecting to databases

You can connect JBuilder applications to remote or local SQL databases, or to databases created with other Borland applications such as C++ Builder, Delphi, IntraBuilder, Paradox, or Visual dBASE. To do so, look at the underlying database that your application connects to and determine whether the database is a local or remote (SQL) database.

To connect to a remote SQL database, you need either of the following:

The two options when connecting to local, non-SQL databases such as Paradox or Visual dBASE are:

If you encounter any problems connecting to a JDBC database, see the topic Troubleshooting JDBC database connections in the tutorials.


Installing JBuilder sample files

The JBuilder samples directory contains files for various tutorials and examples presented in this manual. The Typical setup option installs the sample files to the samples\borland\samples\tutorial\dataset directory of your JBuilder installation by default. You can also select the Sample Files option under Custom setup to install the sample files.

The database sample applications use sample data provided with Local InterBase Server.


Installing Local InterBase Server

After installing JBuilder, run install.exe from the JBuilder CD, and select InterBase. The following steps provide the configuration information that is required for all of the tutorials in the database tutorials.
  1. Use the default choices.

    Note: The Local InterBase install.txt recommends that you allow InterBase to install into the default directories specified by the setup program.

  2. Allow the setup program to modify your TCP/IP services file.

  3. When the ODBC Configuration dialog appears, press Next to add Data Sources.

  4. On the Data Sources dialog, select "InterBase 4.x Driver by Visigenic" from the list of drivers. Click the Setup button.

    Note: If the "InterBase 4.x Driver by Visigenic" is not listed, click the Add button and select this driver to add it to the list. Once it appears in the list, select it and click the Setup button.

  5. To set up the Data Source Name, from the InterBase ODBC Configuration dialog:

    For this optionMake this choice

    Data Source Name DataSet Tutorial
    Description Optional. You can leave this blank
    Network Protocol <local>
    Database Select the employee database employee.gdb, from your InterBase directory; the default location for this file is
    c:\Program Files\Borland\IntrBase\EXAMPLES\employee.gdb
    Username SYSDBA
    Password masterkey

Click Close to close the Data Sources dialog. If you see a message that some files could not be updated because they were in use and will wait for next system reboot, reboot your system. If no message appears, launch the Local InterBase Server from your InterBase program group. InterBase will launch on Windows Startup, by default. To change this to manual startup, run InterBase Configuration from the InterBase program group and change the startup mode. InterBase must be running in order to work through the tutorials in this book.

Tips on using InterBase


Using DataGateway

DataGateway provides Java developers with a multi-tier, fast, and reliable database connectivity solution adhering to industry-standard JDBC. It consists of an all-Java connection to BDE (the Borland Database Engine), which in turn can access a wide range of SQL Servers and desktop databases. DataGateway provides native connectivity to Oracle, Sybase, DB2, Microsoft SQL Server, Informix, InterBase, Paradox, dBASE, Microsoft FoxPro, and Microsoft Access. DataGateway also provides additional connectivity through standard ODBC drivers. DataGateway's client JDBC driver is written entirely in Java and can run on all Java virtual machines that support JDK 1.1. The DataGateway Server currently supports Windows NT and Windows 95. DataGateway has these major benefits:

To install DataGateway, first install JBuilder so that the DataGateway installation can update JBuilder's IDECLASSPATH and CLASSPATH correctly. Then, run install.exe from the JBuilder CD, and select DataGateway. Accept the default choices, except as noted below. Do not run JBuilder during the DataGateway installation. Complete documentation and samples will be installed. If you plan to use DataGateway locally, choose the following installation options:

If you plan to use DataGateway on a Windows middle-tier server, choose the following installation options on the server machine:

After DataGateway has been installed, it can be accessed through the connection property of a Database component. In the connection property editor, select Choose URL. The Choose a Connection URL dialog is displayed. By default, InterBase Data Sources are displayed. If DataGateway is installed, it is automatically detected and the Borland DataGateway box is available with the following options:

The following figure shows an overview of the DataGateway architecture.

DataGateway architecture overview
Detailed image


Using InterClient

As an all-Java JDBC driver for InterBase, InterClient enables platform-independent, client/server development for the Internet and corporate Intranets. The advantage of an all-Java driver versus a native-code driver is that you can deploy InterClient-based applets without having to manually load platform-specific JDBC drivers on each client system (the Web servers automatically download the InterClient classes along with the applets). Therefore, there's no need to manage local native database libraries, which simplifies administration and maintenance of customer applications. As part of a Java applet, InterClient can be dynamically updated, further reducing the cost of application deployment and maintenance.

After installing JBuilder, run install.exe from the JBuilder CD, and select InterClient. Accept defaults, as appropriate. After installing InterClient, be sure to add it to JBuilder's IDECLASSPATH and CLASSPATH, as described in InterClient's readme.txt and jbuilder_notes.txt files.

InterClient allows Java applets and applications to:

The primary audience for InterClient is developers who wish to create Java-based client-server applications. Java developers should be able to seamlessly swap RDBMS back-ends underneath their JDBC applications. InterClient provides a small footprint, easy to maintain RDBMS (InterBase) as the back end to JDBC applications. An InterBase back end is an ideal solution because it's small, economical, and conforms to the same SQL standards as the JDBC.

InterBase developers who are writing new Java-based client programs can use InterClient to access their existing InterBase databases. Because InterClient is an all-Java driver, it can also be used on Sun's new NC (Network Computer), a desktop machine that runs applets. The NC has no hard drive or CD ROM; users access all of their applications and data via applets down loaded from servers.

The following figure shows the InterClient Architecture:

InterClient consists of two major pieces:

Developers can deploy InterClient-based clients in two ways: