Getting Started with JDBC

JDBC provides generic non-spatial access to a wide number of database formats. All that is required is a driver and a connection string.

The driver JDBC version is recommended to be 4.0 or 4.1.

  • The primary source for drivers is the database vendor. However, commercial and open-source drivers are available from a number of locations. A list of third-party commercial JDBC drivers can be found at http://www.databasedrivers.com/jdbc/.
  • A single JDBC driver works for both 32-bit FME and 64-bit FME.
  • The JDBC driver file is a .jar file which needs to be placed in one of the locations that are added to the Java CLASSPATH when the Java Virtual Machine is loaded. These locations are:

<FME_install_directory>/plugins

<FMEServerSystemShare>/Resources/engine/Plugins/Java

<User_Documents>/FME/Plugins/Java

 

Note: To avoid connection errors, we recommend that you close FME Workbench before adding new .jar files.

Getting Connected

JDBC connection strings are usually documented for each database driver. For example:

Using the DB2 JDBC driver, the connection string would look something like:

jdbc:db2://bt-db-db2_97:50000/TESTDB

Using the PostgreSQL JDBC driver available from PostgreSQL, it looks like:

jdbc:postgresql://<host>/<database name>

For accessing SAP HANA, it would look like:

jdbc:sap://54.221.120.100:30015

For accessing SQL Server from Linux, it would look like:

jdbc:sqlserver://<hostname>;databaseName=<databasename>

In FME Workbench, you can set up a Database Connection entry that uses the required connection string. Select Tools > FME Options > Database Connections.

Once this connection has been successfully tested, it can be saved and used in any readers, writers, or transformers that want to connect using that particular connection string. For example:

The Java Driver Class is provided so that we can provide limited support of pre-4.0 drivers or incompletely packaged version 4 drivers. These require that you also specify the Java Driver class that you want to load, as well as the connection string. In most cases, this field can remain empty.