
You can use this procedure to add, remove or redirect aliases for DataSource objects.
Aliases are alternative names that are used by the application components when they look up a DataSource object. Using aliases provides a level of independence for your applications, since you can redirect the aliases and thus use different DataSource objects without changing the application code. This enables you to manage the database connectivity for your application easily.
You can define aliases either when you create a DataSource, or additionally at runtime. All aliases that have been defined for a DataSource are visible in the Runtime tab of JDBC Connector Service in the Visual Administrator. The aliases are registered when you start the application to which the aliases are associated, and are removed when you stop the component. They become functional - that is, the system binds them in the naming - when the DataSource for which they are created is started. If you stop the component with the DataSource and the component(s) with the aliases is still running, the aliases remain registered but you cannot use them unless you start the DataSource again. You can deploy aliases with the same name and for the same DataSource in different components. Such aliases are removed only after the last component that contains a data-source-aliases.xml for them is stopped.
Adding Aliases
You can use the following scenarios to define DataSource aliases:
Redirecting Aliases
You can change the association of an alias to a DataSource at runtime using the Runtime tab of the JDBC Connector Service in the Visual Administrator.
You can only redirect the alias to an existing DataSource.
Removing Aliases
You can remove aliases at runtime using the Runtime tab of the JDBC Connector Service in the Visual Administrator: