Use a resource reference (resource-ref) for looking up a data source through the standard Java Naming and Directory Interface (JNDI) naming interface. The JNDI name defined in the resource reference is a logical name of the data source. Have your application use this JNDI name to look up a data source instead of using the JNDI name that is defined on the data source.
Later, you can substitute the real name, either by using an assembly tool or during installation of the application EAR file onto the server.
For example, assume that you use a data source jdbc/Section as illustrated in the following code:
javax.sql.DataSource specificDataSource = (javax.sql.DataSource) (new InitialContext()).lookup("java:comp/env/jdbc/Section");
In the assembly tool, specify the name (jdbc/Section) as the resource reference. If you know the name of the data source, you specify it in the resource references Bindings page.
Related concepts
Data sources
Related tasks
Accessing data from application clients
Configuring data access for the Application Client
Creating or changing a resource reference
Assembling data access applications
Accessing data using J2EE Connector Architecture connectors
Migrating a Version 4.0 data access application to Version 6.0
Creating and configuring a JDBC provider and data source