Using Database Connections

When the source data for a dataset is a database, FME is capable of storing connection parameters in a secure container. That container can be either published to FME Server or recreated on it.

What is a Database Connection?

Database connections are containers for a set of database connection parameters. These parameters include the database server, port number, username, password, and other parameters that vary according to the database type.

The two main advantages of database connections are:

  • Connection parameters are no longer embedded in a workspace, meaning less of a security risk
    • For example, your parameters would not be exposed to anyone who downloaded the workspace
  • Connection parameters can be reused among multiple workspaces
    • For example, two workspaces that use the same database can use the same connection

Database connections can be published with a workspace from FME Desktop, or they can be added directly within FME Server.


Creating Database Connections

Creating a database connection usually starts in FME Desktop. The connections can be created using Tools > FME Options > Database Connections in the FME Workbench menubar. The defined connection can then be used in a reader, writer, or transformer. Alternatively, when the author adds a Transformer, Reader or Writer to FME Workbench that requires a Database Connection but there is no existing connection for this format, they are prompted with the option to add a Database Connection from within this wizard.

As an example, this workspace has a connection for a PostGIS database, as seen in Navigator under the reader parameters and in the list of database connections:

When the workspace is published to FME Server a new dialog asks the author whether they would also like to publish the database connection:

The connection is then added to the connections container on FME Server.


FME Lizard says...
Note that you don't have to upload the connection with the workspace. If a connection for that database already exists on FME Server you can use that. FME Workbench should recognize whether a connection with the same name is already available, if it is, by default the box will not be checked.

If you don't upload the connection, and you don't already have one to use on FME Server, then you will need to use the Database Connections page to create one.

Managing Database Connections

FME Server has a page for managing database connections accessed through the main menu:

This page allows workspace authors - but usually administrators - to create new connections and copy, delete or edit existing connections:


Using Database Connections

When a workspace is run, if it has a database reader (for example) the end-user is prompted with a published parameter and can select the database connection to use:

The workspace then runs to completion as normal.


FME Lizard says...
Connections, like other objects on FME Server, have security permissions. Only the owner, someone with whom the connection is shared, or (by default) an administrator, can make use of it. It's not the case that any random user will be provided access to all database connections via the published parameter.

This also means that a workspace can be tested in FME Desktop using the author's connection parameters, but then require the end-user's connection once published to Server; all in a way that is both easy and secure.

results matching ""

    No results matching ""