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 an AS Java library by:
Creating a data-source.xml file based on this DTD,
Including the file in:
The META-INF directory of the application archive (EAR)
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.
The data-sources.dtd defines the following elements:
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 Sample Code
<data-source-name>myDataSource</data-source-name> |
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 Sample Code
<alias>myAlias</alias> |
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 <driver-name>myDriver</driver-name> |
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
We recommend that you configure the expiration control. 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 the transaction isolation level for the DataSource object. If you do not specify the isolation level, the system uses the default isolation level of the relevant 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:
|
jdbc-2.0 |
Use the jdbc-2.0 element and its subelements 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 Sample Code
<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> |
xads-class-name |
Contains the fully specified class name of the XADataSource implementation of the driver. Used in: jdbc-2.0 Sample Code
<xads-class-name>oracle.jdbc.xa.client.OracleXADataSource</xads-class-name> |
cpds-class-name |
Contains the fully specified class name of the ConnectionPoolDataSource implementation of the driver. Used in: jdbc-2.0 Sample Code
cpds-class-name>oracle.jdbc.pool.OracleConnectionPoolDataSource</cpds-class-name> |
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 Sample Code
<object-factory>oracle.jdbc.pool.OracleDataSourceFactory</object-factory> |
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 Sample Code
<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> |
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 |