Java interfaces to DP4 - A4000014 - 27 Sep 2000

Via a JDBC-ODBC Bridge

Most Java runtime systems come with a 'bridge' from the JDBC interface to the conveniently similar ODBC interface. Once such implementation is the class sun.jdbc.odbc.JdbcOdbcDriver

To access a DP4 database via this, you should specify "jdbc:odbc:dsn" as the URL.
DP4 requires that the DSN and the dbname are the same.

This class allows the Java program to access the platform specific ODBC Driver Manager which can connect to any database system which is configured into it.

DP4 / ODBC drivers
Component
Operating System
Windows NT
Linux
ODBC Driver Manager Part of O/S, accessed via Control Panel unixODBC or iODBC, available for download on the Internet, uses /etc/odbc.ini etc.
DP4 interface software C:\DP4\WIN\ODBCLIBT.DLL
plus
C:\DP4\WIN\SQLLIBT.DLL
/usr/datafit/lib/libdp4odbc.so

Via a JDBC-DP4 class

This is a specifically written Java class, which conforms to the JDBC interface, but connects only to the DP4 database system. It looks the same from Java, but connects to the DP4 ODBC interface libraries using a specific Java Native Interface (JNI) layer.

One would use the class JdbcDp4Driver and specify "jdbc:dp4:dbname" as the URL.

While the DP4 ODBC layer is still used (as that's what JDBC needs) all the issues and overheads of installing an additional ODBC Driver Manager system are bypassed.

JDBC / DP4
Component
Operating System
Windows NT
Linux
JDBC classes JdbcDp4.jar, added to CLASSPATH
DP4 JNI components C:\DP4\WIN\JDBCDP4.DLL /usr/datafit/lib/libJdbcDp4.so

Possible future developments

The JdbcDp4 class does little more than provide a mapping between the methods required of a JDBC Driver class and the ODBC interface entry points in existing libraries.

The 'native' DP4 database mechanism is not really like that which one sees via SQL queries and result sets.

The next logical step would be to prepare a Java (not JDBC) class which allowed a much more efficient and direct usage of the DP4 API. This would require the enhancement of DP4 Tools such as LIBMAKE to generate Java interfaces such as those which are provided for C, C++ and Visual Basic.

Obtaining DP4 Java Components

Please contact us if you would like a trial copy of the DP4 JDBC/JNI components.