Data Source APIs JDBC Datasource Resource
This service provides methods for listing, creating, downloading, uploading, and removal of JDBC data sources.
Get a list of JDBC datasource IDs.
Example Request:
GET pentaho/plugin/data-access/api/datasource/jdbc/connectioncURL Example:
curl -X GET \
"http://localhost:8080/pentaho/plugin/data-access/api/datasource/jdbc/connection" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Accept: application/json"Successfully retrieved the list of JDBC datasource IDs
List of JDBC datasource IDs in XML format
Internal error retrieving JDBC datasource IDs
GET /data-access/api/datasource/jdbc/connection HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
<jaxbList>
<type>java.lang.String</type>
<item>AgileBI</item>
<item>Audit</item>
<item>SampleData</item>
<item>TestDataSourceResource</item>
<item>baseball connection</item>
<item>live_logging_info</item>
<item>pentaho_operations_mart</item>
</jaxbList>
Add or update a JDBC datasource connection.
Example Request:
PUT pentaho/plugin/data-access/api/datasource/jdbc/connection/TestDatasourcecURL Example:
curl -X PUT \
"http://localhost:8080/pentaho/plugin/data-access/api/datasource/jdbc/connection/TestDatasource" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Content-Type: application/json" \
-d '{
"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"]
}
}'The ID of the JDBC datasource to add or update
TestDatasourceDatabase connection configuration
Unique identifier for the database connection
00ac4db3-7567-4019-8917-1b6f512ee162Name of the database connection
TestDataSourceResourceDatabase server hostname
localhostName of the database
SampleDataDatabase server port
9001Database username
pentaho_userDatabase password (may be encrypted or nullified for security)
passwordType of database access
NATIVEValue for the access type
NATIVESQL to execute on connection
Whether to use connection pooling
trueInitial connection pool size
0Maximum connection pool size
0Whether the database is partitioned
falseWhether the connection has been modified
falseWhether to quote all field names
falseWhether to use streaming results
falseWhether to force identifiers to lowercase
falseWhether to force identifiers to uppercase
falseWhether to use double decimal as schema table separator
falseData tablespace name
Index tablespace name
Informix server name
SQL Server instance name
JDBC datasource added successfully.
No content
Datasource was not modified
User is not authorized to add JDBC datasources.
An unexpected error occurred while adding the JDBC datasource.
PUT /data-access/api/datasource/jdbc/connection/{connectionId} HTTP/1.1
Host:
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 702
"{\n \"changed\": true,\n \"usingConnectionPool\": true,\n \"connectSql\": \"\",\n \"databaseName\": \"SampleData\",\n \"databasePort\": \"9001\",\n \"hostname\": \"localhost\",\n \"name\": \"TestDataSourceResource\",\n \"password\": \"password\",\n \"username\": \"pentaho_user\",\n \"attributes\": {},\n \"connectionPoolingProperties\": {},\n \"extraOptions\": {},\n \"accessType\": \"NATIVE\",\n \"databaseType\": {\n \"defaultDatabasePort\": 9001,\n \"extraOptionsHelpUrl\": \"http://hsqldb.sourceforge.net/doc/guide/ch04.html#N109DA\",\n \"name\": \"Hypersonic\",\n \"shortName\": \"HYPERSONIC\",\n \"supportedAccessTypes\": [\"NATIVE\", \"ODBC\", \"JNDI\"]\n }\n}\n"No content
Export a JDBC datasource connection.
Example Request:
GET pentaho/plugin/data-access/api/datasource/jdbc/connection/TestDataSourceResourcecURL Example:
curl -X GET \
"http://localhost:8080/pentaho/plugin/data-access/api/datasource/jdbc/connection/TestDataSourceResource" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
-H "Accept: application/json"The name of the JDBC datasource to retrieve
TestDataSourceResourceSuccessfully retrieved the JDBC datasource
An error occurred retrieving the JDBC datasource
GET /data-access/api/datasource/jdbc/connection/{name} HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
<?xml version="1.0"?>
<object>
<id>00ac4db3-7567-4019-8917-1b6f512ee162</id>
<name>TestDataSourceResource</name>
<hostname>localhost</hostname>
<databaseName>SampleData</databaseName>
<databasePort>9001</databasePort>
<username>pentaho_user</username>
<password>password</password>
<accessType>NATIVE</accessType>
<accessTypeValue>NATIVE</accessTypeValue>
<connectSql/>
<usingConnectionPool>true</usingConnectionPool>
<initialPoolSize>0</initialPoolSize>
<maximumPoolSize>0</maximumPoolSize>
<partitioned>false</partitioned>
<changed>false</changed>
<quoteAllFields>false</quoteAllFields>
<streamingResults>false</streamingResults>
<forcingIdentifiersToLowerCase>false</forcingIdentifiersToLowerCase>
<forcingIdentifiersToUpperCase>false</forcingIdentifiersToUpperCase>
<usingDoubleDecimalAsSchemaTableSeparator>false</usingDoubleDecimalAsSchemaTableSeparator>
<dataTablespace/>
<indexTablespace/>
<informixServername/>
<SQLServerInstance/>
<attributes>
<PORT_NUMBER>9001</PORT_NUMBER>
</attributes>
<connectionPoolingProperties/>
<extraOptions/>
<databaseType>
<name>Hypersonic</name>
<shortName>HYPERSONIC</shortName>
<defaultDatabasePort>9001</defaultDatabasePort>
<extraOptionsHelpUrl>http://hsqldb.sourceforge.net/doc/guide/ch04.html#N109DA</extraOptionsHelpUrl>
<supportedAccessTypes>NATIVE</supportedAccessTypes>
<supportedAccessTypes>ODBC</supportedAccessTypes>
<supportedAccessTypes>JNDI</supportedAccessTypes>
</databaseType>
</object>
Remove the JDBC data source for a given JDBC name.
Example Request:
DELETE pentaho/plugin/data-access/api/datasource/jdbc/connection/TestDataSourceResourcecURL Example:
curl -X DELETE \
"http://localhost:8080/pentaho/plugin/data-access/api/datasource/jdbc/connection/TestDataSourceResource" \
-H "Authorization: Basic YWRtaW46cGFzc3dvcmQ="The name of the JDBC datasource to remove
TestDataSourceResourceJDBC datasource removed successfully.
No content
User is not authorized to remove the JDBC datasource or the connection does not exist.
An unexpected error occurred while deleting the JDBC datasource.
DELETE /data-access/api/datasource/jdbc/connection/{name} HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
No content
Was this helpful?

