Show TOC

Object documentationdata-sources.dtd Locate this document in the navigation structure

 

A document type definition (DTD) used for producing XML files for the creation of DataSource objects. It contains parameters that the system uses to initialize a DataSource.

 

You can register a DataSource for an application or a AS Java library by:

  1. Creating a data-source.xml file based on this DTD,

  2. Including the file in:

    1. The META-INF directory of the application archive (EAR)

    2. The ./server/descriptors directory of the library or service SDA.

You can also use the XML file based on this DTD to create a DataSource object with the make_data_source Shell command from DBPOOL command group.

Structure

The data-sources.dtd defines the following elements:

This graphic is explained in the accompanying text.

XML Schema Description

Schema Element / Attribute

Description

data-sources

The root element for this deployment descriptor. It contains information about the associated application and the DataSource object that is created.

application-name

Defines the application that is associated to the DataSource. This tag is ignored if the data-sources.xml is deployed together with the application.

Used in: data-sources

data-source

Contains the properties of the DataSource object. These include: name of used driver, name of DataSource object, alias (must be unique), number of supported connections, isolation level information (optional), number of initial connections (optional), driver and connector properties.

Used in: data-sources

Contains: description, data-source-name, alias, driver-name, init-connections, max-connections, max-time-to-wait-connection, expiration-control, isolation-level, sql-engine, jdbc-2.0, jdbc-1.x

description

Contains a short description of a DataSource. This element is optional.

Used in: data-source

Example: <description>This is an example for a description of myDataSource.</description>

data-source-name

Specifies the name of the DataSource object to be created. It is used by the application during lookup or dependency injection. The name must be unique.

Used in: data-source

Example Example

  1. <data-source-name>myDataSource</data-source-name>
End of the code.

alias

Contains an alternative name of the DataSource that can be used by the application during lookup or dependency injection. The name must be unique.

Used in: data-source

Example Example

  1. <alias>myAlias</alias>
End of the code.

driver-name

Provides the name of the JDBC driver used to create the DataSource object. This name has been specified during the driver deployment.

Used in: data-source

Syntax Syntax

  1. <driver-name>myDriver</driver-name>
End of the code.

init-connections

Specifies the number of initial connection created during startup of the DataSource.

Default and recommended value: 0

Used in: data-source

max-connections

Specifies the maximum number of connections the DataSource can create.

Default value: 100

Recommended values: from 20% to 40% of the number of application threads.

Used in: data-source

max-time-to-wait-connection

Specifies the time (in seconds) to wait for a connection to become free if max-connections number reached.

Default value: 60

Used in: data-source

expiration-control

Defines parameters for connection life control. These are connection lifetime and a period to run a cleanup thread.

By default, the expiration control is disabled.

Recommendation Recommendation

We recommend that you configure the expiration control.

End of the recommendation.

Used in: data-source

Contains: connection-lifetime, run-cleanup-thread

connection-lifetime

Specifies a period in seconds for which a connection can stay. The connection is closed after this period.

Used in: expiration-control

run-cleanup-thread

Specifies a period in seconds after which the system runs a thread to clean up unused connections.

Used in: expiration-control

isolation-level

Determines a transaction isolation level for the DataSource object. If you do not specify the isolation level, the system uses the default isolation level of the used driver.

Default value for Open SQL: TRANSACTION_READ_UNCOMMITTED

Possible values: TRANSACTION_READ_UNCOMMITTED, TRANSACTION_READ_COMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE, TRANSACTION_NONE

Used in: data-source

sql-engine

Defines what type of connection the system should return.

Valid values:

  • open_sql - SAP's portable SQL. Works only with the system database schema.

  • native_sql - Provides statement pooling in addition to Vendor SQL. Works only with databases that are supported by SAP NetWeaver AS Java.

  • vendor_sql - Pure access to the database driver. SAP NetWeaver AS Java provides only connection pooling and transaction management with this type of SQL engine.

    Used in: data-source

jdbc-2.0

Use the jdbc-2.0 element and its sub-elements if the driver you are using is JDBC 2.0 compliant and supports XADataSource or PooledDataSource. You can choose whether to use ConnectionPoolDataSource to obtain the connection directly from the driver or an XADataSource that provides a connection handle using the DBPool Service. The information that whit element contains includes: class name of CPDS or XADS object, DataSource object factory, and specific properties.

Used in: data-source

Contains: xads-class-name, cpds-class-name, object-factory, properties

Example Example

  1. <jdbc-2.0>
    <xads-class-name>oracle.jdbc.xa.client.OracleXADataSource</xads-class-name>
    <object-factory>oracle.jdbc.pool.OracleDataSourceFactory</object-factory>
    <properties>
    		<property>
    				<property-name>serverName</property-name>
    				<property-value>Oracle</property-value>
    		</property>
    		<property>
    				<property-name>serverPort</property-name>
    				<property-value>1234</property-value>
    		</property>
    </properties>
    </jdbc-2.0>
    
End of the code.

xads-class-name

Contains the fully-specified class name of the XADataSource implementation of the driver.

Used in: jdbc-2.0

Example Example

  1. <xads-class-name>oracle.jdbc.xa.client.OracleXADataSource</xads-class-name>
End of the code.

cpds-class-name

Contains the fully-specified class name of the ConnectionPoolDataSource implementation of the driver.

Used in: jdbc-2.0

Example Example

  1. cpds-class-name>oracle.jdbc.pool.OracleConnectionPoolDataSource</cpds-class-name>
End of the code.

object-factory

Specifies the class name of the object factory class that is provided by the database driver and is used to create an XADataSource or a ConnectionPoolDataSource instance.

Used in: jdbc-2.0

Example Example

  1. <object-factory>oracle.jdbc.pool.OracleDataSourceFactory</object-factory>
End of the code.

jdbc-1.x

Use jdbc-1.x element if the driver you are using is based on the JDBC Driver Manager. The information that this element contains includes: class name of the driver, driver URL, user name and password, and driver-specific properties (optional).

Used in: data-source

Contains: driver-class-name, url, user-name, password, properties

Example Example

  1. <jdbc-1.x>
    <driver-class-name>com.sap.sql.jdbc.direct.DirectDriver</driver-class-name >
    <url>jdbc:sap:sapdb://localhost/TST?timeout=0</url> 
    <user-name>Administrator</user-name> 
    <password encrypted=“false”>admin</password> 
    </jdbc-1.x>
    
End of the code.

driver-class-name

Specifies the class name of the driver class.

Used in: jdbc-1.x

url

Specifies the URL of the database driver.

Used in: jdbc-1.x

user-name

Specifies a valid username for the database server.

Used in: jdbc-1.x

password

Specifies a valid password for the specified user in the <user-name> tag.

Used in: jdbc-1.x

encrypted

Deprecated.

Defines a password encrypted attribute for the password element. The legal values for the attribute are true and false. If you set it to true, encryption is applied on the password for security reasons.

Used in: password

properties

Contains additional driver-specific properties. This element is optional.

Used in: jdbc-2.0, jdbc-1.x

Contains: property

property

Describes a particular driver-specific property with its name and value.

Used in: properties

Contains: property-name, property-value

property-name

Specifies the name of a particular driver-specific property.

Used in: property

property-value

Specifies the value of a particular driver-specific property.

Used in: property