Show TOC Start of Content Area

Procedure documentation Deploying Data Source Aliases  Locate the document in its SAP Library structure

Use

You use this procedure to define Data Source aliases and deploy them with your applications.

A Data Source alias is a logical name mapped to the name of a real Data Source available in the system. You use the Data Source alias in your application code to connect to the underlying Data Source.

A Data Source alias is defined by a data-source-aliases.xml file. This XML follows the definitions of the data-source-aliases.xsd XML schema.

Procedure

To deploy a Data Source alias with a Java EE 5 application, do the following in the SAP NetWeaver Developer Studio:

...

       1.      Add the SAP Data Source Aliases Provider Module facet to your EAR project.

                            a.      Select your Enterprise Application Project in the Project Explorer and choose Properties from the context menu.

                            b.      Select Project Facets from the properties tree and choose Modify Project.

                            c.      Set the SAP Data Source Aliases Provider Module checkbox and choose Finish.

The SAP NetWeaver Developer Studio creates the data-source-aliases.xml file under the META-INFdirectory of your Enterprise Application Project.

                            d.      Choose OK.

                            e.      To open the data-source-aliases.xml file for editing, select the file and choose Open from the context menu.

       2.      Fill in the elements you need to define your Data Source alias.

More information: data-source-aliases.dtd

Example

The following is an example of a data-source-aliases.xml that creates a Data Source alias to the System Data Source:

<?xml version="1.0" encoding="UTF-8"?>

<data-source-aliases

   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

   xsi:noNamespaceSchemaLocation="data-source-aliases.xsd">

   <application-name>ConverterEAR</application-name>

   <aliases>

      <data-source-name>${com.sap.datasource.default}</data-source-name>

      <alias>CAR_RENTAL_POOL</alias>

   </aliases>

</data-source-aliases>

 

End of Content Area