<?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; Java</title>
	<atom:link href="http://blog.amr-gawish.com/tag/java/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>Creating Utilities to manipulate users in #Weblogic using #JMX and #MBeans</title>
		<link>http://blog.amr-gawish.com/7836/creating-utilities-to-manipulate-users-in-weblogic-using-jmx-and-mbeans/</link>
		<comments>http://blog.amr-gawish.com/7836/creating-utilities-to-manipulate-users-in-weblogic-using-jmx-and-mbeans/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 18:46:32 +0000</pubDate>
		<dc:creator>agawish</dc:creator>
				<category><![CDATA[JMX]]></category>
		<category><![CDATA[Weblogic]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jmx]]></category>
		<category><![CDATA[weblogic]]></category>

		<guid isPermaLink="false">http://blog.amr-gawish.com/?p=7836</guid>
		<description><![CDATA[This is a cross post from mdlwr Intro First I&#8217;d like to apologies for the big absent on my side as I was very busy traveling to KSA for a new freelancing Client, but anyway I hope this article make &#8230; <a href="http://blog.amr-gawish.com/7836/creating-utilities-to-manipulate-users-in-weblogic-using-jmx-and-mbeans/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is a cross post from <a href="http://mdlwr.amr-gawish.com" title="mdlwr">mdlwr</a></p>
<h3>Intro</h3>
<p>First I&#8217;d like to apologies for the big absent on my side as I was very busy traveling to KSA for a new freelancing Client, but anyway I hope this article make you forgive me <img src='http://blog.amr-gawish.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Weblogic is a great Application Server, and the one you can count on for your heavy industrial deployment, load balancing, high availability and clustering.</p>
<p>Not only that but it comes with a great scripting tool <strong>WLST</strong> and the standardization of accessing its MBeans through JMX</p>
<p>There were an old school approach which would allow you to access MBeans through Weblogic APIs itself like so</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">weblogic.management.Helper</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">weblogic.management.MBeanHome</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> UseHelper <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">String</span> url <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;t3://localhost:7001&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">String</span> username <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;weblogic&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">String</span> password <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;weblogic&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">String</span> msName <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;MS1&quot;</span><span style="color: #339933;">;</span>
        MBeanHome localHome <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            localHome <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>MBeanHome<span style="color: #009900;">&#41;</span>Helper.<span style="color: #006633;">getMBeanHome</span><span style="color: #009900;">&#40;</span>username, password, url,
                       msName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Local MBeanHome for&quot;</span> <span style="color: #339933;">+</span> localHome <span style="color: #339933;">+</span>
                       <span style="color: #0000ff;">&quot; found using the Helper class&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">IllegalArgumentException</span> iae<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Illegal Argument Exception: &quot;</span> <span style="color: #339933;">+</span> iae<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>But as you write this in your JDeveloper or favorite Editor, you will realize that this has been deprecated!</p>
<p>So the better alternative, and the hard way around it is to use JMX</p>
<h3>The Definition</h3>
<p>JMX(Java Management Extension) is a technology that represents a universal, open technology for management, and monitoring applications, system objects, devices (e. g. printers) and service oriented networks. Those resources are represented by objects called MBeans (for Managed Beans)</p>
<p>So Enough with the definitions, lets get to work.</p>
<h3>The Utility Class</h3>
<p>What we want here is accessing Weblogic MBeans to get Users for DefaultAuthenticator -Default authenticator on Weblogic and Get Users, Groups and doing some manipulation like adding, editing, deleting and reset password for users in Weblogic Default Authenticator -You can edit it to suit your need but remember if the authenticator is read only you will get exceptions trying to alter users.</p>
<p>So lets get Started, first by checking <a title="Weblogic MBeans Server" href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/core/index.html" target="_blank">MBeans Reference</a> We will realize that in Order to access the Users we have to go this path:</p>
<ul>
<li>Configuration MBeans
<ul>
<li>Domain Configuration MBeans
<ul>
<li>Security Configuration MBean
<ul>
<li>Default Realm <em>(Attribute of Security Configuration MBean and an instance of RealmMBean)</em>
<ul>
<li>AuthenticationProviders <em>(Attribute of Default Realm and an instance of AuthenticationProviderMBean[])</em></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>So How do we do that, let&#8217;s start write some code</p>
<h3>The Initialization Code</h3>
<p>We will start my making a connection to Weblogic Server instance, and then drill down to AuthenticationProviderMBean(s)<br />
Remember this is a utilities Class, that&#8217;s why all of my methods will be static</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/****** DEFINING SOME STATIC VARIABLES ********/</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> JNDI_FACTORY <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;weblogic.jndi.WLInitialContextFactory&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> MBEAN_SERVER <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;weblogic.management.mbeanservers.domainruntime&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> JNDI_ROOT <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;/jndi/&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> DEFAULT_PROTOCOL <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;t3&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> PROTOCOL_PROVIDER_PACKAGES <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;weblogic.management.remote&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//This how we get our DomainRuntimeService, this is where DomainConfigurationMBeans exists</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> DOMAIN_MBEAN_NAME <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;com.bea:Name=DomainRuntimeService,Type=weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> MBeanServerConnection connection<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> ObjectName defaultAuthenticator<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> ObjectName<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> authenticationProviders<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">String</span> authenticatorName<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;DefaultAuthenticator&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Okay, now we defined it, let&#8217;s drill down to our AuthenticationProviders</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">static</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003399;">String</span> host <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;127.0.0.1&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #003399;">String</span> port <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;7101&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #003399;">String</span> username <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;weblogic&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #003399;">String</span> password <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;weblogic1&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #003399;">Hashtable</span> h <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Hashtable</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            JMXServiceURL serviceURL<span style="color: #339933;">;</span>
&nbsp;
            serviceURL <span style="color: #339933;">=</span>
                    <span style="color: #000000; font-weight: bold;">new</span> JMXServiceURL<span style="color: #009900;">&#40;</span>DEFAULT_PROTOCOL, host, <span style="color: #003399;">Integer</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span>port<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">intValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>,
                                      <span style="color: #0000ff;">&quot;/jndi/weblogic.management.mbeanservers.domainruntime&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            h.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;java.naming.security.principal&quot;</span>, username<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            h.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;java.naming.security.credentials&quot;</span>, password<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            h.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;jmx.remote.protocol.provider.pkgs&quot;</span>,
                  <span style="color: #0000ff;">&quot;weblogic.management.remote&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">//Creating a JMXConnector to connect to JMX</span>
            JMXConnector connector <span style="color: #339933;">=</span>
                JMXConnectorFactory.<span style="color: #006633;">connect</span><span style="color: #009900;">&#40;</span>serviceURL, h<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            connection <span style="color: #339933;">=</span> connector.<span style="color: #006633;">getMBeanServerConnection</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">/****
              We Get Objects by creating ObjectName with it's Qualified name.
              The constructor take a String of the full Qualified name of the MBean
              We then use connection to get Attribute out of this ObjectName but specifying a String of
              this Attribute
              *****/</span>
&nbsp;
            ObjectName configurationMBeans<span style="color: #339933;">=</span>
                <span style="color: #000000; font-weight: bold;">new</span> ObjectName<span style="color: #009900;">&#40;</span>DOMAIN_MBEAN_NAME<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            ObjectName domain <span style="color: #339933;">=</span>
                <span style="color: #009900;">&#40;</span>ObjectName<span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">getAttribute</span><span style="color: #009900;">&#40;</span>configurationMBeans, <span style="color: #0000ff;">&quot;DomainConfiguration&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            ObjectName security <span style="color: #339933;">=</span>
                <span style="color: #009900;">&#40;</span>ObjectName<span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">getAttribute</span><span style="color: #009900;">&#40;</span>domain, <span style="color: #0000ff;">&quot;SecurityConfiguration&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            ObjectName realm <span style="color: #339933;">=</span>
                <span style="color: #009900;">&#40;</span>ObjectName<span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">getAttribute</span><span style="color: #009900;">&#40;</span>security, <span style="color: #0000ff;">&quot;DefaultRealm&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            authenticationProviders <span style="color: #339933;">=</span>
                    <span style="color: #009900;">&#40;</span>ObjectName<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">getAttribute</span><span style="color: #009900;">&#40;</span>realm,
                                                          <span style="color: #0000ff;">&quot;AuthenticationProviders&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> authenticationProviders.<span style="color: #006633;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #003399;">String</span> name <span style="color: #339933;">=</span>
                    <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">getAttribute</span><span style="color: #009900;">&#40;</span>authenticationProviders<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>,
                                                    <span style="color: #0000ff;">&quot;Name&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>name.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>authenticatorName<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                    defaultAuthenticator <span style="color: #339933;">=</span> authenticationProviders<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">RuntimeException</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p>WOHOO you&#8217;ve done a great step, you now have a reference to the defaultAuthenticator MBean, now you can make operations on users and Groups</p>
<h3>Deep inside DefaultAuthenticatorMBean</h3>
<p>If you looked at the reference of DefaultAuthenticatorMBean which is a subclass of AuthenticationProviderMBean you will realize the following:</p>
<p><strong>Attributes</strong></p>
<ul>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#ControlFlag">ControlFlag</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#Description">Description</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#EnableGroupMembershipLookupHierarchyCaching">EnableGroupMembershipLookupHierarchyCaching</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#GroupHierarchyCacheTTL">GroupHierarchyCacheTTL</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#GroupMembershipSearching">GroupMembershipSearching</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#KeepAliveEnabled">KeepAliveEnabled</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#MaxGroupHierarchiesInCache">MaxGroupHierarchiesInCache</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#MaxGroupMembershipSearchLevel">MaxGroupMembershipSearchLevel</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#MinimumPasswordLength">MinimumPasswordLength</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#Name">Name</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#PasswordDigestEnabled">PasswordDigestEnabled</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#PropagateCauseForLoginException">PropagateCauseForLoginException</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#ProviderClassName">ProviderClassName</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#SupportedExportConstraints">SupportedExportConstraints</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#SupportedExportFormats">SupportedExportFormats</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#SupportedImportConstraints">SupportedImportConstraints</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#SupportedImportFormats">SupportedImportFormats</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#UseRetrievedUserNameAsPrincipal">UseRetrievedUserNameAsPrincipal</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#Version">Version</a></li>
</ul>
<p><strong>Operations</strong></p>
<ul>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#addMemberToGroup">addMemberToGroup</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#advance">advance</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#changeUserPassword">changeUserPassword</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#close">close</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#createGroup">createGroup</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#createUser">createUser</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#exportData">exportData</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#getCurrentName">getCurrentName</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#getGroupDescription">getGroupDescription</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#getUserDescription">getUserDescription</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#groupExists">groupExists</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#haveCurrent">haveCurrent</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#importData">importData</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#isMember">isMember</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#isSet">isSet</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#listAllUsersInGroup">listAllUsersInGroup</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#listGroupMembers">listGroupMembers</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#listGroups">listGroups</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#listMemberGroups">listMemberGroups</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#listUsers">listUsers</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#removeGroup">removeGroup</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#removeMemberFromGroup">removeMemberFromGroup</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#removeUser">removeUser</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#resetUserPassword">resetUserPassword</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#setGroupDescription">setGroupDescription</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#setUserDescription">setUserDescription</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#unSet">unSet</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#userExists">userExists</a></li>
<li><a href="http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/mbeans/DefaultAuthenticatorMBean.html?skipReload=true#wls_getDisplayName">wls_getDisplayName</a></li>
</ul>
<div>Now I guess you know what do we need to do right, Excellent so lets get it done</div>
<h3>The User/Group Manipulation</h3>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">boolean</span> addUser<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> username, <span style="color: #003399;">String</span> psw, <span style="color: #003399;">String</span> desc<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #008000; font-style: italic; font-weight: bold;">/** As of connection.getAttribute you can use connection.invoke to invoke an action
                It Takes ObjectName, String OperationName, Object[] Parameters, and String[] Parameters
                Definition
            **/</span>
            connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator, <span style="color: #0000ff;">&quot;createUser&quot;</span>,
                              <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> username, psw, desc <span style="color: #009900;">&#125;</span>,
                              <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span>,
                                             <span style="color: #0000ff;">&quot;java.lang.String&quot;</span>,
                                             <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
            <span style="color: #666666; font-style: italic;">//throw new RuntimeException(e);</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">boolean</span> removeUser<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> username<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>username.<span style="color: #006633;">equalsIgnoreCase</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;weblogic&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator, <span style="color: #0000ff;">&quot;removeUser&quot;</span>,
                                  <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> username <span style="color: #009900;">&#125;</span>,
                                  <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">boolean</span> resetUserPassword<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> username,
                                            <span style="color: #003399;">String</span> newPassword<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>username.<span style="color: #006633;">equalsIgnoreCase</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;weblogic&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator, <span style="color: #0000ff;">&quot;resetUserPassword&quot;</span>,
                                  <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> username, newPassword <span style="color: #009900;">&#125;</span>,
                                  <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span>,
                                                 <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
           <span style="color: #008000; font-style: italic; font-weight: bold;">/** As of connection.getAttribute you can use connection.invoke to invoke an action
                It Takes ObjectName, String OperationName, Object[] Parameters, and String[] Parameters
                Definition, It returns an Object we cast it to Boolean, you can know all about function from 
                MBeans Reference
            **/</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">boolean</span> isUserExists<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> currentUser<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">RuntimeException</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">boolean</span> userExists <span style="color: #339933;">=</span>
                <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Boolean</span><span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator, <span style="color: #0000ff;">&quot;userExists&quot;</span>,
                                            <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> currentUser <span style="color: #009900;">&#125;</span>,
                                            <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">booleanValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">return</span> userExists<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> ex<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">RuntimeException</span><span style="color: #009900;">&#40;</span>ex<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">boolean</span> isGroupExists<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> currentGroup<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">RuntimeException</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">boolean</span> gourpExists <span style="color: #339933;">=</span>
                <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Boolean</span><span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator,
                                            <span style="color: #0000ff;">&quot;groupExists&quot;</span>,
                                            <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> currentGroup <span style="color: #009900;">&#125;</span>,
                                            <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">booleanValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">return</span> gourpExists<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> ex<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">RuntimeException</span><span style="color: #009900;">&#40;</span>ex<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/** This one is tricky, You first obtain a String cursor of the Iterator of Users, then you check if
        It have current, while true we invoke another function called &quot;getCurrentName&quot; which returns the name 
        of the user, then I call advance function for the cursor to move forward, and invoke haveCurrent again
        and assign it to the same boolean I entered the while with (In order to get out of it!)
    **/</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> List<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span> getListOfUsers<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">RuntimeException</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            List<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span> allUsers <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ArrayList<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #003399;">String</span> cursor <span style="color: #339933;">=</span>
                <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator, <span style="color: #0000ff;">&quot;listUsers&quot;</span>,
                                          <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;*&quot;</span>,
                                                         <span style="color: #003399;">Integer</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">9999</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span>,
                                          <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span>,
                                                         <span style="color: #0000ff;">&quot;java.lang.Integer&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000066; font-weight: bold;">boolean</span> haveCurrent <span style="color: #339933;">=</span>
                <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Boolean</span><span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator,
                                            <span style="color: #0000ff;">&quot;haveCurrent&quot;</span>,
                                            <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> cursor <span style="color: #009900;">&#125;</span>,
                                            <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">booleanValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>haveCurrent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #003399;">String</span> currentName <span style="color: #339933;">=</span>
                    <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator,
                                              <span style="color: #0000ff;">&quot;getCurrentName&quot;</span>,
                                              <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> cursor <span style="color: #009900;">&#125;</span>,
                                              <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
                allUsers.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>currentName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator, <span style="color: #0000ff;">&quot;advance&quot;</span>,
                                  <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> cursor <span style="color: #009900;">&#125;</span>,
                                  <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                haveCurrent <span style="color: #339933;">=</span>
                        <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Boolean</span><span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator, <span style="color: #0000ff;">&quot;haveCurrent&quot;</span>,
                                                    <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> cursor <span style="color: #009900;">&#125;</span>,
                                                    <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">booleanValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">return</span> allUsers<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> ex<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">RuntimeException</span><span style="color: #009900;">&#40;</span>ex<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> List<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span> getUserGroups<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> username<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">RuntimeException</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            List<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span> allUserGroups <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ArrayList<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #003399;">String</span> cursor <span style="color: #339933;">=</span>
                <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator, <span style="color: #0000ff;">&quot;listMemberGroups&quot;</span>,
                                          <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> username <span style="color: #009900;">&#125;</span>,
                                          <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000066; font-weight: bold;">boolean</span> haveCurrent <span style="color: #339933;">=</span>
                <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Boolean</span><span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator,
                                            <span style="color: #0000ff;">&quot;haveCurrent&quot;</span>,
                                            <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> cursor <span style="color: #009900;">&#125;</span>,
                                            <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">booleanValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>haveCurrent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #003399;">String</span> currentName <span style="color: #339933;">=</span>
                    <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator,
                                              <span style="color: #0000ff;">&quot;getCurrentName&quot;</span>,
                                              <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> cursor <span style="color: #009900;">&#125;</span>,
                                              <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                allUserGroups.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>currentName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator, <span style="color: #0000ff;">&quot;advance&quot;</span>,
                                  <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> cursor <span style="color: #009900;">&#125;</span>,
                                  <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                haveCurrent <span style="color: #339933;">=</span>
                        <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Boolean</span><span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator, <span style="color: #0000ff;">&quot;haveCurrent&quot;</span>,
                                                    <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> cursor <span style="color: #009900;">&#125;</span>,
                                                    <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">booleanValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">return</span> allUserGroups<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> ex<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">RuntimeException</span><span style="color: #009900;">&#40;</span>ex<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> List<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span> getGroupMembers<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> groupName<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">RuntimeException</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            List<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span> allGroupMembers <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ArrayList<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #003399;">String</span> cursor <span style="color: #339933;">=</span>
                <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator, <span style="color: #0000ff;">&quot;listGroupMembers&quot;</span>,
                                          <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> groupName, <span style="color: #0000ff;">&quot;*&quot;</span>, <span style="color: #000000; font-weight: bold;">new</span> java.<span style="color: #006633;">lang</span>.<span style="color: #003399;">Integer</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span>,
                                          <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span>, <span style="color: #0000ff;">&quot;java.lang.String&quot;</span>, <span style="color: #0000ff;">&quot;java.lang.Integer&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000066; font-weight: bold;">boolean</span> haveCurrent <span style="color: #339933;">=</span>
                <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Boolean</span><span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator,
                                            <span style="color: #0000ff;">&quot;haveCurrent&quot;</span>,
                                            <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> cursor <span style="color: #009900;">&#125;</span>,
                                            <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">booleanValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>haveCurrent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #003399;">String</span> currentName <span style="color: #339933;">=</span>
                    <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator,
                                              <span style="color: #0000ff;">&quot;getCurrentName&quot;</span>,
                                              <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> cursor <span style="color: #009900;">&#125;</span>,
                                              <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                allGroupMembers.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>currentName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator, <span style="color: #0000ff;">&quot;advance&quot;</span>,
                                  <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> cursor <span style="color: #009900;">&#125;</span>,
                                  <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                haveCurrent <span style="color: #339933;">=</span>
                        <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Boolean</span><span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator, <span style="color: #0000ff;">&quot;haveCurrent&quot;</span>,
                                                    <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> cursor <span style="color: #009900;">&#125;</span>,
                                                    <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">booleanValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">return</span> allGroupMembers<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> ex<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">RuntimeException</span><span style="color: #009900;">&#40;</span>ex<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> List<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span> getListOfGroups<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">RuntimeException</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            List<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span> allUsers <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ArrayList<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #003399;">String</span> cursor <span style="color: #339933;">=</span>
                <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator, <span style="color: #0000ff;">&quot;listGroups&quot;</span>,
                                          <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;*&quot;</span>,
                                                         <span style="color: #003399;">Integer</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">9999</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span>,
                                          <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span>,
                                                         <span style="color: #0000ff;">&quot;java.lang.Integer&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000066; font-weight: bold;">boolean</span> haveCurrent <span style="color: #339933;">=</span>
                <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Boolean</span><span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator,
                                            <span style="color: #0000ff;">&quot;haveCurrent&quot;</span>,
                                            <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> cursor <span style="color: #009900;">&#125;</span>,
                                            <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">booleanValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>haveCurrent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #003399;">String</span> currentName <span style="color: #339933;">=</span>
                    <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator,
                                              <span style="color: #0000ff;">&quot;getCurrentName&quot;</span>,
                                              <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> cursor <span style="color: #009900;">&#125;</span>,
                                              <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                allUsers.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>currentName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator, <span style="color: #0000ff;">&quot;advance&quot;</span>,
                                  <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> cursor <span style="color: #009900;">&#125;</span>,
                                  <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                haveCurrent <span style="color: #339933;">=</span>
                        <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Boolean</span><span style="color: #009900;">&#41;</span>connection.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>defaultAuthenticator, <span style="color: #0000ff;">&quot;haveCurrent&quot;</span>,
                                                    <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> cursor <span style="color: #009900;">&#125;</span>,
                                                    <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;java.lang.String&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">booleanValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">return</span> allUsers<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> ex<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">RuntimeException</span><span style="color: #009900;">&#40;</span>ex<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p>And that&#8217;s it, Enjoy your Weblogic Utilities Class <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/7836/creating-utilities-to-manipulate-users-in-weblogic-using-jmx-and-mbeans/feed/</wfw:commentRss>
		<slash:comments>2</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>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>
		<item>
		<title>Flex Experience</title>
		<link>http://blog.amr-gawish.com/83/flex-experience/</link>
		<comments>http://blog.amr-gawish.com/83/flex-experience/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 21:47:46 +0000</pubDate>
		<dc:creator>agawish</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[agawish]]></category>
		<category><![CDATA[Amr Gawish]]></category>

		<guid isPermaLink="false">http://blog.amr-gawish.com/?p=83</guid>
		<description><![CDATA[Right now, I&#8217;m trying the new experience with flex and Java using the easy ActionScript 3 language. I have to say that my understanding to JSF made the whole task of getting mxml really piece of cake, that I started &#8230; <a href="http://blog.amr-gawish.com/83/flex-experience/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter" title="Flex" src="http://onflex.org/images/Fx.png" alt="" width="400" height="400" /></p>
<p>Right now, I&#8217;m trying the new experience with flex and Java using the easy ActionScript 3 language.</p>
<p>I have to say that my understanding to JSF made the whole task of getting mxml really piece of cake, that I started to create an advanced event handler techniques with a glimpse.</p>
<p>I recommend Flex for Developers who seeks the great and neat look.</p>
<p>FLEX ROCKS!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amr-gawish.com/83/flex-experience/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Oracle to buy Sun!</title>
		<link>http://blog.amr-gawish.com/78/oracle-to-buy-sun/</link>
		<comments>http://blog.amr-gawish.com/78/oracle-to-buy-sun/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 13:46:57 +0000</pubDate>
		<dc:creator>agawish</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[K]]></category>
		<category><![CDATA[agawish]]></category>
		<category><![CDATA[Amr Gawish]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sun]]></category>

		<guid isPermaLink="false">http://blog.amr-gawish.com/?p=78</guid>
		<description><![CDATA[As Everyone heared about the new acquisition of oracle, this gonna be a big hit. I believe oracle itself will be the first one who recieve that hit, and it&#8217;ll not recover from it but after a really long time &#8230; <a href="http://blog.amr-gawish.com/78/oracle-to-buy-sun/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter" title="Oracle Sun" src="http://www.techcrunch.com/wp-content/uploads/2009/04/sun-oracle.png" alt="" width="631" height="218" /></p>
<p>As Everyone <a title="Tech Crunch Article" href="http://www.techcrunch.com/2009/04/20/oracle-to-buy-sun-hold-on-to-your-hats" target="_blank">heared </a>about the new acquisition of oracle, this gonna be a big hit.</p>
<p>I believe oracle itself will be the first one who recieve that hit, and it&#8217;ll not recover from it but after a really long time to adapt this acquisition &#8211; and the others- as oracle didnt recover yet from it&#8217;s previous acquisitions!</p>
<p>I see it&#8217;s a better choice than IBM, oracle will provide a better solution for Java and maintain it&#8217;s development.<br />
However I don&#8217;t see why oracle put itself into the hardware and operating systems area as it&#8217;s already had a good deals with HP and Red Hat, but with the new acquisition oracle now targets all company sizes from small ones to Enterprise one, to provide the small ones with mySQL database with GlassFish and for medium to large companies with OracleDB and BEA J2EE Application Server.</p>
<p>Now oracle provide customers with end-to-end solutions providing hardware, operating system, database and Middle tier software.</p>
<p>I dont know however what will they do with netBeans and cloud computing as sun already achieved a good state out there!</p>
<p>Also it&#8217;s other open source projects, I hope that oracle knows what it&#8217;s doing, or else the java world will collapse over our heads!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amr-gawish.com/78/oracle-to-buy-sun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arabic SMS version 1.5</title>
		<link>http://blog.amr-gawish.com/66/arabic-sms-version-15/</link>
		<comments>http://blog.amr-gawish.com/66/arabic-sms-version-15/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 12:30:32 +0000</pubDate>
		<dc:creator>agawish</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[agawish]]></category>
		<category><![CDATA[Amr Gawish]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://blog.amr-gawish.com/?p=66</guid>
		<description><![CDATA[Dear all, I just want to inform that i&#8217;m starting developing the next release of the program, and inshaAllah it&#8217;ll have those features: 1- Ability to write arabic message [well formed] and send it 2- Fix the long messages problem &#8230; <a href="http://blog.amr-gawish.com/66/arabic-sms-version-15/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-71" title="la-elah-ella-allah" src="http://blog.amr-gawish.com/wp-content/uploads/2009/03/la-elah-ella-allah.png" alt="la-elah-ella-allah" width="320" height="480" /></p>
<p>Dear all,</p>
<p>I just want to inform that i&#8217;m starting developing the next release of the program, and inshaAllah it&#8217;ll have those features:</p>
<p>1- Ability to write arabic message [well formed] and send it</p>
<p>2- Fix the long messages problem</p>
<p>3- To have just in time reader -To view the message in arabic upon recieving it without having to go to my application to view it-.</p>
<p>4- If possible * to read the messages in arabic anywhere right from your regular inbox.</p>
<p>Wish me luck we ed3oli <img src='http://blog.amr-gawish.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>* this feature may not present, but i&#8217;ll try soo hard to do it inshaAllah.</p>
<h3><strong><span style="color: #ff0000;">Update: </span>Find the new news about the Android Application in <a title="Arabic Reshaper goes Open Source" href="http://blog.amr-gawish.com/110/arabic-reshaper-goes-open-source-codename-barbetter-arabic-reshaper/">here</a></strong></h3>
<h3><strong><strong><span style="font-family: mceinline;">Update: </span>The project has come to live, check out this link all </strong><a href="http://bar.amr-gawish.com/"><strong>http://bar.amr-gawish.com/</strong></a><strong> </strong></strong></h3>
]]></content:encoded>
			<wfw:commentRss>http://blog.amr-gawish.com/66/arabic-sms-version-15/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Arabic SMS Reader v1.0.1</title>
		<link>http://blog.amr-gawish.com/55/arabic-sms-reader-v101/</link>
		<comments>http://blog.amr-gawish.com/55/arabic-sms-reader-v101/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 02:05:18 +0000</pubDate>
		<dc:creator>agawish</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[arabic]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://blog.amr-gawish.com/?p=55</guid>
		<description><![CDATA[Dear All, I&#8217;ve published my first Android application Arabic SMS Reader v1.0.0 search for it in the market and give it a test. Unfortunately I cant test it on my emulator, so I&#8217;m having faith in you guys to tell  &#8230; <a href="http://blog.amr-gawish.com/55/arabic-sms-reader-v101/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-medium wp-image-56" title="Arabic Android" src="http://blog.amr-gawish.com/wp-content/uploads/2009/02/picture-3-300x254.png" alt="Arabic Android" width="300" height="254" /></p>
<p>Dear All,</p>
<p>I&#8217;ve published my first Android application Arabic SMS Reader v1.0.0 search for it in the market and give it a test.</p>
<p>Unfortunately I cant test it on my emulator, so I&#8217;m having faith in you guys to tell  me, if it works well or not <img src='http://blog.amr-gawish.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The Application is simple, it suppose to have the sms inbox just as u open it, and when clicking on one item, it supposed to reveal your message into its right arabic format.</p>
<p>If you have any feedback dont hesitate to tell me at once, thanks <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/55/arabic-sms-reader-v101/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
		<item>
		<title>SOA trip</title>
		<link>http://blog.amr-gawish.com/43/soa-trip/</link>
		<comments>http://blog.amr-gawish.com/43/soa-trip/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 23:54:01 +0000</pubDate>
		<dc:creator>agawish</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[SOA]]></category>

		<guid isPermaLink="false">http://blog.amr-gawish.com/?p=43</guid>
		<description><![CDATA[I&#8217;m really excited about my new SOA training. I hope i can really make good use of it, and the instructor one of the best I&#8217;ve ever seen.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m really excited about my new <a href="http://en.wikipedia.org/wiki/Service-oriented_architecture" target="_blank">SOA</a> training.</p>
<p>I hope i can really make good use of it, and the instructor one of the best I&#8217;ve ever seen.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amr-gawish.com/43/soa-trip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arabic Language in Android</title>
		<link>http://blog.amr-gawish.com/39/arabic-language-in-android/</link>
		<comments>http://blog.amr-gawish.com/39/arabic-language-in-android/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 22:58:29 +0000</pubDate>
		<dc:creator>agawish</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[agawish]]></category>
		<category><![CDATA[Amr Gawish]]></category>
		<category><![CDATA[arabic]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://blog.amr-gawish.com/?p=39</guid>
		<description><![CDATA[Thanks to Ahmad Essam&#8216;s Article about google android, I had the ArabicReshaper.java file and made some enhancements. With the help of this person, I was able to develop my first Arabic writer program that proves that Android is Arabic support &#8230; <a href="http://blog.amr-gawish.com/39/arabic-language-in-android/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="attachment_40" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-40" title="Arabic Android" src="http://blog.amr-gawish.com/wp-content/uploads/2009/01/arabic-300x187.png" alt="Arabic Android" width="300" height="187" /><p class="wp-caption-text">Arabic Android</p></div>
<p>Thanks to <a href="http://www.ahmed-essam.com/2007/11/applicability-for-arabizing-android.html" target="_blank">Ahmad Essam</a>&#8216;s Article about google android, I had the ArabicReshaper.java file and made some enhancements.</p>
<p>With the help of this person, I was able to develop my first Arabic writer program that proves that Android is Arabic support and hopefully to have a fully functional application that read/write Arabic and may help other applications that need Arabic support to find their purpose perfectly.</p>
<p><span style="color: #993300;">Updated</span>: now check this <a href="http://blog.amr-gawish.com/55/arabic-sms-reader-v101arabic-sms-reader-v101/">link</a> for the SMS Arabic Mobile Manager</p>
<p><span id="more-39"></span>First the file lacked some enhancements regarding the placing of the letters, but it almost was complete, i only did a small touch and it was complete.</p>
<p>But the Reshaper class is only processing one word, it couldnt be a good success to combine arabic english letters, or add a space, so i made my helper class, ArabicUtilities.java with four functions in it, to determine if the text contain arabic letters, and to reshape a whole text containing english, Arabic and others.</p>
<p>The Tricky part was to insert the font to be working with, as described in Ahmad Essam&#8217;s blog article &#8220;<a href="http://www.ahmed-essam.com/2007/12/how-do-arabization-works-idea-behind.html" target="_blank">How Does Arabization Work</a>&#8221; that the free type font is already supported, and BiDi is already supported, so just reshaping and have a freetype font and your good to go, so how to load my arabic free type font library without having to force it in my SDK, because it wouldnt be reasonable to have this in a real working mobile.</p>
<p>The answer to that is really simple actually, in Android they provided a great thing called Asset Manager where i can have my read-only files to load them as streams or with whatever way i want -helpful for configurations and stuff-, and with a little help of java Font library it was done by only a few lines of code here is the snippet</p>
<blockquote><p><code><br />
AssetManager manager=this.getAssets();<br />
try<br />
{<br />
manager.open("tahoma.ttf");<br />
TextView tv=(TextView)this.findViewById(R.id.testMe);<br />
tv.setTypeface(Typeface.createFromAsset(manager, "tahoma.ttf"));<br />
tv.setTextSize(50f);<br />
tv.setText(ArabicUtilities.reshape("adsdads الحمد لله asdad"));<br />
}catch(Exception ex){<br />
//TODO<br />
}</code></p></blockquote>
<p>and Hopp it all went great, and my android start reading Arabic like it was born doing it!</p>
<p>I&#8217;ll be putting the solution online for download soon, just need to modify few issues first.</p>
<p><strong><span style="color: #993300;">Updated</span>: now check this <a href="http://blog.amr-gawish.com/55/arabic-sms-reader-v101arabic-sms-reader-v101/">link</a> for the SMS Arabic Mobile Manager</strong></p>
<p><strong><span style="color: #993300;">Updated</span>: new news considering Android Application in <a title="Arabic Reshaper goes Open Source" href="http://blog.amr-gawish.com/110/arabic-reshaper-goes-open-source-codename-bar-better-arabic-reshaper">here</a> </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.amr-gawish.com/39/arabic-language-in-android/feed/</wfw:commentRss>
		<slash:comments>172</slash:comments>
		</item>
	</channel>
</rss>

