Configure a third-party application server for using DB2 UDB (1)

Source: Internet
Author: User
Tags db2 driver jboss application server

Introduction
By configuring the application server/IDE for the database, you can create a JDBC connection on the WebLogic application server, JBoss application server, or JDeveloper IDE, and use the connection to the DB2 database in the J2EE application developed by the application server. This article will show you how to configure JDBC connections from WebLogic and JBoss servers, and introduce JDeveloper IDE.

JBoss is an open-source application server. By default, it is configured using a Hypersonic database. Therefore, to make the sum of DB2 UDB used together, we need to configure DB2 for the JBoss application server. However, WebLogic and JDeveloper do not use the default database configuration.

Initial installation
First, install the application server and IDE and use them to configure the DB2 database connection. Install the WebLogic 8.1 application server and JBoss 4.0 Application Server of BEA. Add <JBoss>/bin to the <JBoss> directory where JBoss 4.0 is installed ). Then, install Oracle's JDeveloper 10 Gb. Finally, install DB2 UDB and create a DB2 database instance named DB2 ). In C:/Program Files/
The DB2 JDBC driver db2java.zip file is available in the IBM/SQLLIB/java directory.

Configure DB2 UDB with WebLogic
BEA WebLogic Server 8.1 is an Application Server used to develop, integrate, secure, and manage service-oriented distributed applications. This section describes how to configure the WebLogic 8.1 server that uses the DB2 database. You will use the DB2 database on the WebLogic Server to configure a connection pool, which is a group of connections to the database. Client/Server) the application obtains a connection from the connection pool through a data source that includes the JNDI binding. The DB2 Driver Class is required to configure the connection with the DB2 database. Add db2java.zip to the Classpath variable in the <BEA> \ user_projects \ domains \ mydomain \ startWebLogic script. <BEA> is the directory where WebLogic 8.1 is installed .) Start the WebLogic Server and access the WebLogic server Administration console through the URL http: // localhost: 7001/Console.

The WebLogic server Administration Console allows you to configure the JDBC connection to the DB2 database. See figure 1 ). In the navigation framework, select Services> JDBC node, right-click the Connection Pools node, and select Configure a New JDBC Connection Pool.

Figure 1. configure a new JDBC connection pool

In the Configure a JDBC Connection Pool framework, go to the Database Type list and select DB2. Then select IBM's DB2 Driver (Type 2) from the Database Driver field ). The JDBC connection in this section is configured with the DB2 Type 2 driver, but you can use any other listed drivers. Specify the driver used by the Classpath variable in the startWebLogic script. See figure 2.

Figure 2. Database driver

Then, specify the database name, user name, and password in the Define Connection Properties framework. Database Name) is the Name of the DATABASE created using the CREATE Database Command in the DB2 DATABASE. The Test Database Connection framework displays the Driver Class Name and URL. Click the Test Driver Configuration button to Test the DB2 Driver Configuration with the DB2 database. If you have established a Connection to the DB2 database, you will see a Connection successful message. If you want to configure multiple servers in one domain, you can select a server that will deploy the connection pool. Click Create and Deploy to Create and Deploy a connection pool. See figure 3 ).

Figure 3. Create and deploy

Now a connection pool is configured and a node is added to the connection pool in the navigation framework. You can select a connection node in the navigation framework to modify the connection pool settings. See figure 4 ). Some connection pool settings contain the Initial Capacity and maximum Capacity: Initial Capacity indicates the number of Initial connections in the connection pool, and MaxCapacity indicates the maximum number of connections in the database.

Figure 4. Connection Pool nodes

You can also configure the Data Source through the connection pool ). The data source is a Java Naming and Directory Interface, JNDI) object, used to provide access to the connection pool. To Configure the Data Source, right-click the JDBC> Data Sources node in the Administration Console and select Configure a new JDBCTxData Source. In the displayed Configuration framework, specify the JNDI name for the data source. In the Connect To Connection Pool framework, select the JDBC Connection Pool configured with the DB2 database. Then, the data source can be connected to the selected connection pool. Then, in the Target Data Source framework, select the Target server for the Data Source. Then, the Data source can be deployed on the selected server, and a node is added to the server in the Administration Console JDBC> Data Sources node. Now, you have successfully configured the DB2 database with WebLogic.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.