Menu
Simba Technologies
Simba Technologies

SimbaEngine X SDK 10.1.3
Developing Drivers for Data Stores Without SQL

Java on Windows

This section explains how to build a driver written in Java on Windows platforms.

You can use the sample projects from the 5 Day Guides as an example of how to build your own custom driver. For a step-by-step example on how to build the sample projects, see the 5 Day Guides at http://www.simba.com/resources/sdk/documentation/.

Options for Writing a Driver in Java

As explained in Implementation Options , you can write a custom ODBC or JDBC driver in Java using the following methods:

  • Use Java to write a DSII for an ODBC driver, and connect it to the C++ SDK using a JNI component.
  • This option can be implemented with or without the C++ Simba SQLEngine.

  • Use Java to write a DSII for an JDBC driver.
  • This option can be implemented with or without the Java Simba SQLEngine.

The compilation instructions for these two methods are described below.

Build a Pure-Java JDBC Driver

This type of driver can optionally use the Java SQL Engine. You can use it with or without the Java Simba SQLEngine.

Building a JDBC Driver for SQL-Capable Data Stores

The following steps describe how to build a pure-Java JDBC driver that does not use the SQL Engine:

  1. Ensure that the SimbaJDBC JAR file, located at [INSTALL_DIRECTORY]\DataAccessComponents\Lib, is in the classpath.
  2. Create your driver DSII JAR file.
  3. No additional libraries need to be linked.

The JavaUltraLight sample driver shows how to implement and build this type of driver.

Building with the Java Simba SQLEngine

To build a pure-Java JDBC driver that uses the Java SQL engine, follow the steps in Building a JDBC Driver for SQL-Capable Data Stores above, and also include the SimbaSQLEngine.jar in your build process.

The JavaQuickJson sample driver shows how to implement and build this type of driver. In this sample driver, the ANT build script packages the pre-compiled files with those of the DSII.

Build Java DSII for an ODBC Driver

This type of driver uses a JNI bridge to connect to the C++ API components. You can use it with or without the C++ Simba SQLEngine.

Building as an ODBC Driver (a DLL) for Local Connections

The following steps describe how to build an ODBC driver that doesn't use the SQL Engine and is not built for client-server deployments:

  1. Include the settings for C++ drivers described in C++ on Windows.
  2. Include the additional directory for the JVM library that is under $(JAVA_HOME)\lib:

    Configuration Properties -> Linker-> General-> Additional Library Directories

    Note:

    JAVA_HOME is an environment variable that should refer to the 32-bit Java installation directory when building the 32-bit ODBC driver or the 64-bit Java installation directory when building the 64-bit ODBC driver.

  3. Link against SimbaJNIDSI_$(ConfigurationName).lib and jvm.lib:

    Configuration Properties -> Linker-> Input-> Additional Dependencies

    Set ConfigurationName to one of the following values: Debug, Debug_MTDLL, Release or Release_MTDLL. For information on these options, see Run-time library options.

  4. Include the general and Java include paths:

    Configuration Properties -> C/C++-> General-> Additional Include Directories:

    • $(SIMBAENGINE_DIR)\Include\JNIDSI
    • $(JAVA_HOME)\include
    • $(JAVA_HOME)\include\win32

The sample drivers discussed in the document Build a Java ODBC Driver in 5 Days are configured to build as Windows DLL’s.

Building as a SimbaServer (an EXE) for Remote Connection

To build a driver as a stand-alone SimbaServer executable, follow the steps in Building as an ODBC Driver (a DLL) for Local Connections with the additional C++ settings described in Build as a SimbaServer (an EXE) for Remote Connections.

Building with the C++ Simba SQLEngine

To build a Java ODBC driver that uses the C++ SQL engine, follow the steps in Build as an ODBC Driver (a DLL) for Local Connections above with the additional SQL Engine settings described in Build with the SQL Engine.

The JavaQuickstart sample driver shows how to implement and build this type of driver.