Tuesday, 22 January 2013

Configure data source.

Data Source
data source  supplies the physical connection Between application server and Database

Configuring the WebSphere Application Server data source

Installed applications use data sources as resources to obtain connection to relational databases. To create these connections between an application and a relational database, WebSphere Application Server uses the driver implementation classes that are encapsulated by the JDBC provider, which is an object that represents vendor-specific JDBC driver classes to WebSphere Application Server. For access to a relational databases, applications use the JDBC drivers and data sources that you configure for WebSphere Application Server.

Procedure

  1. Start the WebSphere Application Server administrative console.
  2. Click Security -> Secure administration, applications and infrastructure.
  3. On the Configuration panel, expand Java Authentication and Authorization Service and click J2C authentication data.
  4. Click New and enter the Alias, User ID and Password.
  5. Click Ok.
  6. On the WebSphere Application Server administrative console, expand Resources. Expand JDBC then click JDBC Providers.
  7. In the Scope section, choose the Node level from the drop-down list.
  8. Click New to create a new JDBC driver.
  9. Select, in this order, the Database type, Provider type, Implementation type and Name. The Name automatically fills based on the implementation type you choose.
  10. Click Next and configure the database class path. Click Next.
  11. On the Summary page, click Finish.
  12. Click Save to save your selections. The JDBC providers page then appears.
  13. On the WebSphere Application Server administrative console, click Data sources.
  14. Click New to create a new data source. Enter the Data source name and the JNDI name, and choose the authentication alias from the drop-down list in Component-managed authentication alias. The JNDI name should match the datasourceName value set in wimconfig.xml. By default, it is jdbc/wimDS.
Note: For Cloudscape 10 Version 1 embedded databases, leave the Component-managed authentication alias field set to NONE.
  1. Click Next.
  2. Enter the Database name and deselect the checkbox, Use this data source in container managed persistence (CMP). Click Next.
  3. On the Summary page, click Finish.
  4. The Data sources page displays. Click Save, Then select the check box for the authentication alias previously created. Click Test Connection. The message should indicate that the connection is successful. Ignore any warnings, and then click Next.
  5. Save the configurations, and restart WebSphere Application Server.



Another 

Creating a data source in DB2 (WebSphere Application Server 6)


  1. Start WebSphere Application Server.
  2. Open the WebSphere Administrative Console.
  3. Click Security > Global security, then click Authentication > JAAS Configuration > J2C Authentication Data.
  4. Click New to display the J2C Authentication Data Entries page.
  5. Enter the alias, User ID, and password for authentication. Click Apply and Save.
    The cellname/alias name is now visible in the list of J2C Authentication Data.
  6. Navigate to Resources > JDBC Providers. Click New.
  7. Provide the following information on the General Properties page under Configuration:
    1. Select the database type.
    2. Select the provider type. For DB2 7.2, select DB2 Legacy CLI-based Type 2 JDBC. For DB2 8.1, select DB2 Universal JDBC Driver Provider.
    3. Click Apply.
  8. Provide the following information on the General Properties page:
    1. Enter the name for the JDBC Driver as DB2 JDBC Driver.
    2. Specify the class path.
      For DB2 7.2, specify the class path as Location of the db2java.zip file. To give the exact path for db2java.zip file, perform a file search on the machine on which DB2 is installed.
      For DB2 8.1, specify the class path as the location of the db2jcc.jar, db2jcc_license_cisuz.jar and db2jcc_license_cu.jar files.
    3. Accept the default for the implementation class name.
    4. Click Apply.
  9. Click Data Sources.
  10. Click New to display the General Properties page. Provide the following information:
    1. Put a logical name for your data source in the Name field.
    2. Put the JNDI Name (jdbc/v5/dashboard) for the data source in the JNDI field.
    3. In the Component-managed Authentication Alias field, select the authentication alias created earlier.
    4. In the databaseName field, specify the DB2 database alias name.
    5. In the portNumber property, specify the port number.
    6. In the serverName property, specify the server name.
    7. Click Custom Properties. Create two new properties called "user" and "password." Set appropriate values for both these properties.
  11. Click Apply and Save.
  12. Using the WebSphere Administrative console, test the connection to ensure that everything is configured correctly.
    1. In the left pane, click Resources > JDBC Providers.
    2. Click the JDBC provider created earlier.
    3. Scroll to the end of the screen and click Data Sources.
    4. Select the check box in front of the data source created earlier.
    5. Click Test Connection.
      A message should be displayed at the top saying "Test connection for datasource dataSourceName on server serverName at node NodeNamewas successful." Now, you should be able to connect to DB2 using this data source.
  13. Restart WebSphere Application Server and WebSphere Portal Server.


No comments:

Post a Comment