LucidWorks Search allows crawling of databases using a JDBC driver compatible with your RDBMS. However,due to licensing constraints, LucidWorks does not ship with a suite of compatible drivers and they must be added to LucidWorks manually. The JDBC Drivers API allows you to upload drivers to LucidWorks Search. Drivers used with LucidWorks Search must be compliant with the JDBC 3 or JDBC 4 specification.
API Entry Points
/api/collections/collection/jdbcdrivers: get a list of JDBC drivers or upload a new one
/api/collections/collection/jdbcdrivers/filename: update, delete, or get file contents
/api/collections/collection/jdbcdrivers/classes: get a list of JDBC 4.0 compliant drivers
Get a List of JDBC Drivers
GET /api/collections/collection/jdbcdrivers
Input
Path Parameters
| Key | Description |
|---|---|
| collection | The collection name |
Query Parameters
None.
Input Content
None.
Output
Output Content
| Key | Type | Description |
|---|---|---|
| filename | string | The driver filenames in a list |
Return Codes
None.
Examples
Get a list of all the driver jar files installed in the system.
Input
curl 'http://localhost:8888/api/collections/collection1/jdbcdrivers'
Output
[ "mysql.jar", "postgresql.jar" ]
Upload a New JDBC driver
POST /api/collections/collection/jdbcdrivers
You need to upload the JDBC driver using multipart/form-data file upload.
Input
Path Parameters
| Key | Description |
|---|---|
| collection | The collection name |
Query Parameters
None.
Input Content
file=driver filename
Output
Output Content
None.
Return Codes
204: (no content = success)
400: Bad Request (if form submit type is not multipart; if there is no "file" element in HTTP request; if file stream is empty)
409: Conflict (same file/driver already exists)
Examples
Upload the mysql.jar file to the system in order to support MySQL.
Input
curl -F file=@/path/to/mysql.jar http://localhost:8888/api/collections/collection1/jdbcdrivers
Output
None.
Delete a driver
DELETE /api/collections/collection/jdbcdrivers/filename
Input
Path Parameters
| Key | Description |
|---|---|
| collection | The collection name |
| filename | The driver filename |
Query Parameters
None.
Input Content
None.
Output
Output Content
| Key | Type | Description |
|---|
Return Codes
204: (No content = success)
409: Not Found
Examples
Remove MySQL support.
Input
curl -X DELETE 'http://localhost:8888/api/collections/collection1/jdbcdrivers/mysql.jar'
Output
None.
Get a List of JDBC 4.0 Compliant Drivers
GET /api/collections/collection/jdbcdrivers/classes
Input
Path Parameters
| Key | Description |
|---|---|
| collection | The collection name |
Query Parameters
None.
Input Content
None.
Output
Output Content
None.
Return Codes
None.
Examples
Get a list of the JDBC classes available to datasources.
Input
curl 'http://localhost:8888/api/collections/collection1/jdbcdrivers/classes'
Output
[ "com.mysql.jdbc.Driver", "oracle.jdbc.OracleDriver" ]