Getting Started Guide
The Easysoft JDBC-ODBC bridge (JOB) comes in two components:
- The JOB Driver --- 100% Java JDBC 1.2 and 2.1 compliant driver.
- The JOB Server --- built specifically for the platform where your ODBC Driver is installed.
There is also a lightweight HTTP server ('webserver') built-in to the JOB server, which provides access
to these documentation files and the driver classes.
This is not a full-fledged webserver like Apache, but a cut-down server intended only to provide the demos and web-configuration/monitoring of the JOB server.
For illustrating applet deployment view source for
OutputApplet.html and
coding see OutputApplet.java.
Use browsers View->Source function to see the source.
Connecting to the JOB
The driver is implemented in the package easysoft.sql.
It imports the easysoft.rpc package that enables
Remote Procedure Calls to C functions in the JOB server.
The driver class is
easysoft.sql.jobDriver
The classes that make up the driver are in the Java archive
file EJOB.jar.
- For applications you can download EJOB.jar to the client machine. Use Right Mouse/Save Link As or Right Mouse/Save Target As to save the EJOB.jar file.
Ensure that it is saved as EJOB.jar. With Internet Explorer change the Save type to All files and
give the file name EJOB.jar.
- For industrial-strength applet deployment you are advised to place
the EJOB.jar file with your applet,
in a directory readable by your full-featured webserver and add the appropriate archive=EJOB.jar tag within the APPLET tag.
- The driver itself attempts to discover the name of the host
that it is
loaded from, and will attempt a connection to the default 8831 port.
This requires the class ez. to be placed in the same
directory as the html file that is used to run your applet.
ez is a subclass of
easysoft.sql.jobDriver,(see java source ez.java),
and as such it can be given as an alternative short name, instead of easysoft.sql.jobDriver as the
name of the Easysoft JDBC-ODBC Bridge Driver's name.
Ensure that ez.class is saved as ez.class. With Internet Explorer change the Save type to All files and
give the file name ez.class
If connection to other hosts and/or port is intended it has to be given
explicitly in the JDBC url.
You can load the JOB Driver classes in your code using:
Class.forName("easysoft.sql.jobDriver").newInstance();
Alternatively you could use:
Class.forName("ez").newInstance();
which in turn will instantiate easysoft.sql.jobDriver class.
You connect with a URL following the easysoft subprotocol, for example:
String jobUrl= "jdbc:easysoft://demo.easyoft.com/pubs";
Connection con = DriverManager.getConnection(jobUrl);
The general form of a JOB URL is:
<url> ::= jdbc:easysoft:[<server spec>]:[<database>]{:<attribute>=<value>}*
<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.
host name and port describe how to access the remote machine where the JOB server is running.
Easysoft JDBC Url Examples
jdbc:easysoft:northwind
Driver will connect to the host from which the ez.class resource is
obtained. This could be localhost for applications or the host
from which the applet is downloaded from, and will establish conection
to named ODBC data source 'northwind'. Just like Sun's bridge.
jdbc:easysoft:DSN=northwind
Equivalent to the above.
jdbc:easysoft:
Driver will connect to host as above. Since no database is
specified, a list of available DSNs will be
presented in a dialog box to connect to.
jdbc:easysoft:FILEDSN=myfiledsn
As before but connecting to a file dsn datasource.
jdbc:easysoft://:8899/northwind
Use non-default port for JOB server to connect to.
jdbc:easysoft://demo.easysoft.com/northwind
In an application connect to JOB server at easysoft.
jdbc:easysoft:pubs:username=sysdba:password=masterkey
Connecting to a datasource called pubs requiring username and
password.
jdbc:easysoft:DSN=pubs:UID=sysdba:PWD=masterkey
As above but the username and password attributes are now passed
directly to the ODBC data source as ODBC connection string attributes.
The following Easysoft Jdbc Url attributes are recognised:
- :user=Database User Id
- :password=Database Password
- :logonuser=Remote System User Id
- :logonpassword=Remote System Password
- :limit=The maximum number of rows returned in any result set
- :trace=on | off turn on/off tracing to stdout in the client
- :multi=on Prefix each line in a trace with the thread id
- :fetchSize=0 Turn off retrival of columns in blocks.
- :unicode=on | all or off Turn on retriaval of unicode data from unicode fields. For MS Access use :unicode=all and :fetchSize=0 to retrive unicode data.
User and Password are given to the ODBC driver as UID and PWD. They must be used if the database engine
requires authentication.
Sometimes the database engine requires that the connecting process (i.e. the JOB server) is logged in
as a particular user. logonuser and logonpassword, if present, should specify an existing user on the
target machine. This will only work if the JOB Server is run as:
a Service using Logon As: System Account | on Windows |
root | on *nixes |
Limit is used to cap 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.
For a practical illustration, go to the demonstration page.
Further Information
For release notes see README.html
If you encounter any problems not covered in those files, please mail
support@easysoft.com