Skip to main content
Pentaho Documentation

JDBC Datasource Resource

Overview

Methods for listing, creating, downloading, uploading, and removal of JDBC data sources.

Overview

This service provides methods for listing, creating, downloading, uploading, and removal of JDBC data sources.

The following resources are applicable:

/data-access/api/datasource/jdbc/connection

GET

Get a list of JDBC datasource IDs.

Example Request:
GET pentaho/plugin/data-access/api/datasource/jdbc/connection

Response Body

element: List
media types: application/xml
application/json

A list of JDBC datasource IDs.

Example Response:

{
"Item": [
{
"@type": "xs:string",
"$": "AgileBI"
},
{
"@type": "xs:string",
"$": "Audit"
},
{
"@type": "xs:string",
"$": "SampleData"
},
{
"@type": "xs:string",
"$": "TestDataSourceResource"
},
{
"@type": "xs:string",
"$": "baseball connection"
},
{
"@type": "xs:string",
"$": "baseball connection"
},
{
"@type": "xs:string",
"$": "live_logging_info"
},
{
"@type": "xs:string",
"$": "pentaho_operations_mart"
}
]
}

Status Codes

code description
200 Successfully retrieved the list of JDBC datasource IDs
500 Internal error retrieving JDBC datasource IDs

/data-access/api/datasource/jdbc/connection/{connectionId }

PUT

Add or update a JDBC datasource connection.

Example Request:
PUT pentaho/plugin/data-access/api/datasource/jdbc/connection/TestDatasource


POST data:
{
"changed": true,
"usingConnectionPool": true,
"connectSql": "",
"databaseName": "SampleData",
"databasePort": "9001",
"hostname": "localhost",
"name": "TestDataSourceResource",
"password": "password",
"username": "pentaho_user",
"attributes": {},
"connectionPoolingProperties": {},
"extraOptions": {},
"accessType": "NATIVE",
"databaseType": {
"defaultDatabasePort": 9001,
"extraOptionsHelpUrl": "http://hsqldb.sourceforge.net/doc/guide/ch04.html#N109DA",
"name": "Hypersonic",
"shortName": "HYPERSONIC",
"supportedAccessTypes": [
"NATIVE",
"ODBC",
"JNDI"
]
}
}

Parameters

name description type
connectionId (no documentation provided) path

Request Body

element: databaseConnection
media types: application/json

A DatabaseConnection in JSON representation

Response Body

element: (custom)
media types: */*
application/xml
application/octet-stream

A jax-rs Response object with the appropriate status code, header, and body.

Example Response:

This response does not contain data.

Status Codes

code description
200 JDBC datasource added successfully.
403 User is not authorized to add JDBC datasources.
304 Datasource was not modified
500 An unexected error occurred while adding the JDBC datasource.

/data-access/api/datasource/jdbc/connection/{name }

DELETE

Remove the JDBC data source for a given JDBC ID.

Example Request:
DELETE pentaho/plugin/data-access/api/datasource/jdbc/connection/TestDataSourceResource

Parameters

name description type
name The name of the JDBC datasource to remove path

Response Body

element: (custom)
media types: */*
application/xml
application/octet-stream

A 200 response code representing the successful removal of the JDBC datasource.

Example Response:

This response does not contain data.

Status Codes

code description
200 JDBC datasource removed successfully.
304 User is not authorized to remove the JDBC datasource or the connection does not exist.
500 An unexected error occurred while deleting the JDBC datasource.

GET

Export a JDBC datasource connection.

Example Request:
GET pentaho/plugin/data-access/api/datasource/jdbc/connection/TestDataSourceResource

Parameters

name description type
name The name of the JDBC datasource to retrieve path

Response Body

element: (custom)
media types: application/xml
application/json

A Response object containing the JDBC connection in XML or JSON form.

Example Response:

{
"SQLServerInstance": null,
"accessType": "NATIVE",
"accessTypeValue": "NATIVE",
"attributes": {
"PORT_NUMBER": "9001"
},
"changed": false,
"connectSql": "",
"connectionPoolingProperties": {},
"dataTablespace": "",
"databaseName": "SampleData",
"databasePort": "9001",
"databaseType": {
"defaultDatabasePort": 9001,
"extraOptionsHelpUrl": "http://hsqldb.sourceforge.net/doc/guide/ch04.html#N109DA",
"name": "Hypersonic",
"shortName": "HYPERSONIC"
},
"extraOptions": {},
"forcingIdentifiersToLowerCase": false,
"forcingIdentifiersToUpperCase": false,
"hostname": "localhost",
"id": "00ac4db3-7567-4019-8917-1b6f512ee162",
"indexTablespace": "",
"informixServername": "",
"initialPoolSize": 0,
"maximumPoolSize": 0,
"name": "TestDataSourceResource",
"partitioned": false,
"password": "password",
"quoteAllFields": false,
"streamingResults": false,
"username": "pentaho_user",
"usingConnectionPool": true,
"usingDoubleDecimalAsSchemaTableSeparator": false
}

Status Codes

code description
200 Successfully retrieved the JDBC datasource
500 An error occurred retrieving the JDBC datasource

Copyright © Pentaho.com
Generated by Enunciate.