Show TOC Start of Content Area

Procedure documentation Registering a DataSource Alias  Locate the document in its SAP Library structure

Use

Use this procedure to register an alias for an existing DataSource object.

You can:

·        Deploy the alias definition with your J2EE application or J2EE Engine library

·        Define the alias at runtime

Procedure

Deploying the Alias with an Application

       1.      In the J2EE Explorer view, open the context menu of the Enterprise Application Project and choose New META-INF/data-source-aliases.xml.

       2.      Enter a name for the alias. You can use uppercase letters, digits, slash and underscore only. Choose Finish. The system adds a data-source-aliases.xml to the project. It defines an alias for the default DataSource.

       3.      In the context menu of the Enterprise Application Project, choose Build EAR File. The system informs you if the build process has been successful.

       4.      Choose the generated EAR file and open its context menu. Choose Deploy to J2EE engine to deploy the application on the J2EE Engine using the SDM. The system displays a message to inform you that the deployment process has finished successfully.

Note

You can also deploy an alias for data sources other than the default one. To do this:

·         Create a data-source-aliases.xml using the format defined in data-source-aliases.dtd.

·         Include the XML file in the META-INF directory of the application archive.

Deploying the Alias with a Library

...

       1.         Create a file named data-source-aliases.xml using the format defined in data-source-aliases.dtd.

       2.         Include the XML file in the ../server/descriptors directory of the SDA, and deploy it to the J2EE Engine.

Defining an Alias at Runtime

You can define an alias using the Visual Administrator. For more information, see Managing Aliases in the Administration Manual.

Result

You can now access the DataSource using the alias that you have specified.

 

End of Content Area