geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo v2.2 > Using datasource pool wizard in GEP
Date Wed, 23 Sep 2009 08:56:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=GMOxDOC22&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="http://cwiki.apache.org/confluence/display/GMOxDOC22/Using+datasource+pool+wizard+in+GEP">Using
datasource pool wizard in GEP</a></h2>
     <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~ellen.ltang@gmail.com">Ellen
Tang</a>
    </h4>
     Reviewed the word usage, sentence structure, and text formatting.
          <div id="versionComment" class="noteMacro" style="display:none; padding: 5px;">
     Reviewed the word usage, sentence structure, and text formatting.<br />
     </div>
          <br/>
     <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
class='ScrollbarPrevIcon'><a href="/confluence/display/GMOxDOC22/Making+deployment+plan+changes+with+Geronimo+Deployment+Plan+Editor"><img
border='0' align='middle' src='/confluence/images/icons/back_16.gif' width='16' height='16'></a></td><td
width='33%' class='ScrollbarPrevName'><a href="/confluence/display/GMOxDOC22/Making+deployment+plan+changes+with+Geronimo+Deployment+Plan+Editor">Making
deployment plan changes with Geronimo Deployment Plan Editor</a>&nbsp;</td><td
width='33%' class='ScrollbarParent'><sup><a href="/confluence/display/GMOxDOC22/Getting+familiar+with+Geronimo+Eclipse+Plugin+%28GEP%29"><img
border='0' align='middle' src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a
href="/confluence/display/GMOxDOC22/Getting+familiar+with+Geronimo+Eclipse+Plugin+%28GEP%29">Getting
familiar with Geronimo Eclipse Plugin (GEP)</a></td><td width='33%' class='ScrollbarNextName'>&nbsp;<a
href="/confluence/display/GMOxDOC22/Using+security+realm+wizard+in+GEP">Using security
realm wizard in GEP</a></td><td class='ScrollbarNextIcon'><a href="/confluence/display/GMOxDOC22/Using+security+realm+wizard+in+GEP"><img
border='0' align='middle' src='/confluence/images/icons/forwd_16.gif' width='16' height='16'></a></td></tr></table></div>

<p>This article shows you how to use the datasource pool wizard in GEP to create a datasource
pool during development. The datasource pool wizard is a handy feature to speed up your development
by creating a datasouce connector without any manual coding. Information of the connector
you create using this wizard is embedded in the deployment plan of the application as an <tt>&lt;ext-module&gt;</tt>
element. </p>

<p>This new feature is availabe in Eclipse v3.5 with Java Development Kit (JDK) v1.6.0.</p>

<p>Note that this wizard has the following two limitations:</p>
<ul>
	<li>It is only available when you develop a EAR project In Eclipse.</li>
	<li>It only supports the embedded Apache Derby database.</li>
</ul>


<h1><a name="UsingdatasourcepoolwizardinGEP-Addinganewdatasourcepool"></a>Adding
a new datasource pool</h1>

<p>To use the datasource pool wizard in GEP:</p>

<ol>
	<li>Double-click the <tt>geronimo-application.xml</tt> file under the <tt>/META-INF</tt>
directory of your application to open it in the <b>Geronimo Deployment Plan Editor</b>.
The following figure shows the <b>General</b> page in the editor:
<br clear="all" /> 
<br clear="all" />   <img src="/confluence/download/attachments/3474147/GEP_Wizard.png"
align="absmiddle" border="0" /><br clear="all" />
<br clear="all" /></li>
	<li>Click the <b>Connector</b> page, and then open the <b>Database
Pools</b> section to see the datasource pools that are defined. The following figure
shows the <b>Database Pools</b> section in the <b>Connector</b> page:
<br clear="all" /> 
<br clear="all" />   <img src="/confluence/download/attachments/3474147/GEP_DSWizard2.png"
align="absmiddle" border="0" /><br clear="all" />
<br clear="all" />The following list describes the functions of the three buttons in
the <b>Database Pools</b> section:<br clear="all" />
<br clear="all" />
	<ul>
		<li><b>Add</b> - create a new datasouce pool.<br clear="all" /></li>
		<li><b>Remove</b> - remove an existing datasource connector.<br clear="all"
/></li>
		<li><b>Edit</b> - reconfigure an existing datasource connector.<br
clear="all" />
<br clear="all" /></li>
	</ul>
	</li>
	<li>Click <b>Add</b> to open a datasource pool wizard, and then fill in
the required fields. The following figure shows the database pool wizard:
<br clear="all" /> 
<br clear="all" />  <img src="/confluence/download/attachments/3474147/GEP_DSWizard3.png"
align="absmiddle" border="0" /><br clear="all" />
<br clear="all" />
	<ul>
		<li><b>Connector</b> holds the location of a Java EE Connector module<br
clear="all" /></li>
		<li><b>External-path</b> indicates that the module is not part of the
enterprise application and must be located by matching the supplied pattern in a Geronimo
repository.<br clear="all" />
<br clear="all" /></li>
	</ul>
	</li>
	<li>Click <b>Next</b> to go to the step of <b>Basic Settings</b>.
The basic settings include pool name, database type and database name. Because this wizard
only supports embedded Apache Derby database, there are only three available options in the
<b>Database Type</b> drop-down list. and the driver is <tt>org.apache.geronimo.configs/system-database//car</tt>.
<br clear="all" /> 
<br clear="all" />   <img src="/confluence/download/attachments/3474147/GEP_DSWizard4.png"
align="absmiddle" border="0" /><br clear="all" />
<br clear="all" /></li>
	<li>Click <b>Next</b> to go to the steps of <b>Advanced Pool Settings</b>
and <b>Connection Pool Parameters</b>, and then fill in the required fields.<br
clear="all" />
<br clear="all" />The following two figures show the fields in these two steps:
<br clear="all" /> 
 <table class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><tbody><tr>
<p> <td class="confluenceTd" valign="top" width="30%">
<p>  <img src="/confluence/download/attachments/3474147/GEP_DSWizard5.png" align="absmiddle"
border="0" /> </p>
</td> <br clear="all" />
<br clear="all" /> <td class="confluenceTd" valign="top" width="30%">
<p>   <img src="/confluence/download/attachments/3474147/GEP_DSWizard6.png" align="absmiddle"
border="0" /></p>
</td></p>
</tr></tbody></table>
<p><br clear="all" /></p></li>
	<li>Click <b>Finish</b>, and the new datasource pool is created successfully.
The following figure shows you the <b>Connector</b> page with the new datasource
pool:<br clear="all" />
<br clear="all" />   <img src="/confluence/download/attachments/3474147/GEP_DSWizard7.png"
align="absmiddle" border="0" /><br clear="all" />
<br clear="all" /></li>
	<li>In the toolbar, click <b>Save</b> to save the settings of the new datasource
pool.</li>
</ol>


<p>Now you have created a new datasource pool. You can click the <b>Source</b>
page to review the deployment plan of the connector. The following figure shows a sample deployment
plan with a new datasource connector embedded:<br clear="all" /></p>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>geronimo-application.xml</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>&lt;app:application
application-name=<span class="code-quote">"TestEAR"</span> <span class="code-keyword">xmlns:app</span>=<span
class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/application-2.0"</span>

<span class="code-keyword">xmlns:client</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0"</span>
<span class="code-keyword">xmlns:conn</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"</span>

<span class="code-keyword">xmlns:dep</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.2"</span>
<span class="code-keyword">xmlns:ejb</span>=<span class="code-quote">"http://openejb.apache.org/xml/ns/openejb-jar-2.2"</span>

<span class="code-keyword">xmlns:log</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/loginconfig-2.0"</span>
<span class="code-keyword">xmlns:name</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/naming-1.2"</span>

<span class="code-keyword">xmlns:pers</span>=<span class="code-quote">"http://java.sun.com/xml/ns/persistence"</span>
<span class="code-keyword">xmlns:pkgen</span>=<span class="code-quote">"http://openejb.apache.org/xml/ns/pkgen-2.1"</span>

<span class="code-keyword">xmlns:sec</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/security-2.0"</span>
<span class="code-keyword">xmlns:web</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"</span>&gt;
    <span class="code-tag">&lt;dep:environment&gt;</span>
        <span class="code-tag">&lt;dep:moduleId&gt;</span>
            <span class="code-tag">&lt;dep:groupId&gt;</span>default<span
class="code-tag">&lt;/dep:groupId&gt;</span>
            <span class="code-tag">&lt;dep:artifactId&gt;</span>TestEAR<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>org.apache.geronimo.configs<span
class="code-tag">&lt;/dep:groupId&gt;</span>
                <span class="code-tag">&lt;dep:artifactId&gt;</span>system-database<span
class="code-tag">&lt;/dep:artifactId&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:dependency&gt;</span>
            <span class="code-tag">&lt;dep:dependency&gt;</span>
                <span class="code-tag">&lt;dep:groupId&gt;</span>org.apache.geronimo.framework<span
class="code-tag">&lt;/dep:groupId&gt;</span>
                <span class="code-tag">&lt;dep:artifactId&gt;</span>j2ee-security<span
class="code-tag">&lt;/dep:artifactId&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: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;app:ext-module&gt;</span>
        <span class="code-tag">&lt;app:connector&gt;</span>TestDataSource<span
class="code-tag">&lt;/app:connector&gt;</span>
        <span class="code-tag">&lt;app:external-path&gt;</span>
            <span class="code-tag">&lt;dep:groupId&gt;</span>org.tranql<span
class="code-tag">&lt;/dep:groupId&gt;</span>
            <span class="code-tag">&lt;dep:type&gt;</span>rar<span
class="code-tag">&lt;/dep:type&gt;</span>
        <span class="code-tag">&lt;/app:external-path&gt;</span>
        <span class="code-tag">&lt;conn:connector&gt;</span>
            <span class="code-tag">&lt;conn:resourceadapter&gt;</span>
                <span class="code-tag">&lt;conn:outbound-resourceadapter&gt;</span>
                    <span class="code-tag">&lt;conn:connection-definition&gt;</span>
                        <span class="code-tag">&lt;conn:connectionfactory-interface&gt;</span>javax.sql.DataSource<span
class="code-tag">&lt;/conn:connectionfactory-interface&gt;</span>
                        <span class="code-tag">&lt;conn:connectiondefinition-instance&gt;</span>
                            <span class="code-tag">&lt;conn:name&gt;</span>jdbc/TestDataSource<span
class="code-tag">&lt;/conn:name&gt;</span>
                            <span class="code-tag">&lt;conn:config-property-setting
name=<span class="code-quote">"Password"</span>&gt;</span>manager<span
class="code-tag">&lt;/conn:config-property-setting&gt;</span>
                            <span class="code-tag">&lt;conn:config-property-setting
name=<span class="code-quote">"LoginTimeout"</span>&gt;</span>5000<span
class="code-tag">&lt;/conn:config-property-setting&gt;</span>
                            <span class="code-tag">&lt;conn:config-property-setting
name=<span class="code-quote">"DatabaseName"</span>&gt;</span>TestDataBase<span
class="code-tag">&lt;/conn:config-property-setting&gt;</span>
                            <span class="code-tag">&lt;conn:config-property-setting
name=<span class="code-quote">"CreateDatabase"</span>&gt;</span>true<span
class="code-tag">&lt;/conn:config-property-setting&gt;</span>
                            <span class="code-tag">&lt;conn:config-property-setting
name=<span class="code-quote">"UserName"</span>&gt;</span>system<span
class="code-tag">&lt;/conn:config-property-setting&gt;</span>
                            <span class="code-tag">&lt;conn:connectionmanager&gt;</span>
                                <span class="code-tag">&lt;conn:xa-transaction&gt;</span>
                                    <span class="code-tag">&lt;conn:transaction-caching/&gt;</span>
                                <span class="code-tag">&lt;/conn:xa-transaction&gt;</span>
                                <span class="code-tag">&lt;conn:single-pool&gt;</span>
                                    <span class="code-tag">&lt;conn:max-size&gt;</span>10<span
class="code-tag">&lt;/conn:max-size&gt;</span>
                                    <span class="code-tag">&lt;conn:min-size&gt;</span>0<span
class="code-tag">&lt;/conn:min-size&gt;</span>
                                    <span class="code-tag">&lt;conn:blocking-timeout-milliseconds&gt;</span>5000<span
class="code-tag">&lt;/conn:blocking-timeout-milliseconds&gt;</span>
                                    <span class="code-tag">&lt;conn:idle-timeout-minutes&gt;</span>30<span
class="code-tag">&lt;/conn:idle-timeout-minutes&gt;</span>
                                    <span class="code-tag">&lt;conn:match-one/&gt;</span>
                                <span class="code-tag">&lt;/conn:single-pool&gt;</span>
                            <span class="code-tag">&lt;/conn:connectionmanager&gt;</span>
                        <span class="code-tag">&lt;/conn:connectiondefinition-instance&gt;</span>
                    <span class="code-tag">&lt;/conn:connection-definition&gt;</span>
                <span class="code-tag">&lt;/conn:outbound-resourceadapter&gt;</span>
            <span class="code-tag">&lt;/conn:resourceadapter&gt;</span>
        <span class="code-tag">&lt;/conn:connector&gt;</span>
    <span class="code-tag">&lt;/app:ext-module&gt;</span>
 <span class="code-tag">&lt;/app:application&gt;</span>
</pre>
</div></div>
     </div>
     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>

       <a href="http://cwiki.apache.org/confluence/display/GMOxDOC22/Using+datasource+pool+wizard+in+GEP">View
Online</a>
       |
       <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=3474147&revisedVersion=18&originalVersion=17">View
Change</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/GMOxDOC22/Using+datasource+pool+wizard+in+GEP?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message