This section is aimed at Java developers who wish to add JDBC connectivity to their applications using the Easysoft JDBC-ODBC Bridge.
It is assumed that the JOB Server has been successfully installed and configured and that you know the hostname for the server to which you wish to connect.
The Easysoft JDBC-ODBC Bridge comes in two components:
The JOB Server incorporates a Web Administrator (see The Web Administrator) that provides access to administration, monitoring and test facilities through a standard web interface.
The classes that make up the driver are in the Java archive file EJOB.jar. The driver class is called easysoft.sql.jobDriver.
Download EJOB.jar to the client machine from the JOB Server at http://hostname:8031/jars/EJOB.jar (where 8031 is the web server port).
On the client machine you must either amend or create the 'CLASSPATH' setting in the Environment Variables, which are found under Start > Settings > Control Panel > System > Advanced in Windows 2000 (this may vary with other versions of Windows).
If 'CLASSPATH' already contains a value, add a semi-colon and the full path and file name of your EJOB.jar file to the existing value.
To add a new 'CLASSPATH', click on the Environment Variables tab and click New.
Put 'CLASSPATH' in the Variable Name, the full path and file name in the Variable Value and then click OK.
Please note that you need to update either the User or System Environment Variable list as your application requires.
For applet deployment, place the EJOB.jar file with your applet in a directory readable by your web server and add the appropriate ARCHIVE=EJOB.jar attribute to the APPLET tag on your HTML page.
EJOB.jar can be downloaded from the link on the installed Easysoft JDBC-ODBC Bridge Web Administrator Information page:
In Figure 46 the jdbcUrl explicitly specifies the host on which the JOB Server is running.
Applet restrictions dictate that applets can only open socket connections to machines from which they have been downloaded. There is no browser independent way of determining from where a jar file has been downloaded.
The Easysoft JDBC-ODBC Bridge includes a facility that enables a short form of the URL to be used, eliminating the need to specify the hostname in your applet tag or Java code.
To achieve this the Web server must be installed on the same machine as the JOB Server.
Ensure the file ez.class is placed in the same directory as the HTML file used to run your applet, or in the directory specified as the CODEBASE attribute in your applet tag.
The driver will now attempt to discover the name of the host that it is loaded from, and will attempt a connection to the default 8831 port.
ez is a subclass of the easysoft.sql.jobDriver and can be used as an alternative short name in interactive applications which require you to enter the JDBC driver class name by typing ez instead of easysoft.sql.jobDriver.
You will find ez.class in http://localhost:8031/demo/ez.class:
public class ez extendsjobDriver {
public ez() throwsSQLException {
You can load the JOB Driver classes in your code using:
Class.forName("easysoft.sql.jobDriver").newInstance();
Class.forName("ez").newInstance();
which in turn will instantiate the easysoft.sql.jobDriver class.
An example connection to an URL with the Easysoft subprotocol:
String jobUrl= "jdbc:easysoft://myhost/myodbcdsn";
Connection con = DriverManager.getConnection(jobUrl);
The general form of a JOB URL is:
<url> ::= jdbc:easysoft:[<server spec>][<database>]
<server spec> ::= //[<host name>][:<port>]/
<database> ::= <dsn> | DSN=<dsn> | FILEDSN=<filedsn>
where | separates optional items, [ ] denotes an optional item and { }* denotes zero or more occurences.
jdbc:easysoft://<host>/Driver={<driver name>}[;<attr>=<value>]+
jdbc:easysoft://<host>/Driver={Microsoft Access Driver
(*.mdb)};DBQ=C\:tsmall.mdb;trace=on
Note that when using DSNless connections the JOB JDBC URL attribute separator ':' is changed to ';' so that ':' can be used as part of the ODBC connection attributes (as in Windows driver names).
host name and port describe how to access the remote machine where the JOB Server is running.
They must be explicitly specified in the JDBC URL if you wish to connect to a remote JOB Server.
user and password are given to the ODBC driver as UID and PWD.
They must be used if the database engine requires authentication.
logonuser and logonpassword specify an existing system user on the target machine.
They must be used if the database engine requires the connecting process (in this case the JOB Server) to be logged in as a particular user..
limit is used to restrict the number of rows that will be returned in any result set.
The limit is actually set in the ODBC driver by the JOB Server as statement attribute SQL_ATTR_MAX_ROWS, so it is supported only if your ODBC driver supports it.
fetchSize should be set to zero to avoid the retrieval of far more columns (the default is 4k) in a results set than will actually be needed by the application.