# DataSource

The data source element represents a connection to an external data system.

### Description

The Data Source script methods execute as methods of a JavaScript object that represents the data source. See the Data Scripting Objects section for a description of the `DataSource` scripting object.

### Inherited Properties

name
  The name is required for a data source. Data sets use this name to associate themselves with the data source.

### See Also

`DataSource` scripting object

## beforeOpen

Perform initialization before opening the data source connection for data access.

### Description

Called just before BIRT opens the data source. Allows the application to customize the data source properties.

### See Also

`afterOpen` method

## afterOpen

Perform initialization after opening the data source connection for data access.

### Description

Called just after BIRT opens the data source. Allows the application to perform any code-based initialization required for the data source.

### See Also

`beforeOpen` method

## beforeClose

Called just before closing the data source connection.

### Description

Called just before BIRT closes the data source. Allows the application to perform code-based cleanup.

### See Also

`afterClose` method

## afterClose

Called just after closing the data source connection.

### Description

Called just after BIRT closes the data source. Allows the application to perform code-based cleanup.

### See Also

`beforeClose` method