Setting the Connection Mode

About Setting the Connection Mode

You can connect to a database in one of these modes:

  • Dedicated

  • Shared

In the Dedicated mode, each user of the database will have one dedicated connection to the database and the connection is established at the time of logging into that database. The connection is closed only when the user logs out of the database. You can connect to a database in the Dedicated mode if there are only a few users.

In the Shared mode, there is a pool of connections that can be shared by all the users of the database. A few connections are created to the database, so that a user who logs into the database gets a connection from the pool, uses it and drops it back in the connection pool immediately after the database operation. A Data Source object enables a J2EE application to obtain a JDBC connection from a connection pool.

How To Set the Connection Mode

This task explains how to create and configure a JDBC provider:

  1. Log on to the WebSphere Application Server Administration console.

  2. Select Resources > JDBC Providers.

    The JDBC Providers page appears.

  3. In the JDBC Providers page, select the scope as Server, and then click New.

    The JDBC Providers - New appears.

  4. From the JDBC Providers list, select DB2 Universal JDBC Driver Provider.

  5. Click Apply.

    The Settings page for your JDBC Provider appears.

  6. In the Classpath area, change the classpath entries to reflect the correct locations of the following jar files.

  7. Click Apply.

    The JDBC Providers Settings page appears with the new settings.

  8. In the Additional Properties area, click Data Sources.

    The Data Sources page appears.

  9. Click New.

    The General Properties Settings page appears.

  10. In the General Properties Settings page:

    Enter a valid name for the JDBC data source. The JDBC Data Source name can be a string of characters that can include spaces.

    Enter a valid JNDI name. The JNDI name should not have any blank spaces.

    Note: The dblabel should be SRMDB in the dbinfo.cfg file.

  11. Click Apply.

    The Additional Properties Area page appears.

  12. In the Additional Properties area:

  • Click Custom Properties to enter information for the Resource Providers and Resource Factories.

    • Click databasename. Enter the name of the Db2 database to which you need to connect.

    • Click servername. Enter the host name on which the Db2 database is running.

    • Click portnumber. Enter the port number of the Db2 database.

    • Click preTestSQLString. Enter the SQL statement. For example, SELECT 1 FROM S_ROT_CLASS (where S_ROT_CLASS is the table name.)

  • In the Related Items area, click J2C Authentication Data Entries to enter the userid and password information.

    The J2C Authentication Data Entries page appears. The entries in this page are needed for Java 2 Connector security.

  • Click New.

    The User id and Password entries page appears.

    • In the Alias field, type the alias for the authentication data entry.

    • In the User ID field, type a user ID for Java 2 Connector security. For CES database, type the user ID as cisdba.

    • In the password field, type the password. For CES database, type the password as cisdba.

  • Click OK.

    The J2C Authentication Alias is created.

  • In the General Properties Settings page:

    • From the Component-managed Authentication Alias list, select the newly created J2C Authentication Alias.

    • From the Container-managed Authentication Alias list, select the newly created J2C Authentication Alias.

    • Click Test Connection.

    • Click OK.

    • Select Applications > Enterprise Applications.

      The Enterprise Applications page appears.

    • Select XJSAPP.

      The Enterprise Applications page appears with the Additional Properties and Related Items areas.

    • In the Related Items area, select Map Resource References to Resources.

      The Mapping Resource References to Resources page appears.

    • From the Specify existing JNDI Resource Name list, select the newly created JNDI resource.

    • Click the header to select all the entities.

    • Click OK.

    • Click Save.

      You are prompted to save the changes to update the master repository.

    • Click Save.

  1. Restart the WebSphere Application Server.