<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>kBLOG &#187; ADF</title>
	<atom:link href="http://blog.amr-gawish.com/tag/adf/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.amr-gawish.com</link>
	<description>All things about Life, Oracle Middleware and Technology</description>
	<lastBuildDate>Mon, 26 Dec 2011 07:08:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using Groovy to Retrieve Current logged in user name</title>
		<link>http://blog.amr-gawish.com/7842/using-groovy-to-retrieve-current-logged-in-user-name/</link>
		<comments>http://blog.amr-gawish.com/7842/using-groovy-to-retrieve-current-logged-in-user-name/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 08:23:55 +0000</pubDate>
		<dc:creator>agawish</dc:creator>
				<category><![CDATA[ADF]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[business component]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[jdeveloper]]></category>

		<guid isPermaLink="false">http://blog.amr-gawish.com/?p=7842</guid>
		<description><![CDATA[This is a cross post with mdlwr blog One tip I found Useful, and I didn&#8217;t find enough resources talking about it, is how to populate a value of Entity Attribute or Binding Value with the current logged in user &#8230; <a href="http://blog.amr-gawish.com/7842/using-groovy-to-retrieve-current-logged-in-user-name/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is a cross post with <a title="Using Groovy to Retrieve Current logged in user name" href="http://blog.amr-gawish.com/7842/using-groovy-to-retrieve-current-logged-in-user-name/" target="_blank">mdlwr </a>blog</p>
<p><a href="http://blog.amr-gawish.com/wp-content/uploads/2011/12/logs.jpg"><img class="aligncenter size-medium wp-image-7843" title="Logged In User" src="http://blog.amr-gawish.com/wp-content/uploads/2011/12/logs-300x186.jpg" alt="" width="300" height="186" /></a></p>
<p>One tip I found Useful, and I didn&#8217;t find enough resources talking about it, is how to populate a value of Entity Attribute or Binding Value with the current logged in user using Groovy</p>
<p>&nbsp;</p>
<p>Simply use this:<br />
<code>adf.context.securityContext.getUserPrincipal().getName()</code><br />
Piece of cake <img src='http://blog.amr-gawish.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amr-gawish.com/7842/using-groovy-to-retrieve-current-logged-in-user-name/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ADF Desktop Integration</title>
		<link>http://blog.amr-gawish.com/181/adf-desktop-integration/</link>
		<comments>http://blog.amr-gawish.com/181/adf-desktop-integration/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 22:57:35 +0000</pubDate>
		<dc:creator>agawish</dc:creator>
				<category><![CDATA[ADF]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[agawish]]></category>
		<category><![CDATA[Amr Gawish]]></category>

		<guid isPermaLink="false">http://blog.amr-gawish.com/?p=181</guid>
		<description><![CDATA[This is a great news, now you can make an ADF application all within the excel with real life data and actions from ADF and ADF binding. I can&#8217;t wait to test and see how this works check it out http://www.oracle.com/technology/products/adf/adfdi/index.html]]></description>
			<content:encoded><![CDATA[<p>This is a great news, now you can make an ADF application all within the excel with real life data and actions from ADF and ADF binding.</p>
<p>I can&#8217;t wait to test and see how this works</p>
<p>check it out <a href="http://www.oracle.com/technology/products/adf/adfdi/index.html">http://www.oracle.com/technology/products/adf/adfdi/index.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amr-gawish.com/181/adf-desktop-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dependent Combo Boxes Using Oracle ADF</title>
		<link>http://blog.amr-gawish.com/149/dependent-combo-boxes-using-oracle-adf/</link>
		<comments>http://blog.amr-gawish.com/149/dependent-combo-boxes-using-oracle-adf/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 00:47:39 +0000</pubDate>
		<dc:creator>agawish</dc:creator>
				<category><![CDATA[ADF]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[agawish]]></category>
		<category><![CDATA[Amr Gawish]]></category>
		<category><![CDATA[JSF]]></category>

		<guid isPermaLink="false">http://blog.amr-gawish.com/?p=149</guid>
		<description><![CDATA[For this tutorial I&#8217;ll be using the latest patch set or Oracle JDeveloper 11.1.1.2 and Oracle XE Database. What I&#8217;ll be demonstrating how to create a simple JSF (.jspx) web page that has two combo boxes that depend on one &#8230; <a href="http://blog.amr-gawish.com/149/dependent-combo-boxes-using-oracle-adf/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h1 id="head1" class="head1"><span style="font-weight: normal; font-size: 13px;">For this tutorial I&#8217;ll be using the latest patch set or Oracle <a title="http://www.oracle.com/technology/software/products/jdev/htdocs/soft11.html" href="http://www.oracle.com/technology/software/products/jdev/htdocs/soft11.html">JDeveloper 11.1.1.2</a> and <a title="http://www.oracle.com/technology/software/products/database/xe/index.html" href="http://www.oracle.com/technology/software/products/database/xe/index.html">Oracle XE Database</a>.</span></h1>
<p>What I&#8217;ll be demonstrating how to create a simple JSF (.jspx) web page that has two combo boxes that depend on one another. In other words, two combo boxes (af:SelectOneChoice) depend on each other and are automatically refreshed when selected.</p>
<p>Here is an index of each section in my article:</p>
<ol class="dec">
<li><a title="Jump to Section" href="#head2">Create New Application</a></li>
<li><a title="Jump to Section" href="#head3">Setup Database Connection</a></li>
<li><a title="Jump to Section" href="#head4">Working with the Model</a></li>
<li><a title="Jump to Section" href="#head5">Creating the View / JSF Page</a></li>
<li><a title="Jump to Section" href="#head6">Creating the Navigation Form</a></li>
<li><a title="Jump to Section" href="#head7">Adding The Combo Boxes</a></li>
<li><a title="Jump to Section" href="#head8">Wiring the Combo Boxes</a></li>
</ol>
<p><span id="more-149"></span></p>
<h3 id="head2" class="head3">Create New Application</h3>
<p>Alright, let&#8217;s get started by creating a new Application <strong>Fusion Web Application (ADF)</strong>. I&#8217;ll call the application name <strong>DependentCombos</strong>, and my application package prefix will be <strong>org.k.tutorials</strong>.</p>
<p><img id="img1" src="http://www.itnewb.com/articles/54-3f62c3181c7856712.jpg" alt="Figure 1" /></p>
<p>I&#8217;ll leave the rest of the options and settings at their defaults and hit <strong>Finish</strong> on the next step. You can adjust the options and settings if you want to, you are totally allowed to (I can&#8217;t prevent you from doing it, do it, do it man <img src='http://blog.amr-gawish.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> ).</p>
<h3 id="head3" class="head3">Setup Database Connection</h3>
<p>Now let&#8217;s setup a connection to a database so we are able to create some Entities and View objects. For the purpose of this tutorial I used the famous HR Schema that exists in any Oracle Database.</p>
<p>To setup the connection to my database server I need to go to the <strong>Application Resources</strong> pane/panel on the left side (the Application Navigation area). It should be under the Projects panel. If it&#8217;s not there, go to View -&gt; Application Navigation and the panels should appear on the left.</p>
<p>Inside the Application Resources panel right click on Connections and then select New Connection -&gt; Database. Fill in the details, test the connection and you&#8217;re good to go.</p>
<p><img id="img2" src="http://www.itnewb.com/articles/54-8ffa36ca6daef06c6.jpg" alt="Figure 2" /></p>
<h3 id="head4" class="head3">Working with the Model</h3>
<p>In the Projects panel on the left, right click on Model and click New. In the New Gallery screen that appears go to Business Tier -&gt; ADF Business Components and then select Business Components from Tables on the right side and click OK. Now in the Initialize Business Components screen that appears after clicking OK, choose the connection we created above, leaving everything else to the defaults and hitting Next.</p>
<p>In step 1 (Entity Objects) enter <strong>org.k.tutorials.model.entities</strong> as the package name. Now click the Query button to populate the list of available tables and then let&#8217;s select <strong>Locations</strong>, <strong>Regions</strong> and <strong>Countries</strong> as the entities to use. Once you&#8217;ve selected/moved them over, rename each of the entities so their names are singular. In other words, change the &#8220;Entity Names&#8221; to Location, Region and Country. Click Next to proceed to step 2.</p>
<p><img id="img3" src="http://www.itnewb.com/articles/54-988f426edaf7ab099.jpg" alt="Figure 3" /></p>
<p>Now in step 2 (Updatable View Objects) enter <strong>org.k.tutorials.model.views</strong> as the package name. Next, select only Location, give it an Object Name of Locations and click Next to continue.</p>
<p><img id="img4" src="http://www.itnewb.com/articles/54-26255bb0d04638691.jpg" alt="Figure 4" /></p>
<p>In step 3 (Read-Only View Object) enter <strong>org.k.tutorials.model.roviews</strong> as the package name. Next click the Query button and then select only Regions and Countries and rename them to be <strong>Regions</strong>, <strong>Countries</strong> instead of <em>RegionsView</em>, <em>CountriesView</em>. Click Next.</p>
<p><img id="img5" src="http://www.itnewb.com/articles/54-aff3164889c972ffd.jpg" alt="Figure 5" /></p>
<p>Finally in step 4 (Application Module) enter <strong>org.k.tutorials.model</strong> as the package name. I like to put this in the root of the structure with the name <em>HrAppModule</em>. So that’s it for now, in the model, click Finish and let&#8217;s start working in the ViewController.</p>
<h3 id="head5" class="head3">Creating the View / JSF Page</h3>
<p>Now we&#8217;re going to create the view in a similar fashion as we created the model. In the Projects panel, right click on ViewController and then click New. In the New Gallery screen that appears go to Web Tier -&gt; JSF and then select JSF Page on the right side and click OK.</p>
<p>In the Create JSF Page screen that appears, enter <strong>MyPage.jspx</strong> as the file name, ensure Create as XML Document is checked and lets choose a template of your choice from the Quick Start layout (I personally use the one column with fixed header and scrollable auto body) and then click OK.</p>
<p><img id="img6" src="http://www.itnewb.com/articles/54-24b8095619e5c53f6.jpg" alt="Figure 6" /></p>
<h3 id="head6" class="head3">Creating the Navigation Form</h3>
<p>In the Application Navigation structure on the left, expand the Data Controls panel and then expand <strong>HrAppModuleDataControl</strong> inside of it. Now ensure the <strong>MyPage.jspx</strong> Structure panel is open (it should be below the Data Controls panel). If it&#8217;s not, go to View -&gt; Structure.</p>
<p>Once HrAppModuleDataControl is expanded in the Data Controls panel and the MyPage.jspx Structure panel is open, we need to drag <strong>Locations1</strong> in Data Controls to f:view -&gt; af:document -&gt; af:form -&gt; af:panelStretchLayout -&gt; Panel Stretch Layout facets -&gt; center in the Structure panel. You can also simply drag and drop Locations1 into the center working area column of JDeveloper when the MyPage.jspx tab is selected and in Design view &#8212; it&#8217;s the tab to the right of the DependentCombos Overview tab.</p>
<p>Whichever way you choose to perform the drag and drop a menu will appear and you should select <strong>Form -&gt; ADF Form</strong> as shown below.</p>
<p><img id="img7" src="http://www.itnewb.com/articles/54-d2493dd872b0c9080.jpg" alt="Figure 7" /></p>
<p>Next an Edit Form Fields dialog will appear. Let&#8217;s include navigation controls by checking it and then click OK.</p>
<p><img id="img8" src="http://www.itnewb.com/articles/54-93855d134b318ef2e.jpg" alt="Figure 8" /></p>
<h3 id="head7" class="head3">Adding The Combo Boxes</h3>
<p>Alright, lets get to business. Now we will drag and drop Regions1 (the first combo box) from Data Controls into the <strong>af:panelFormLayout</strong> that we just created above. When the menu prompts select <strong>Single Selection -&gt; ADF Select One Choice</strong>.</p>
<p><img id="img9" src="http://www.itnewb.com/articles/54-a6610a4be9abb3417.jpg" alt="Figure 9" /></p>
<p>Now in the Edit List Bindings dialog that appears we will set the Display Attribute (column) to be simply RegionName and then click OK.</p>
<p><img id="img10" src="http://www.itnewb.com/articles/54-cf663b2e6199b0404.jpg" alt="Figure 10" /></p>
<p>Next we will add the Country Combo box, but we&#8217;ll do it in a slightly different fashion than the Regions Combo box. What we&#8217;ll do this time is drag and drop CountryId from inside of Locations1 to the same location in the Structure that you did the drag and drop with Regions1.</p>
<p>In other words, drag and drop HrAppModuleDataControl -&gt; Locations1 -&gt; CountryId in the Data Controls panel to center -&gt; af:panelFormLayout in the Structure panel and when the menu prompts select <strong>singleSelection -&gt; ADF Select one choice</strong>.</p>
<p>Now in the Edit List Bindings screen that appears click the Add button to the right of the &#8220;List Data Sources&#8221; menu. In the Add Data Source dialog that appears expand Regions1 and select Countries2 as the data source and click OK.</p>
<p>Next for the data mapping, let&#8217;s set the Data Value as <strong>CountryId</strong> and List Attribute as <strong>CountryId</strong> as well (this should already be populated). Down below under List Items set the Display Attribute to <strong>CountryName</strong>.</p>
<p>Doing so will effect like the following:</p>
<p>1- Make <strong>countryId</strong> in <strong>Locations1</strong> Iterator take its value from <strong>CountryId</strong> of <strong>Countries2</strong> Iterator</p>
<p>2- Make the visible combo box to user is the value of column <strong>CountryName</strong> from <strong>Countries2</strong> iterator</p>
<p>3- After selecting one of Countries that will effect the changes to get The <strong>CountryId</strong> of the selected <strong>CountryName</strong> to bind it to <strong>CountryId</strong> of the <strong>Locations1</strong> iterator</p>
<p>Also note, choosing <strong>Countries2</strong> from under <strong>Region1</strong> iterator means that <strong>Countries2</strong> is a detail table for a master <strong>Region1</strong>, that way when <strong>Region</strong> combo Box is selected, the <strong>regionID</strong> is automatically appended in the Where Statement of <strong>Countries2</strong> iterator SQL Query, and that way the <strong>Countries2</strong> Iterator is filter depending on <strong>Region1</strong> Combo Box value<br />
<img id="img11" src="http://www.itnewb.com/articles/54-16b9760fdb1be7ac0.jpg" alt="Figure 11" /></p>
<h3 id="head8" class="head3">Wiring the Combo Boxes</h3>
<p>Okay so now we need to make the Combo boxes depend on each other. To do this we need to edit the source of MyPage.jspx, and we can do that by going to the MyPage.jspx tab in the center working area of JDveloper and then selecting Source down at the bottom.</p>
<p>In the source, scroll down to where our two af:selectOneChoice elements are located (the combo boxes). In the first combo box (Regions1 with id=&#8221;soc1&#8243;) add the attribute <tt>autoSubmit="true"</tt>. Now in the second combo box (CountryId1 with id=&#8221;soc2&#8243;) add the attribute <tt>partialTriggers="::soc1"</tt>.</p>
<p>We add &#8220;::&#8221; before the component ID in the partialTriggers attribute value so that an AJAX call occurs when the value of the Region combo box changes. When this happens, the Country combo box values are automatically updated according to the Region selected.</p>
<p><img id="img12" src="http://www.itnewb.com/articles/54-b7ab54b23b4e78bc1.jpg" alt="Figure 12" /></p>
<p>Here is what the source should look like when you finish modifying it.</p>
<p><img id="img13" src="http://www.itnewb.com/articles/54-cee842db0bf77c41b.jpg" alt="Figure 13" /></p>
<p>Now let&#8217;s add a commit button to our form. To do this, drag and drop HrAppModuleDataControl -&gt; Operations -&gt; Commit in the Data Control panel to af:panelStrechLayout -&gt; f:facet center -&gt; af:panelFormLayout -&gt; f:facet footer -&gt; af:panelGroupLayout horizontal. When the menu prompts, select ADF Button.</p>
<p>Now go to the source code and remove the disabled attribute from the commit button you just added (af:commandButton / Commit). These are disabled by default for security purposes.</p>
<p>Alright, at this point everything we have is just a show, there isn&#8217;t any real database activity occurring. The combo boxes should be populated with data and so we can test our dependent combo&#8217;s as a proof of concept.</p>
<p>This article is published in ITNewb, view it on this <a href="http://www.itnewb.com/v/Create-a-Chain-of-Dependent-Combo-Boxes-Using-Oracle-ADF">link</a>, check it its great.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amr-gawish.com/149/dependent-combo-boxes-using-oracle-adf/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>At Riyadh in a webcenter Project</title>
		<link>http://blog.amr-gawish.com/147/at-riyadh-in-a-webcenter-project/</link>
		<comments>http://blog.amr-gawish.com/147/at-riyadh-in-a-webcenter-project/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 00:17:55 +0000</pubDate>
		<dc:creator>agawish</dc:creator>
				<category><![CDATA[ADF]]></category>
		<category><![CDATA[Webcenter]]></category>
		<category><![CDATA[agawish]]></category>
		<category><![CDATA[Amr Gawish]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[portlets]]></category>

		<guid isPermaLink="false">http://blog.amr-gawish.com/?p=147</guid>
		<description><![CDATA[It&#8217;s sure nice to be back to writing in kBlog. I&#8217;ve been away for really really really long time, but I&#8217;m sure missing it, and I wont be letting that slip away again. Unfortunately I&#8217;m still busy in a new project in &#8230; <a href="http://blog.amr-gawish.com/147/at-riyadh-in-a-webcenter-project/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s sure nice to be back to writing in kBlog.</p>
<p>I&#8217;ve been away for really really really long time, but I&#8217;m sure missing it, and I wont be letting that slip away again.</p>
<p>Unfortunately I&#8217;m still busy in a new project in KSA Riyadh, Webcenter and ADF dealing with &#8220;المراسم الملكية&#8221;, It&#8217;ll be the first real project for me using webcenter, and I&#8217;m talking about webcenter 11g in here.</p>
<p>But I&#8217;ll try to be Here more, and I&#8217;ll do keep update of this blog alive.</p>
<p>I&#8217;m scheduling to post 2 articles in <a href=" http://www.itnewb.com/" target="_blank">itnewb</a> in the next couple of days, and I&#8217;ll share it in here as well.</p>
<p>Hope you are all glad for me to be back <img src='http://blog.amr-gawish.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amr-gawish.com/147/at-riyadh-in-a-webcenter-project/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>7 Tips for Better JDeveloper Experience</title>
		<link>http://blog.amr-gawish.com/143/7-tips-for-better-jdeveloper-experience/</link>
		<comments>http://blog.amr-gawish.com/143/7-tips-for-better-jdeveloper-experience/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 23:42:16 +0000</pubDate>
		<dc:creator>agawish</dc:creator>
				<category><![CDATA[ADF]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[K]]></category>
		<category><![CDATA[agawish]]></category>
		<category><![CDATA[Amr Gawish]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://blog.amr-gawish.com/?p=143</guid>
		<description><![CDATA[7 Tips For Better JDeveloper Experience View more documents from shay.shmeltzer.]]></description>
			<content:encoded><![CDATA[<div id="__ss_1645175" style="width: 425px; text-align: left;"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" title="7 Tips For Better JDeveloper Experience" href="http://www.slideshare.net/shay.shmeltzer/7-tips-for-better-jdeveloper-experience">7 Tips For Better JDeveloper Experience</a><object width="425" height="355" data="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=odtug-7tips-090626112445-phpapp02&amp;rel=0&amp;stripped_title=7-tips-for-better-jdeveloper-experience" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=odtug-7tips-090626112445-phpapp02&amp;rel=0&amp;stripped_title=7-tips-for-better-jdeveloper-experience" /><param name="allowfullscreen" value="true" /></object></p>
<div style="font-size: 11px; font-family: tahoma,arial; height: 26px; padding-top: 2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">documents</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/shay.shmeltzer">shay.shmeltzer</a>.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.amr-gawish.com/143/7-tips-for-better-jdeveloper-experience/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to configure Microsoft SQL Server 2005 to work with ADF</title>
		<link>http://blog.amr-gawish.com/85/mssql-jdeveloper-adf/</link>
		<comments>http://blog.amr-gawish.com/85/mssql-jdeveloper-adf/#comments</comments>
		<pubDate>Tue, 12 May 2009 12:03:39 +0000</pubDate>
		<dc:creator>agawish</dc:creator>
				<category><![CDATA[ADF]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[agawish]]></category>
		<category><![CDATA[Amr Gawish]]></category>
		<category><![CDATA[JDBC]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[JSP]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[SQL Server 2005]]></category>

		<guid isPermaLink="false">http://blog.amr-gawish.com/?p=85</guid>
		<description><![CDATA[I&#8217;ve been asked if it&#8217;s possible to integrate MS SQL Server 2005 with JDeveloper, and I just answered without hesitating &#8220;Yes sure&#8221;, but as i was knowing Microsoft SQL for long, I know there are issues in it. Especially it&#8217;s &#8230; <a href="http://blog.amr-gawish.com/85/mssql-jdeveloper-adf/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been asked if it&#8217;s possible to integrate MS SQL Server 2005 with JDeveloper, and I just answered without hesitating &#8220;Yes sure&#8221;, but as i was knowing Microsoft SQL for long, I know there are issues in it.</p>
<p>Especially it&#8217;s modes of authentication, so I&#8217;ll only help who has Mixed mode authentication and can access using username and password, for windows authentication that would be another article<span id="more-85"></span></p>
<p>At first you have to <strong><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=99b21b65-e98f-4a61-b811-19912601fdc9&amp;displaylang=en" target="_blank">download</a> Microsoft SQL Server 2005 JDBC driver</strong> to work with Microsoft SQL Server 2005 in JDeveloper &#8211; you can use ODBC Bridge but i don&#8217;t recommend it-.</p>
<p>After downloading the eula, and accepting it the installation will start and an exe file will be installed, double clicking on the exe file will extract its content /Microsoft SQL Server JDBC Driver 2.0\sqljdbc_2.0\enu you will find two .jar files, basiclly we are talking about sqljdbc.jar so just move it to something like C:\MSQQL and for short i&#8217;ll call it &lt;mssql_jdbc_location&gt;.</p>
<p style="text-align: left;">Now open the JDeveloper and follow the steps to<strong> create the connection</strong> from this steps:</p>
<p style="text-align: left;">1- Select Tools&gt;Default Project Properties. In the Default Project Properties dialog select the Libraries node and click the Add Library button<br />
<a href="http://blog.amr-gawish.com/wp-content/uploads/2009/05/add-library.jpg" target="_blank"><img class="size-thumbnail wp-image-86" title="add-library" src="http://blog.amr-gawish.com/wp-content/uploads/2009/05/add-library-150x150.jpg" alt="add-library" width="150" height="150" /></a></p>
<p style="text-align: left;">2- In the Add Library dialog, select the User node, and click on the New button</p>
<p style="text-align: left;">3- In the Create Library dialog specify a Library Name, such as &#8220;SQLServer2005&#8243; Select the Class Path node and click the Add Entry button and navigate till you find sqljdbc.jar in &lt;mssql_jdbc_location&gt;   and click OK. Click OK several more times until you’ve exited the Libraries dialog .</p>
<p style="text-align: left;">4- Next, configure a JDBC connection with the SQL Server database . In the Connections Navigator -If you dont see Connections Navigator Select view from the toolbar &gt; connection navigator- and then right-click on the Database node and select New Database Connection to start the Create Database Connection wizard.</p>
<p style="text-align: left;">5- Call the connection name : &#8220;<em><strong>MSConnection</strong></em>&#8221; In the Type dialog specify a Connection Name and select &#8216;Third Party JDBC Driver&#8217; in the Connection Type field. Click on the Next button.</p>
<p style="text-align: left;">6- In the Authentication dialog specify &#8220;sa&#8221; as the Username and the Password as the password used to install the SQL Server database -you have, windows authentication wont be working-</p>
<p style="text-align: left;">7- In the Connection dialog, locate the Driver Class field and specify the driver class, &#8220;com.microsoft.sqlserver.jdbc.SQLServerDriver&#8221;. Click on New to add a driver class. In the Register JDBC Driver dialog, specify driver class in Driver Class field. In the Library field select the SQLServer2005 library that you configured in the last section. Click OK to add it.<br />
<img src="http://assets.devx.com/articlefigs/18254.jpg" alt="" /></p>
<p style="text-align: left;">8- In the URL field specify the connection URL as shown in like this &#8220;jdbc:sqlserver://&lt;host_server&gt;:&lt;host_port&gt;;databaseName=&lt;database_name&gt;&#8221;</p>
<p style="text-align: left;"><a href="http://blog.amr-gawish.com/wp-content/uploads/2009/05/connection_url.jpg" target="_blank"><img class="size-thumbnail wp-image-87" title="connection_url" src="http://blog.amr-gawish.com/wp-content/uploads/2009/05/connection_url-150x150.jpg" alt="connection_url" width="150" height="150" /></a></p>
<p style="text-align: left;">9- Now you can test the connection using the Test Connection button.If you&#8217;ve done everything correctly, a JDBC connection is established with the database. Click on the Finish button.</p>
<p style="text-align: left;">
<p style="text-align: left;">Now that we created the connection, lets start <strong>creating our ADF Application</strong></p>
<p style="text-align: left;">1- Now click on applications navigator -that is besides connection navigator- and right click on applications-&gt;New Application</p>
<p style="text-align: left;">2- Let&#8217;s call the application name: <strong>MSProject </strong>and choose the directory Name that you wish to save the project in and, choose application template : <strong>Web Applications [JSF,  ADF BC]</strong> and click &#8220;ok&#8221;</p>
<p style="text-align: left;">3- Now there should appear two projects under the application &#8220;<strong>Model</strong>&#8221; and &#8220;<strong>ViewController</strong>&#8220;, go to &#8220;Model&#8221; project-&gt;right click and select &#8220;New&#8221;</p>
<p style="text-align: left;">4- Expand &#8220;Business Tier&#8221; node, and select &#8220;ADF Business Components&#8221; node<br />
5- Choose &#8220;Business Components from Tables&#8221; item from the right side and click &#8220;Ok&#8221;</p>
<p style="text-align: left;"><a href="http://blog.amr-gawish.com/wp-content/uploads/2009/05/choose-business-components.jpg" target="_blank"><img class="alignnone size-medium wp-image-89" title="choose-business-components" src="http://blog.amr-gawish.com/wp-content/uploads/2009/05/choose-business-components-300x214.jpg" alt="choose-business-components" width="300" height="214" /></a></p>
<p style="text-align: left;">6- After clikcing &#8220;ok&#8221; a new screen appear &#8220;Initialize Business Component Project&#8221; for you to select a connection, so select a connection &#8220;MSConnection&#8221; from the list and click &#8220;Ok&#8221;<br />
<a href="http://blog.amr-gawish.com/wp-content/uploads/2009/05/chooseconnection.jpg" target="_blank"><img class="size-thumbnail wp-image-90" title="chooseconnection" src="http://blog.amr-gawish.com/wp-content/uploads/2009/05/chooseconnection-150x150.jpg" alt="chooseconnection" width="150" height="150" /></a></p>
<p style="text-align: left;">7- It may ask you for the password, just press &#8220;ok&#8221; and go throw the welcome screen of  &#8220;Create busines components from tables&#8221; so just press &#8220;Next&#8221;</p>
<p style="text-align: left;">8- Now choose the entities that you want to select from the database tables and view -If table doesnt appear in teh left bottom, just check the button &#8220;Auto-Query&#8221; and rename whatever you want, and rename the package name as you want and click next to go to view Objects for me I made the package ends with entity<br />
<a href="http://blog.amr-gawish.com/wp-content/uploads/2009/05/entity.jpg" target="_blank"><img class="alignnone size-thumbnail wp-image-91" title="entity" src="http://blog.amr-gawish.com/wp-content/uploads/2009/05/entity-150x150.jpg" alt="entity" width="150" height="150" /></a></p>
<p style="text-align: left;">9- After that select all and shatter that to the right list and change the package name for whatever you want, for me i made the package ends with .views<br />
<a href="http://blog.amr-gawish.com/wp-content/uploads/2009/05/viewobject.jpg" target="_blank"><img class="alignnone size-thumbnail wp-image-92" title="viewobject" src="http://blog.amr-gawish.com/wp-content/uploads/2009/05/viewobject-150x150.jpg" alt="viewobject" width="150" height="150" /></a></p>
<p>10- After that i&#8217;ll press next as i don&#8217;t need any read-only view objects</p>
<p style="text-align: left;">11- After that check on application module and change the name, for me I called it ActivityModule and changesd the package to end with .model without any further things<br />
<a href="http://blog.amr-gawish.com/wp-content/uploads/2009/05/appmodule.jpg" target="_blank"><img class="alignnone size-thumbnail wp-image-93" title="appmodule" src="http://blog.amr-gawish.com/wp-content/uploads/2009/05/appmodule-150x150.jpg" alt="appmodule" width="150" height="150" /></a></p>
<p style="text-align: left;">12- After that the diagrammer screen comes, so go through that without doing anything and press next.</p>
<p style="text-align: left;">13- And finally the summary for all what you have done, it should look similar to something like the following, just click finish, to finish creating<br />
<a href="http://blog.amr-gawish.com/wp-content/uploads/2009/05/summary.jpg" target="_blank"><img class="alignnone size-thumbnail wp-image-94" title="summary" src="http://blog.amr-gawish.com/wp-content/uploads/2009/05/summary-150x150.jpg" alt="summary" width="150" height="150" /></a></p>
<p style="text-align: left;">14- Optionally make sure everything is working by testing your application module, right click on your application module in my case its &#8220;ActivityModule&#8221; and click Test to test that the functionality is working well.</p>
<p style="text-align: left;">15- <strong><span style="color: #800000;">important!</span></strong> Now for microsoft JDBC to work effectiantly and make the JDBC running well on the JSP you have to add the JDBC library to the OC4J Libraries by clicking tools&gt;Embedded OC4J Server Preferences and select the Libraries node under the Global node and click add in the top right and navigate to  &lt;mssql_jdbc_location&gt; and select that .jar file and click &#8220;Ok&#8221;</p>
<p style="text-align: left;">16- <strong><span style="color: #800000;">important! </span></strong>Now right click on the application module-&gt;&#8221;Configurations&#8230;&#8221;</p>
<p style="text-align: left;">17- <strong><span style="color: #800000;">important! </span></strong>Select &#8220;&lt;application_module_name&gt;Local&#8221; from the left node and click &#8220;edit&#8221;</p>
<p style="text-align: left;">18- <strong><span style="color: #800000;">important! </span></strong>In the application module tab, in the &#8220;connection type&#8221; section change the connection type from JDBC URL to JDBC Datasource and in the Database name write down &#8220;jdbc/MSConnectionDS&#8221; or basiclly &#8220;jdbc/&lt;your_connection_Name&gt;DS&#8221; and click &#8220;Ok&#8221;<br />
<a href="http://blog.amr-gawish.com/wp-content/uploads/2009/05/jdbcdatasource.jpg" target="_blank"><img class="alignnone size-thumbnail wp-image-95" title="jdbcdatasource" src="http://blog.amr-gawish.com/wp-content/uploads/2009/05/jdbcdatasource-150x150.jpg" alt="jdbcdatasource" width="150" height="150" /></a></p>
<p style="text-align: left;">19- Now we are finished with the Model project, we will go for the view controller to create our JSPs</p>
<p style="text-align: left;">20- Right click on &#8220;ViewController&#8221; project and click on &#8220;New&#8221;, under the &#8220;Web Tier&#8221; node, select &#8220;JSF&#8221; and in the right node select &#8220;JSF JSP&#8221;</p>
<p style="text-align: left;">21- Go through the screens with next and whatever you want, my page was named &#8220;index.jspx&#8221; and it has no managed-bean within it</p>
<p style="text-align: left;">22- <strong><span style="color: #800000;">important!</span></strong> From the &#8220;Data Control Palette&#8221; under the application module, select whatever view object you like and drag it as a Tables-&gt;ADF read-only table</p>
<p style="text-align: left;">23- Right click and run, and enjoy your Microsoft SQL Server database connection with the power of  ADF Framework <img src='http://blog.amr-gawish.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amr-gawish.com/85/mssql-jdeveloper-adf/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

