geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo v3.0 > Configuring a DB2 datasource
Date Fri, 28 Jan 2011 08:34:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2036/9/4/_/styles/combined.css?spaceKey=GMOxDOC30&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Configuring+a+DB2+datasource">Configuring
a DB2 datasource</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~maojia508">maojia</a>
    </h4>
        <br/>
                         <h4>Changes (24)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{excerpt}This article shows you how
to configure a DB2 datasource in Apache Geronimo.{excerpt} <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >In this <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">scenario
we are creating</span> <span class="diff-added-words"style="background-color: #dfd;">scenario,
you will create</span> a connection pool for a DB2 database, <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">in
order</span> to connect to that database <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">we</span>
<span class="diff-added-words"style="background-color: #dfd;">you</span> are required
to define at least two driver jar files. They include the JDBC driver itself and the respective
license files. Depending on your implementation you will need different license files. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">The
steps described in this article are valid for deploying any other datasource when you don&#39;t
have the drivers installed on the server and/or require multiple driver files. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">The
steps described in this article are valid for deploying any other datasource when you do not
have the drivers installed on the server, require multiple driver files, or both. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>This article provides two
alternatives to deploy the connection pool: using the Geronimo Administration Console and
using the command line option. <br> <br>h1. Adding DB2 drivers to the repository
<br></td></tr>
            <tr><td class="diff-changed-lines" >To add the DB2 drivers and license
to the Geronimo <span class="diff-changed-words">repository<span class="diff-added-chars"style="background-color:
#dfd;">,</span></span> you are required to place the files in a particular
directory structure. You will normally have two or three files to add to the repository. These
files are: <br></td></tr>
            <tr><td class="diff-unchanged" > <br>* *db2jcc.jar* - This is
the actual DB2 Universal JDBC Driver jar file. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >* *db2jcc_license_cisuz.jar* - This
is the DB2 (DB2 ESE and DB2 Connect) JDBC Driver license for z/OS and iSeries that should
be used in addition to the standard license for these servers. <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >These files are available in the
{{&lt;sqllib_home&gt;\java}} directory. For additional information <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">on</span>
<span class="diff-added-words"style="background-color: #dfd;">about</span> the
DB2 JDBC drivers and <span class="diff-changed-words">licenses<span class="diff-added-chars"style="background-color:
#dfd;">,</span></span> visit the DB2 Information Center available at the following
URL: <br></td></tr>
            <tr><td class="diff-unchanged" > <br>http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.doc/ad/t0010264.htm
<br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">In
order to use these files in Geronimo, rename (copy and rename) the files according to the
following table.In this case we will not use *db2jcc_license_cisuz.jar* because it&#39;s
for Z/OS and iSeries. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">To
use these files in Geronimo, rename (copy and rename) the files according to the following
table. In this case, you will not use *db2jcc_license_cisuz.jar* because it is for Z/OS and
iSeries. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>||Original name||Renamed||
<br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >|db2jcc_license_cu.jar|db2jcc_license_cu-9.5.jar|
<br> <br></td></tr>
            <tr><td class="diff-changed-lines" >This means that for this particular
<span class="diff-changed-words">case<span class="diff-added-chars"style="background-color:
#dfd;">,</span></span> DB2 v9.5 <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">was</span>
<span class="diff-added-words"style="background-color: #dfd;">is</span> used.
<br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" >At this <span class="diff-changed-words">point<span
class="diff-added-chars"style="background-color: #dfd;">,</span></span> you
are ready to add those files to the Geronimo repository in two ways. You can either use any
graphical or command line tool to copy the files and create the necessary directories, or
<span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">you</span>
use the Geronimo Administration Console and add the driver and licenses to the common libraries.
See the following details. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>h3. Using command line
<br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br>* *{{com/ibm/db2/db2jcc/9.5}}*
<br></td></tr>
            <tr><td class="diff-changed-lines" >and copy the *db2jcc-9.5.jar*
<span class="diff-added-words"style="background-color: #dfd;">file</span> into
that directory. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>* *{{com/ibm/db2/db2jcc_license_cu/9.5}}*
<br></td></tr>
            <tr><td class="diff-changed-lines" >and copy the *db2jcc_license_cisuz-9.5.jar*
<span class="diff-added-words"style="background-color: #dfd;">file</span> into
that directory. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>h3. Using the Geronimo
Administration Console <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">In
order to</span> <span class="diff-added-words"style="background-color: #dfd;">To</span>
use the <span class="diff-added-words"style="background-color: #dfd;">administration</span>
console, Apache Geronimo must be running. Access the Geronimo Administration Console by pointing
your browser to the following URL: <br></td></tr>
            <tr><td class="diff-unchanged" > <br>http://localhost:8080/console
<br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">*</span>
<span class="diff-added-words"style="background-color: #dfd;">#</span> Enter <span
class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">the</span>
*system* as the user <span class="diff-added-words"style="background-color: #dfd;">name</span>
and *manager* as the password and click *Login*. <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">*
Click on *Services-&gt;Repository* portlet. <br>* Click on *Browse* and select the
first file to install. In this case we will first install *db2jcc-9.5.jar*. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">#
Click *Services-&gt;Repository* portlet. <br># Click *Browse* and select the first
file to install. In this case, you can install *db2jcc-9.5.jar* first. <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">*</span>
<span class="diff-added-words"style="background-color: #dfd;">#</span> A set of
values will be proposed by default, set the *Group:* to *com.ibm.db2*, leave the rest by default
and click *Install*. <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">*</span>
<span class="diff-added-words"style="background-color: #dfd;">#</span> Repeat
the previous two steps for <span class="diff-changed-words">*db2jcc_license_cisuz-9.5.jar*<span
class="diff-added-chars"style="background-color: #dfd;">.</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br>With the drivers and license
files installed, you can now create a new database connection pool. <br> <br>h1.
Creating a database connection pool using the wizard from the Geronimo Administration Console
<br></td></tr>
            <tr><td class="diff-changed-lines" >From the Geronimo Administration
<span class="diff-changed-words">Console<span class="diff-added-chars"style="background-color:
#dfd;">,</span></span> select *Database Pools* and create a new pool by clicking
*Using the Geronimo database pool wizard*. <br></td></tr>
            <tr><td class="diff-unchanged" > <br># Enter the pool name *DB2_ds*
and database type *DB2(DataDirect)* in the database pool wizard and then click *Next*. See
illustration in the following figure.\\ <br>!databasePoolCreate.jpg! \\ <br>\\
<br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">#
Select *Driver JAR* as following {{com/ibm/db2/db2jcc/9.5/jar}} and {{com.ibm/db2/db2jcc_license_cu/9.5/jar}}
from the list by pressing *Ctrl* on the keyboard, then enter the remaining connection information
as shown in the following figure. For this example the default *db2admin* user and password
was used and a *SAMPLE* database was created via the DB2 Control Center, *Server Name* as
{{localhost}}. \\ <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">#
Select {{com/ibm/db2/db2jcc/9.5/jar}} and {{com.ibm/db2/db2jcc_license_cu/9.5/jar}} for the
*Driver JAR* from the list by pressing *Ctrl* on the keyboard. Then enter the remaining connection
information as shown in the following figure. For this example, the default *db2admin* user
name and password are used and a *SAMPLE* database is created via the DB2 Control Center.
Set {{localhost}} as the *Server Name*. \\ <br></td></tr>
            <tr><td class="diff-unchanged" >!DB2_2.jpg! \\ <br>\\ <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br>h1. Deploying a database
connection pool using the command line <br></td></tr>
            <tr><td class="diff-changed-lines" >As an alternative to the wizard,
you can create a deployment plan manually and deploy it <span class="diff-added-words"style="background-color:
#dfd;">by</span> using the command line based deployer tool. To use this <span
class="diff-changed-words">option<span class="diff-added-chars"style="background-color:
#dfd;">,</span></span> create a *db2-plan.xml* file and copy the content of
the following <span class="diff-changed-words">example<span class="diff-added-chars"style="background-color:
#dfd;"> to the file</span>.</span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br>{code:xml| borderStyle=solid|title=db2-plan.xml
deployment plan} <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Let&#39;s
analyze this plan now. Take a look at the *{{&lt;dep:environment&gt;}}* section, there
you can find the {{moduleId}} which identifies the resource or component being deployed; in
the Administration Console the {{moduleId}} is displayed in the *Component Name* column on
the *Database Pools* portlet. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">In
the *{{&lt;dep:environment&gt;}}* section, you can find the {{moduleId}} that identifies
the resource or component being deployed; in the Administration Console the {{moduleId}} is
displayed in the *Component Name* column on the *Database Pools* portlet. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" >Right after the {{moduleId}} <span
class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">comes</span>
<span class="diff-added-words"style="background-color: #dfd;">is</span> the definition
of the dependencies. In this particular <span class="diff-changed-words">case<span
class="diff-added-chars"style="background-color: #dfd;">,</span></span> you
can find three *{{&lt;dep:dependency&gt;}}* blocks pertaining to the DB2 JDBC driver
and the license jar. The last &quot;big&quot; block in this plan is the *{{&lt;resourceadapter&gt;}}*
where the connection <span class="diff-changed-words">parame<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">n</span>ters</span>
such as driver, user and password, connection URL, <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">etc.</span>
<span class="diff-added-words"style="background-color: #dfd;">and so on</span>
are defined. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>h3. Deploying the datasource
<br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <style type='text/css'>/*<![CDATA[*/
table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color:
#f0f0f0}
table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}

/*]]>*/</style><div class="Scrollbar"><table class='ScrollbarTable'><tr><td
width='33%' class='ScrollbarPrevName'>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/GMOxDOC30/Configuring+datasource"><img border='0' align='middle'
src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a
href="/confluence/display/GMOxDOC30/Configuring+datasource">Configuring datasource</a></td><td
width='33%' class='ScrollbarNextName'>&nbsp;<a href="/confluence/display/GMOxDOC30/Configuring+a+MySQL+datasource">Configuring
a MySQL datasource</a></td><td class='ScrollbarNextIcon'><a href="/confluence/display/GMOxDOC30/Configuring+a+MySQL+datasource"><img
border='0' align='middle' src='/confluence/images/icons/forwd_16.gif' width='16' height='16'></a></td></tr></table></div>
<p><a name="ConfiguringaDB2datasource-top"></a></p>

<p>This article shows you how to configure a DB2 datasource in Apache Geronimo.</p>

<p>In this scenario, you will create a connection pool for a DB2 database, to connect
to that database you are required to define at least two driver jar files. They include the
JDBC driver itself and the respective license files. Depending on your implementation you
will need different license files.</p>

<p>The steps described in this article are valid for deploying any other datasource
when you do not have the drivers installed on the server, require multiple driver files, or
both.</p>

<p>This article provides two alternatives to deploy the connection pool: using the Geronimo
Administration Console and using the command line option.</p>

<h1><a name="ConfiguringaDB2datasource-AddingDB2driverstotherepository"></a>Adding
DB2 drivers to the repository</h1>
<p>To add the DB2 drivers and license to the Geronimo repository, you are required to
place the files in a particular directory structure. You will normally have two or three files
to add to the repository. These files are:</p>

<ul>
	<li><b>db2jcc.jar</b> - This is the actual DB2 Universal JDBC Driver jar
file.</li>
	<li><b>db2jcc_license_cu.jar</b> - This is the standard DB2 Universal JDBC
driver license file that allows access to the DB2 Universal database for Linux, UNIX and Windows
servers.</li>
	<li><b>db2jcc_license_cisuz.jar</b> - This is the DB2 (DB2 ESE and DB2
Connect) JDBC Driver license for z/OS and iSeries that should be used in addition to the standard
license for these servers.</li>
</ul>


<p>These files are available in the <tt>&lt;sqllib_home&gt;\java</tt>
directory. For additional information about the DB2 JDBC drivers and licenses, visit the DB2
Information Center available at the following URL:</p>

<p><a href="http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.doc/ad/t0010264.htm"
class="external-link" rel="nofollow">http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.doc/ad/t0010264.htm</a></p>

<p>To use these files in Geronimo, rename (copy and rename) the files according to the
following table. In this case, you will not use <b>db2jcc_license_cisuz.jar</b>
because it is for Z/OS and iSeries.</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Original name</th>
<th class='confluenceTh'>Renamed</th>
</tr>
<tr>
<td class='confluenceTd'>db2jcc.jar</td>
<td class='confluenceTd'>db2jcc-9.5.jar</td>
</tr>
<tr>
<td class='confluenceTd'>db2jcc_license_cu.jar</td>
<td class='confluenceTd'>db2jcc_license_cu-9.5.jar</td>
</tr>
</tbody></table>
</div>


<p>This means that for this particular case, DB2 v9.5 is used.</p>

<p>At this point, you are ready to add those files to the Geronimo repository in two
ways. You can either use any graphical or command line tool to copy the files and create the
necessary directories, or use the Geronimo Administration Console and add the driver and licenses
to the common libraries. See the following details.</p>

<h3><a name="ConfiguringaDB2datasource-Usingcommandline"></a>Using command
line</h3>
<p>Create the following directory structures under the <b><tt>&lt;geronimo_home&gt;\repository</tt></b>
directory and copy the appropriate files to the respective directories.</p>

<ul>
	<li><b><tt>com/ibm/db2/db2jcc/9.5</tt></b><br/>
and copy the <b>db2jcc-9.5.jar</b> file into that directory.</li>
</ul>


<ul>
	<li><b><tt>com/ibm/db2/db2jcc_license_cu/9.5</tt></b><br/>
and copy the <b>db2jcc_license_cisuz-9.5.jar</b> file into that directory.</li>
</ul>


<h3><a name="ConfiguringaDB2datasource-UsingtheGeronimoAdministrationConsole"></a>Using
the Geronimo Administration Console</h3>
<p>To use the administration console, Apache Geronimo must be running. Access the Geronimo
Administration Console by pointing your browser to the following URL:</p>

<p><a href="http://localhost:8080/console" class="external-link" rel="nofollow">http://localhost:8080/console</a></p>

<ol>
	<li>Enter <b>system</b> as the user name and <b>manager</b>
as the password and click <b>Login</b>.</li>
	<li>Click <b>Services-&gt;Repository</b> portlet.</li>
	<li>Click <b>Browse</b> and select the first file to install. In this case,
you can install <b>db2jcc-9.5.jar</b> first.</li>
	<li>A set of values will be proposed by default, set the <b>Group:</b>
to <b>com.ibm.db2</b>, leave the rest by default and click <b>Install</b>.</li>
	<li>Repeat the previous two steps for <b>db2jcc_license_cisuz-9.5.jar</b>.</li>
</ol>


<p>With the drivers and license files installed, you can now create a new database connection
pool.</p>

<h1><a name="ConfiguringaDB2datasource-CreatingadatabaseconnectionpoolusingthewizardfromtheGeronimoAdministrationConsole"></a>Creating
a database connection pool using the wizard from the Geronimo Administration Console</h1>
<p>From the Geronimo Administration Console, select <b>Database Pools</b>
and create a new pool by clicking <b>Using the Geronimo database pool wizard</b>.</p>

<ol>
	<li>Enter the pool name <b>DB2_ds</b> and database type <b>DB2(DataDirect)</b>
in the database pool wizard and then click <b>Next</b>. See illustration in the
following figure.<br class="atl-forced-newline" />
<span class="image-wrap" style=""><img src="/confluence/download/attachments/20645322/databasePoolCreate.jpg?version=1&amp;modificationDate=1245034519000"
style="border: 0px solid black" /></span> <br class="atl-forced-newline" />
<br class="atl-forced-newline" /></li>
	<li>Select <tt>com/ibm/db2/db2jcc/9.5/jar</tt> and <tt>com.ibm/db2/db2jcc_license_cu/9.5/jar</tt>
for the <b>Driver JAR</b> from the list by pressing <b>Ctrl</b> on
the keyboard. Then enter the remaining connection information as shown in the following figure.
For this example, the default <b>db2admin</b> user name and password are used
and a <b>SAMPLE</b> database is created via the DB2 Control Center. Set <tt>localhost</tt>
as the <b>Server Name</b>. <br class="atl-forced-newline" />
<span class="image-wrap" style=""><img src="/confluence/download/attachments/20645322/DB2_2.jpg?version=1&amp;modificationDate=1245034527000"
style="border: 0px solid black" /></span> <br class="atl-forced-newline" />
<br class="atl-forced-newline" /></li>
	<li>Click <b>Deploy</b>. You will have <b>DB2_ds</b> listed
in the <b>Database Pools</b> portlet.<br class="atl-forced-newline" />
<span class="image-wrap" style=""><img src="/confluence/download/attachments/20645322/DB2_5.jpg?version=1&amp;modificationDate=1203703281000"
style="border: 0px solid black" /></span> <br class="atl-forced-newline" />
<br class="atl-forced-newline" /></li>
</ol>


<h1><a name="ConfiguringaDB2datasource-Deployingadatabaseconnectionpoolusingthecommandline"></a>Deploying
a database connection pool using the command line</h1>
<p>As an alternative to the wizard, you can create a deployment plan manually and deploy
it by using the command line based deployer tool. To use this option, create a <b>db2-plan.xml</b>
file and copy the content of the following example to the file.</p>

<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>db2-plan.xml
deployment plan</b></div><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;?xml version=<span class="code-quote">"1.0"</span>
encoding=<span class="code-quote">"UTF-8"</span>?&gt;</span>
<span class="code-tag">&lt;connector xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"</span>&gt;</span>
    <span class="code-tag">&lt;dep:environment <span class="code-keyword">xmlns:dep</span>=<span
class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.2"</span>&gt;</span>
        <span class="code-tag">&lt;dep:moduleId&gt;</span>
            <span class="code-tag">&lt;dep:groupId&gt;</span>console.dbpool<span
class="code-tag">&lt;/dep:groupId&gt;</span>
            <span class="code-tag">&lt;dep:artifactId&gt;</span>DB2_ds<span
class="code-tag">&lt;/dep:artifactId&gt;</span>
            <span class="code-tag">&lt;dep:version&gt;</span>1.0<span
class="code-tag">&lt;/dep:version&gt;</span>
            <span class="code-tag">&lt;dep:type&gt;</span>car<span
class="code-tag">&lt;/dep:type&gt;</span>
        <span class="code-tag">&lt;/dep:moduleId&gt;</span>
        <span class="code-tag">&lt;dep:dependencies&gt;</span>
            <span class="code-tag">&lt;dep:dependency&gt;</span>
                <span class="code-tag">&lt;dep:groupId&gt;</span>com.ibm.db2<span
class="code-tag">&lt;/dep:groupId&gt;</span>
                <span class="code-tag">&lt;dep:artifactId&gt;</span>db2jcc<span
class="code-tag">&lt;/dep:artifactId&gt;</span>
                <span class="code-tag">&lt;dep:version&gt;</span>9.5<span
class="code-tag">&lt;/dep:version&gt;</span>
                <span class="code-tag">&lt;dep:type&gt;</span>jar<span
class="code-tag">&lt;/dep:type&gt;</span>
            <span class="code-tag">&lt;/dep:dependency&gt;</span>
            <span class="code-tag">&lt;dep:dependency&gt;</span>
                <span class="code-tag">&lt;dep:groupId&gt;</span>com.ibm.db2<span
class="code-tag">&lt;/dep:groupId&gt;</span>
                <span class="code-tag">&lt;dep:artifactId&gt;</span>db2jcc_license_cu<span
class="code-tag">&lt;/dep:artifactId&gt;</span>
                <span class="code-tag">&lt;dep:version&gt;</span>9.5<span
class="code-tag">&lt;/dep:version&gt;</span>
                <span class="code-tag">&lt;dep:type&gt;</span>jar<span
class="code-tag">&lt;/dep:type&gt;</span>
            <span class="code-tag">&lt;/dep:dependency&gt;</span>
        <span class="code-tag">&lt;/dep:dependencies&gt;</span>
    <span class="code-tag">&lt;/dep:environment&gt;</span>
    <span class="code-tag">&lt;resourceadapter&gt;</span>
        <span class="code-tag">&lt;outbound-resourceadapter&gt;</span>
            <span class="code-tag">&lt;connection-definition&gt;</span>
                <span class="code-tag">&lt;connectionfactory-interface&gt;</span>javax.sql.DataSource<span
class="code-tag">&lt;/connectionfactory-interface&gt;</span>
                <span class="code-tag">&lt;connectiondefinition-instance&gt;</span>
                    <span class="code-tag">&lt;name&gt;</span>DB2_ds<span
class="code-tag">&lt;/name&gt;</span>
                    <span class="code-tag">&lt;config-property-setting name=<span
class="code-quote">"TraceFile"</span>/&gt;</span>
                    <span class="code-tag">&lt;config-property-setting name=<span
class="code-quote">"UserName"</span>&gt;</span>db2admin<span class="code-tag">&lt;/config-property-setting&gt;</span>
                    <span class="code-tag">&lt;config-property-setting name=<span
class="code-quote">"DatabaseName"</span>&gt;</span>sample<span class="code-tag">&lt;/config-property-setting&gt;</span>
                    <span class="code-tag">&lt;config-property-setting name=<span
class="code-quote">"Password"</span>&gt;</span>db2admin<span class="code-tag">&lt;/config-property-setting&gt;</span>
                    <span class="code-tag">&lt;config-property-setting name=<span
class="code-quote">"ServerName"</span>&gt;</span>localhost<span class="code-tag">&lt;/config-property-setting&gt;</span>
                    <span class="code-tag">&lt;connectionmanager&gt;</span>
                        <span class="code-tag">&lt;local-transaction/&gt;</span>
                        <span class="code-tag">&lt;single-pool&gt;</span>
                            <span class="code-tag">&lt;max-size&gt;</span>10<span
class="code-tag">&lt;/max-size&gt;</span>
                            <span class="code-tag">&lt;min-size&gt;</span>0<span
class="code-tag">&lt;/min-size&gt;</span>
                            <span class="code-tag">&lt;match-one/&gt;</span>
                        <span class="code-tag">&lt;/single-pool&gt;</span>
                    <span class="code-tag">&lt;/connectionmanager&gt;</span>
                <span class="code-tag">&lt;/connectiondefinition-instance&gt;</span>
            <span class="code-tag">&lt;/connection-definition&gt;</span>
        <span class="code-tag">&lt;/outbound-resourceadapter&gt;</span>
    <span class="code-tag">&lt;/resourceadapter&gt;</span>
<span class="code-tag">&lt;/connector&gt;</span>
</pre>
</div></div>

<p>In the <b><tt>&lt;dep:environment&gt;</tt></b> section,
you can find the <tt>moduleId</tt> that identifies the resource or component being
deployed; in the Administration Console the <tt>moduleId</tt> is displayed in
the <b>Component Name</b> column on the <b>Database Pools</b> portlet.</p>

<p>Right after the <tt>moduleId</tt> is the definition of the dependencies.
In this particular case, you can find three <b><tt>&lt;dep:dependency&gt;</tt></b>
blocks pertaining to the DB2 JDBC driver and the license jar. The last "big" block in this
plan is the <b><tt>&lt;resourceadapter&gt;</tt></b> where
the connection parameters such as driver, user and password, connection URL, and so on are
defined.</p>

<h3><a name="ConfiguringaDB2datasource-Deployingthedatasource"></a>Deploying
the datasource</h3>
<p>To the deploy the DB2 datasource you just created, run the following command from
the &lt;geronimo_home&gt;\bin directory.</p>

<p><b><tt>deploy --user system --password manager deploy &lt;dep_plan_home&gt;\db2-plan.xml
..\repository\org\tranql\tranql-connector-db2-xa\1.4\tranql-connector-db2-xa-1.4.rar</tt></b></p>

<p>You will receive the following message:</p>

<p><font color="white"><div class="preformatted panel" style="background-color:
#000000;border-style: solid;border-width: 1px;"><div class="preformattedContent panelContent"
style="background-color: #000000;">
<pre>D:\geronimo-tomcat6-jee5-2.2\bin&gt;deploy --user system --password manager
deploy \tmp\db2-plan.xml ..\repository\org\tranql\tranql-connector-db2-xa\1.4\tranql-connector-db2-xa-1.4.rar
Using GERONIMO_BASE:   D:\geronimo-tomcat6-jee5-2.2
Using GERONIMO_HOME:   D:\geronimo-tomcat6-jee5-2.2
Using GERONIMO_TMPDIR: D:\geronimo-tomcat6-jee5-2.2\var\temp
Using JRE_HOME:        C:\Java\jdk1.6.0\jre
    Deployed console.dbpool/DB2_ds/1.0/car
</pre>
</div></div></font></p>

<p><a href="#ConfiguringaDB2datasource-top">Back to Top</a></p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Configuring+a+DB2+datasource">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=20645322&revisedVersion=2&originalVersion=1">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Configuring+a+DB2+datasource?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message