Connector JDBC API

This REST API allows you to upload JDBC drivers for use with a JDBC datasource. It can also be used to find the driver class name needed for JDBC datasource configuration.

Drivers are uploaded to a directory named $FUSION/data/connectors/lucid.jdbc/jdbc/<collection>, where <collection> is the collection name used during the upload.

Note
When choosing a driver, be sure to use the latest version available that is compatible with your database and the Java version you are using with Fusion.

Upload a Driver

The path to upload a .jar file containing a JDBC driver via a POST request is:

/api/apollo/connectors/plugins/lucid.jdbc/resources/jdbc?collection=<collectionName>

where <collectionName> is the collection for which the driver will be used.

Input

The .jar file is a binary file. If using curl, use the --form option, or if using another client, use the supported method for calling binary files.

Output Content

No output will be returned.

Examples

Note
Use port 8765 in local development environments only. In production, use port 8764.

Upload a Postgres driver to be used by a collection named 'docs':

REQUEST

curl -u user:pass -X POST --form file=@/path/postgresql-9.3-1101.jdbc4.jar http://localhost:8764/api/apollo/connectors/plugins/lucid.jdbc/resources/jdbc?collection=docs

RESPONSE

None.

List Available Drivers

A GET request will return all of the loaded drivers for a collection. The request path is:

/api/apollo/connectors/plugins/lucid.jdbc/resources/jdbc?collection=<collectionName>

where <collectionName> is the name of the collection.

Input

None.

Output

The response will include the name of the .jar file loaded and the available driver class names. The driver class name is the value that should be used when configuring a Database datasource.

Examples

Return drivers for a collection named 'docs':

REQUEST

curl -u user:pass http://localhost:8764/api/apollo/connectors/plugins/lucid.jdbc/resources?collection=docs

RESPONSE

[ {
  "name" : "postgresql-9.3-1101.jdbc4.jar",
  "properties" : {
    "type" : "jar"
  }
}, {
  "name" : "org.postgresql.Driver",
  "properties" : {
    "type" : "class"
  }
} ]

Delete a Driver

The path to remove the .jar file of a JDBC driver from a specific collection via a DELETE request is:

/connectors/v1/connectors/plugins/lucid.jdbc/resources/<driver>?collection=<collection>

where <driver> is the name of the driver being removed, and <collection> is the name of the collection to which it is attached.

Input

None.

Output

No output will be returned. The removal of the JDBC driver can be confirmed by sending the above request to list available drivers and verifying its absence.

Example

Delete the Postgres driver from the collection named 'docs':

REQUEST:

curl -u admin:password -X DELETE http://localhost:8984/con
nectors/v1/connectors/plugins/lucid.jdbc/resources/postgresql-9.3-1101-jdbc4.jar
?collection=docs

RESPONSE:

None.

Note that the DELETE request is sent to the connector port (default: 8984), rather than the Fusion UI port (default: 8764).