Manage Data Sources

This feature is available only in Enterprise Edition.

Manage data sources in script by using the :datasource or equivalent :ds command. Run the command using the Administration Console. (See Connect to a Repository for information on how to access the Console.)

List Available Data Sources

The list action lists the available data sources. Note: You must first connect to a repository. See Connect to a Repository.

Example

:datasource list

Get Data Source Information

The get action provides information about a particular data source. Note: You must first connect to a repository. See Connect to a Repository.

Parameter

name

The name of the data source.

Example

:datasource get Examples/Orders
:datasource get 'Examples/Stock History'

Modify Data Source Properties

The update action allows you to edit the definition of a data source. Note: You must first connect to a repository. See Connect to a Repository.

Parameter

name

The name of the data source.

properties

The name of a variable containing the task definition structure. The inetsoft.shell.dsl.DataSource DSL facilitates task definition. There are five supported data source types: jdbc, soap, tabular, text, and xml. The DSL properties are the same as the corresponding data structures in the API documentation.

Example

Move an existing data source named “Examples/Test” to “Test Data Source” and change the property values to those in the closure passed to jdbc.

import inetsoft.shell.dsl.DataSource
def ds = DataSource.jdbc {
  name 'Test Data Source'
  url 'jdbc:h2:mem:test'
  driver 'org.h2.Driver'
  requireLogin true
  user 'sa'
  password 'secret'
}
:datasource update 'Examples/Test' ds

Remove a Data Source

The delete action removes the specified data source. Note: You must first connect to a repository. See Connect to a Repository.

Parameter

name

The name of the data source.

Example

:datasource delete Examples/Orders