Choosing a Connection Method


You can use XQJ to connect to a data source using either of the following methods:

Specifying connection information explicitly in your Java application using a DDXQDataSource instance requires you to code the connection information directly in your Java application. See Configuring Connections Explicitly for complete information.

Using a DDXQDataSource object loaded from JNDI can be a convenient way to manage connections because the connection information is created and managed outside the applications that use it. As a result, the effort required to reconfigure your environment when an infrastructure change occurs is minimal. For example, if a database is moved to another server and uses a different port number, you only need to change the relevant properties of the data source object. An application accessing the database does not need to change because the application only references the logical name of the data source object in JNDI. See Configuring Connections Using JNDI for complete information.