Show TOC Start of Content Area

Procedure documentation Creating a DataSource with JDBC 2.0 Driver  Locate the document in its SAP Library structure

Use

You can use the administration tools that the J2EE Engine provides to create a standalone DataSource. It is deployed on the server as an application that contains only the deployment descriptor for the DataSource object.

Procedure

You can create a DataSource instance using the:

·        Visual Administrator

·        Console Administrator

Visual Administrator

...

       1.      In the Runtime tab of JDBC Connector Service, choose Resources DataSources.

       2.      Choose This graphic is explained in the accompanying text Create New Driver or DataSource on the toolbar.

       3.      Complete the following fields. All required fields are marked with an asterisk (*):

Field

Description

Example

Application Name

Specify the name of the application that is associated to the DataSource. The system uses this name for the configuration that holds the DataSource.

Note

Make sure the name does not already exist on the server; otherwise, the application is re-deployed and data is lost.

myApplication

Name

Specify a unique name for the DataSource. It is used when you look up the DataSource in the naming.

Note

When creating a standalone DataSource, make sure the name is unique. If a DataSource or an application with the same name already exists, the new DataSource replaces it.

MyDataSource

Aliases

You can specify unlimited number of aliases. They are alternative to the name of the DataSource and enable a single DataSource to be used by multiple applications.

For more information, see Managing Aliases.

MyDS

My_DS

My_dataSource

Driver Name

Choose a 2.0-compatible driver from the drop-down menu with registered drivers on the SAP J2EE Engine.

 

JDBC Version

Choose 2.0 from the drop-down menu.

 

Object Factory

Specify classname of the DataSource object factory (that is, a driver’s class that implements javax.naming.spi.ObjectFactory interface). The object factory is used to reconstruct objects after their references are looked up from the JNDI namespace.

oracle.jdbc.pool.OracleDataSourceFactory

DataSource Type

Choose one of the available options from the drop-down menu:

·        ConnectionPoolDataSource – if you choose this option, you obtain a CPDS directly from the driver

·        XADataSource – with this option you obtain a XADS from JDBC Connector Service

 

CPDS Classname/XADS Classname

The value of this field depends on your choice of DataSource Type.

If you have chosen to use ConnectionPoolDataSource, specify the name of the CPDS class used to provide a database connection.

If you have chosen to use XADataSource, specify the classname of the javax.sql.XADataSource implementation used to provide an XAConnection instance for distributed transactions.

oracle.jdbc.pool.OracleConnectionPoolDataSource

oracle.jdbc.xa.client.OracleXADataSource

Note

Most of the JDBC 2.0-compliant drivers have specific properties. To enter them, use the Additional tab of JDBC Connector Service runtime control. The most common driver-specific properties for JDBC 2.0 drivers are:

·         ServerName – the IP of the database server you use

·         PortNumber – the port used for connection to the database server

·         DatabaseName – the name of a particular database that you use

·         User – the username for accessing this database

·         Password – the corresponding password for the database user

Note

If you want to create a DataSource similar to an existing one, choose This graphic is explained in the accompanying text Copy All DataSource Properties on the toolbar to copy the properties of the existing DataSource. Then choose This graphic is explained in the accompanying text Create New Driver or DataSource and then This graphic is explained in the accompanying text Paste All DataSource Properties to paste the properties. Modify the parameters and save the DataSource object with a new name or in another application.

       4.      In the Additional tab, set the SQL type support. For more information, see SQL Engine

       5.      To save your entries, choose This graphic is explained in the accompanying text Save Changes on the toolbar.

Console Administrator

Use make_data_source command from the DBPOOL Shell command group. For more information, see DBPOOL in the Reference Manual.

 

See also:

 

Creating a DataSource with JDBC 1.x Driver

 

 

End of Content Area