Every time an application requires access to a database entity, it opens a
connection to that database. In a scenario where several such applications
access the same database, the number of open connections become very large. But
not all of these connections are active all the time and resources can be saved
if an idle connection can be reused by some other process rather each process
opening and closing a new connection.
Applies To: Database admins Price: NA USP: Learn setting connection pools in Websphere Community Edition Primary Link: http://geronimo.apache.org Google Keywords: Geronimo Administration, Websphere |
This concept that lets different parts (or different applications) share the
same open database connection is called as Connection Pooling. Traditionally,
developers would use manual methods - like storing connection objects in a
collection or array and managing these 'pools' in code - to do this.
Websphere allows Java EE developers to achieve the same thing at a macro-level.
Connection pooling management in Websphere can be done from its admin
console, which can be accessed from any browser. To begin, setup the WASCE (Websphere
Application Server Community Edition) and start the server from Programs menu.
Step 1
Open the admin console by navigating to
https://localhost:8443/console/portal/welcome. Login using the admin id and
password (defaults are 'system' and 'manager' respectively). Click on
the Database Pools link on the top right pane of the welcome page or from the
'Services' tree node in the left panel of same. From the options click on
the link 'Using Geronimo Database Pool Wizard' link. In the following page
specify a name for the pool and select the required type from the 'Database
Type' list that is MySQL in our case. Click on Next to proceed.
Choose the appropriate driver class and JAR file type along with other connection parameters to provide a basic pool setup |
Step 2
Specify the Driver Class name, and Driver JAR type viz. 'org.gjt.mm.mysql.Driver'
and 'mysql/mysql-connector-java/
case. The rest of the fields require a username, password, hostname and port
(default 3306). Click on Next to provide additional parameters such as minimum
and maximum pool size and idle and block time-out. Clicking on 'Skip Test and
Deploy' deploys the pool.