<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-677131969527136022</id><updated>2012-02-16T01:31:22.362-08:00</updated><title type='text'>For Java Programmers</title><subtitle type='html'>java software developer</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-677131969527136022.post-5581833798637536252</id><published>2009-12-04T11:41:00.000-08:00</published><updated>2009-12-04T11:57:48.531-08:00</updated><title type='text'>Take backup - but without Stupidity !!!</title><content type='html'>Please take backup ur code on regular basis otherwise.... :( I got bad sector on my HDD drive ( that contained the OS and my coding folders too... )  suddenly and i discover me that i took my backup on Desktop - as a result guess what happened? All of my codes with my backup turns into my bad dreams :( I tried with several recovery utilities for more than a week but no positive results... and i found some of my important task was in jar formatted - i needed to recover the class files to code - so i download DJ Decompiler - ( i used it before ... one good tool....) but after downloading.... i could not use it any more ..... ( of course for free ) - However i &lt;a href="http://java.decompiler.free.fr/"&gt;download&lt;/a&gt; and this simply saved my time and make me :)&lt;br /&gt;&lt;br /&gt;If you need to convert your class files to source (.java) file simply  &lt;a href="http://java.decompiler.free.fr/"&gt;download&lt;/a&gt; and enjoy.&lt;br /&gt;&lt;br /&gt;Happy Coding.....  :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/677131969527136022-5581833798637536252?l=mightyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/5581833798637536252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=677131969527136022&amp;postID=5581833798637536252' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/5581833798637536252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/5581833798637536252'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/2009/12/take-backup-but-without-stupidity.html' title='Take backup - but without Stupidity !!!'/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-677131969527136022.post-3877269401951680053</id><published>2009-08-17T11:01:00.000-07:00</published><updated>2009-08-17T12:11:08.646-07:00</updated><title type='text'>Tasks....</title><content type='html'>Search for handsets support AT commands&lt;br /&gt;http://www.allthemobile.com/search/?qr=nokia+AT+command+support+sets&lt;br /&gt;&lt;br /&gt;http://www.developershome.com/sms/freeLibForSMS.asp&lt;br /&gt;&lt;br /&gt;Check compatibility&lt;br /&gt;http://www.developershome.com/sms/cpmsCommand.asp&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Responsibilities:&lt;br /&gt;Lead and oversee the design of new, Java / J2EE / Java EE and SOA based solutions. &lt;br /&gt;Perform Research and Development into the very latest in Internet-based technologies, methodologies, architectures and industry trends.&lt;br /&gt;Analyze code to find causes of errors and revise code. Test code using structured testing methodology and confirms programs meet specification.&lt;br /&gt;Convert designs and specifications into code.&lt;br /&gt;Write and maintain technical specifications, documentation to describe program development, coding, testing, changes, and corrections, installation and operation of developed software.&lt;br /&gt;Provide technical assistance by responding to inquiries from other stakeholders.&lt;br /&gt;&lt;br /&gt;Requirements:&lt;br /&gt;&lt;br /&gt;A strong interest in researching, making recommendations and implementing new web related tools/technologies is highly preferred. The candidate must be able to code, debug and test application programs utilizing JAVA and web-based programming tools. Having hands on experience in HTML, CSS etc i.e. web technologies will be an advantage. Candidates must be committed to exacting quality standards; extensive unit and integration test experience. Candidates must have experience working successfully in a close team environment.&lt;br /&gt;2+ years experience designing and deploying Java / J2EE / Java EE-based solutions on behalf of complex, integrated, business environments.&lt;br /&gt;Experience designing and exposing re-usable Service Orientated Architecture (SOA) based solutions.&lt;br /&gt;Deep knowledge of XML, Apache Tomcat, JBoss, Java Server Pages (JSP), HTTP, and Servlets.&lt;br /&gt;Proven and extensive experience designing solutions using the Apache Struts Framework (for Java EE) and Apache Axis Framework (for Web Services).&lt;br /&gt;Possesses a strong background in Object-Oriented (OO) system design.&lt;br /&gt;Experience with iterative software design, prototyping and methodologies.&lt;br /&gt;Demonstrable experience with Intellij IDEA or similar product.&lt;br /&gt;Experience with software build/deployment frameworks (such as MAKE, ANT, MAVEN, etc.) and unit test frameworks (such as JUNIT).&lt;br /&gt;Experience performing source control with Perforce or similar product.&lt;br /&gt;Excellent written and verbal communication skills. Presentation skills and the demonstrable ability to discuss technical subjects with personnel - at all levels - is a must.&lt;br /&gt;Highly analytical, pro-active and detail oriented.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/677131969527136022-3877269401951680053?l=mightyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/3877269401951680053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=677131969527136022&amp;postID=3877269401951680053' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/3877269401951680053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/3877269401951680053'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/2009/08/tasks.html' title='Tasks....'/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-677131969527136022.post-8258162163617203426</id><published>2009-07-29T11:21:00.000-07:00</published><updated>2009-07-29T11:57:27.891-07:00</updated><title type='text'>Performace Does Matter</title><content type='html'>&lt;a href="http://www.jroller.com/eyallupu/entry/tuning_queries_using_paging_batch"&gt;Performance Tuning !!!&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.jroller.com/eyallupu/entry/ejb3ql_queries"&gt;Tune using EJB3QL&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/677131969527136022-8258162163617203426?l=mightyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/8258162163617203426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=677131969527136022&amp;postID=8258162163617203426' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/8258162163617203426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/8258162163617203426'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/2009/07/performace-does-matter.html' title='Performace Does Matter'/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-677131969527136022.post-4015443917186028434</id><published>2009-06-23T11:43:00.000-07:00</published><updated>2009-06-23T11:49:50.171-07:00</updated><title type='text'>Oracle Driver Missing for Reports</title><content type='html'>&lt;a href="http://www.java-forums.org/new-java/2665-java-lang-classnotfoundexception-oracle-jdbc-driver-oracledriver.html"&gt;Check Oracle Driver Missing Info&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="smallfont post-title"&gt;     &lt;strong&gt;1.  java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver&lt;/strong&gt;    &lt;/div&gt;    &lt;!-- / icon and title --&gt;         &lt;!-- message --&gt;   &lt;div id="post_message_5180"&gt;Hi everybody&lt;br /&gt;&lt;br /&gt;I'm new in java Platform and i have problems trying to load a JDBC driver using Class.forname, but JVM can not find it. I configured classpath enviroment path pointig to libraries&lt;br /&gt;&lt;br /&gt;OS: Windows XP&lt;br /&gt;Java Version 1.6&lt;br /&gt;IDE Eclipse 3.2.2&lt;br /&gt;&lt;br /&gt;classpath = .;C:\Program Files\Altova\xmlspy\XMLSpyInterface.jar;c:\program files\Microsoft SQL Server 2000 Driver for JDBC\lib\msbase.jar;c:\program files\Microsoft SQL Server 2000 Driver for JDBC\lib\msutil.jar;c:\program files\Microsoft SQL Server 2000 Driver for JDBC\lib\mssqlserver.jar;D:\oracle\ora92\jdbc\lib\ classes12.zip&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver&lt;br /&gt; at java.net.URLClassLoader$1.run(Unknown Source)&lt;br /&gt; at java.security.AccessController.doPrivileged(Native Method)&lt;br /&gt; at java.net.URLClassLoader.findClass(Unknown Source)&lt;br /&gt; at java.lang.ClassLoader.loadClass(Unknown Source)&lt;br /&gt; at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)&lt;br /&gt; at java.lang.ClassLoader.loadClass(Unknown Source)&lt;br /&gt; at java.lang.ClassLoader.loadClassInternal(Unknown Source)&lt;br /&gt; at java.lang.Class.forName0(Native Method)&lt;br /&gt; at java.lang.Class.forName(Unknown Source)&lt;br /&gt; at bpos.Db.Conectar(Db.java:20)&lt;br /&gt; at bpos.Process.main(Process.java:19)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Can anybody help me about this? It will appreciate.&lt;br /&gt;&lt;br /&gt;Leo&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;2. Hello Leo,&lt;br /&gt;&lt;br /&gt;Try putting the full path to the Oracle classes12.zip file at the front of the CLASSPATH. Also remove the extra space between the \ and classes12.zip.&lt;br /&gt;&lt;br /&gt;     Before you test with an app, ensure the driver returns version information by running this command on the command line:&lt;br /&gt;&lt;br /&gt;java oracle.jdbc.driver.OracleDriver&lt;br /&gt;&lt;br /&gt;     If that command does not work, you still have environment problems and need to revisit before you test with the app.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Netrista Khatam&lt;br /&gt;Technical Services Manager&lt;br /&gt;OpenLink Product Support&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. Hi Netrista.. thank you for your help.. I checked my enviroment variables and i didn't find problems. I think that was copy paste mistake. I put first the oracle driver library reference into the classpath enviroment variable&lt;br /&gt;&lt;br /&gt;C:\&gt;echo %classpath%&lt;br /&gt;.;D:\oracle\ora92\jdbc\lib\classes12.zip;C:\Progra m Files\Altova\xmlspy\XMLSpyInterface.jar;c:\program files\Microsoft SQL Server 2000 Driver for JDBC\lib\msbase.jar;c:\program files\Microsoft SQL Server 2000 Driver for JDBC\lib\msutil.jar;c:\program files\Microsoft SQL Server 2000 Driver for JDBC\lib\mssqlserver.jar&lt;br /&gt;&lt;br /&gt;I performed your suggested command and i couldn't get the version of each class i'm trying to use&lt;br /&gt;&lt;br /&gt;C:\&gt;java oracle.jdbc.driver.OracleDriver&lt;br /&gt;Exception in thread "main" java.lang.NoSuchMethodError: main&lt;br /&gt;&lt;br /&gt;C:\&gt;java com.microsoft.jdbc.sqlserver.SQLServerDriver&lt;br /&gt;null&lt;br /&gt;&lt;br /&gt;any other thing that it could be used? thanks!&lt;br /&gt;&lt;br /&gt;Leo&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. Hello Leo,&lt;br /&gt;&lt;br /&gt;      This is what I would recommend:&lt;br /&gt;&lt;br /&gt;1. Verify that the following path is correct:&lt;br /&gt;&lt;br /&gt;D:\oracle\ora92\jdbc\lib\classes12.zip&lt;br /&gt;&lt;br /&gt;2. Insure no permissions issues exist on that file or directory structure, which is unlikely since it is Windows.&lt;br /&gt;&lt;br /&gt;3. Run this command to get your java version:&lt;br /&gt;&lt;br /&gt;java -version&lt;br /&gt;&lt;br /&gt;4. Insure that the java version of the JVM/JDK that you have installed on Windows is compatible with the requirements of the driver.&lt;br /&gt;&lt;br /&gt;Can you state whether or not you can use the other JDBC drivers to get a connection using the application, even though they error on the commandline with DOS. I've seen that before, so it's important to ascertain whether the app connectivity issue is specific to Oracle or generalized to all JDBC connections.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Netrista Khatam&lt;br /&gt;Technical Services Manager&lt;br /&gt;OpenLink Product Support&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5. &lt;/span&gt;&lt;strong&gt;Fixed!&lt;/strong&gt;&lt;div class="smallfont post-title"&gt;    &lt;/div&gt;    &lt;!-- / icon and title --&gt;         &lt;!-- message --&gt;   &lt;div id="post_message_5687"&gt;Thank you very much.&lt;br /&gt;&lt;br /&gt;The classpath was correct. I proved on command line and it worked correctly. So i have to change my approach looking for into my IDE project definition parameters. I' m using Eclipse and i found that i have to define a classpath for the project.&lt;br /&gt;&lt;br /&gt;Ups! I'm new in Eclipse too.. and i forgot mention it. Your description of the solution helped me to find the final solution. Thank you!&lt;br /&gt;&lt;br /&gt;Leo&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="bbcode-start"&gt;  &lt;div class="bbcode-header"&gt;   &lt;div class="smallfont"&gt;Quote:&lt;/div&gt;  &lt;/div&gt;  &lt;div class="bbcode-content"&gt;&lt;div style="font-style: italic;"&gt;&lt;br /&gt;Try putting the full path to the Oracle classes12.zip file at the front of the CLASSPATH. Also remove the extra space between the \ and classes12.zip.&lt;br /&gt;&lt;br /&gt;     Before you test with an app, ensure the driver returns version information by running this command on the command line:&lt;br /&gt;&lt;br /&gt;java oracle.jdbc.driver.OracleDriver&lt;br /&gt;&lt;br /&gt;     If that command does not work, you still have environment problems and need to revisit before you test with the app.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Netrista Khatam&lt;br /&gt;Technical Services Manager&lt;br /&gt;OpenLink Product Support&lt;/div&gt;      &lt;/div&gt; &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/677131969527136022-4015443917186028434?l=mightyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/4015443917186028434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=677131969527136022&amp;postID=4015443917186028434' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/4015443917186028434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/4015443917186028434'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/2009/06/oracle-driver-missing-for-reports.html' title='Oracle Driver Missing for Reports'/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-677131969527136022.post-7681144988265108653</id><published>2009-06-09T11:38:00.000-07:00</published><updated>2009-06-09T11:42:17.277-07:00</updated><title type='text'>Customize JBoss log file size</title><content type='html'>&lt;a href="http://java.dzone.com/articles/configuring-logging-jboss"&gt;Customize JBoss log file size&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Some of the logging configuration changes that you might want to make include:&lt;br /&gt;•    Specifying a rolling log file.&lt;br /&gt;•    Limiting the amount of logging produced.&lt;br /&gt;•    Adding logging for your application.&lt;br /&gt;•    Defining a new log file.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Each of these topics is covered in the following text.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Rolling the server log file&lt;/b&gt;&lt;br /&gt;The &lt;b&gt;server.log&lt;/b&gt; file is created new each time the server is launched, and grows until the server is stopped, or until midnight. This behavior, while appropriate for a development environment, is not optimal for a production environment. In production you should specify a rolling log file, which when it reaches a certain size creates a new log file. Listing 1 shows how you can change the appender for the server.log file to create at most 20 log files of 10 megabytes (MB) in size each. All of the changes are highlighted.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Listing 1 Defining a rolling log appender&lt;/b&gt;&lt;/p&gt;&lt;div id="highlighter_254915" class="syntaxhighlighter"&gt;&lt;div class="bar"&gt;&lt;div class="toolbar"&gt;&lt;a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="http://java.dzone.com/articles/configuring-logging-jboss#viewSource"&gt;&lt;/a&gt;&lt;a class="item about" style="width: 16px; height: 16px;" title="?" href="http://java.dzone.com/articles/configuring-logging-jboss#about"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="lines"&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;01.&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px;"&gt;&lt;code class="plain"&gt;&lt;&lt;/code&gt;&lt;code class="keyword"&gt;log4j:...&lt;/code&gt;&lt;code class="plain"&gt;&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;02.&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt; &lt;/code&gt;&lt;span class="block" style="margin-left: 7px;"&gt;&lt;code class="plain"&gt;&lt;&lt;/code&gt;&lt;code class="keyword"&gt;appender&lt;/code&gt; &lt;code class="color1"&gt;name&lt;/code&gt;&lt;code class="plain"&gt;=&lt;/code&gt;&lt;code class="string"&gt;"FILE"&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;03.&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt;  &lt;/code&gt;&lt;span class="block" style="margin-left: 14px;"&gt;&lt;code class="color1"&gt;class&lt;/code&gt;&lt;code class="plain"&gt;=&lt;/code&gt;&lt;code class="string"&gt;"org.jboss.logging.appender.RollingFileAppender"&lt;/code&gt;&lt;code class="plain"&gt;&gt;  #1&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;04.&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt; &lt;/code&gt;&lt;span class="block" style="margin-left: 7px;"&gt;&lt;code class="plain"&gt;&lt;&lt;/code&gt;&lt;code class="keyword"&gt;errorHandler&lt;/code&gt; &lt;code class="plain"&gt;.../&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;05.&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt; &lt;/code&gt;&lt;span class="block" style="margin-left: 7px;"&gt;&lt;code class="plain"&gt;&lt;&lt;/code&gt;&lt;code class="keyword"&gt;param&lt;/code&gt; &lt;code class="color1"&gt;name&lt;/code&gt;&lt;code class="plain"&gt;=&lt;/code&gt;&lt;code class="string"&gt;"File"&lt;/code&gt; &lt;code class="color1"&gt;value&lt;/code&gt;&lt;code class="plain"&gt;=&lt;/code&gt;&lt;code class="string"&gt;"${jboss.server.log.dir}/server.log"&lt;/code&gt;&lt;code class="plain"&gt;/&gt; #2&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;06.&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt; &lt;/code&gt;&lt;span class="block" style="margin-left: 7px;"&gt;&lt;code class="plain"&gt;&lt;&lt;/code&gt;&lt;code class="keyword"&gt;param&lt;/code&gt; &lt;code class="color1"&gt;name&lt;/code&gt;&lt;code class="plain"&gt;=&lt;/code&gt;&lt;code class="string"&gt;"Append"&lt;/code&gt; &lt;code class="color1"&gt;value&lt;/code&gt;&lt;code class="plain"&gt;=&lt;/code&gt;&lt;code class="string"&gt;"true"&lt;/code&gt;&lt;code class="plain"&gt;/&gt;       #3&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;07.&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt; &lt;/code&gt;&lt;span class="block" style="margin-left: 7px;"&gt;&lt;code class="plain"&gt;&lt;&lt;/code&gt;&lt;code class="keyword"&gt;param&lt;/code&gt; &lt;code class="color1"&gt;name&lt;/code&gt;&lt;code class="plain"&gt;=&lt;/code&gt;&lt;code class="string"&gt;"MaxFileSize"&lt;/code&gt; &lt;code class="color1"&gt;value&lt;/code&gt;&lt;code class="plain"&gt;=&lt;/code&gt;&lt;code class="string"&gt;"10MB"&lt;/code&gt;&lt;code class="plain"&gt;/&gt;       #4&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;08.&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt; &lt;/code&gt;&lt;span class="block" style="margin-left: 7px;"&gt;&lt;code class="plain"&gt;&lt;&lt;/code&gt;&lt;code class="keyword"&gt;param&lt;/code&gt; &lt;code class="color1"&gt;name&lt;/code&gt;&lt;code class="plain"&gt;=&lt;/code&gt;&lt;code class="string"&gt;"MaxBackupIndex"&lt;/code&gt; &lt;code class="color1"&gt;value&lt;/code&gt;&lt;code class="plain"&gt;=&lt;/code&gt;&lt;code class="string"&gt;"20"&lt;/code&gt;&lt;code class="plain"&gt;/&gt;         #5&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;09.&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt; &lt;/code&gt;&lt;span class="block" style="margin-left: 7px;"&gt;&lt;code class="plain"&gt;&lt;&lt;/code&gt;&lt;code class="keyword"&gt;layout&lt;/code&gt; &lt;code class="plain"&gt;.../&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;10.&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt; &lt;/code&gt;&lt;span class="block" style="margin-left: 7px;"&gt;&lt;code class="plain"&gt;&lt;!--&lt;/code--&gt;&lt;code class="keyword"&gt;appender&lt;/code&gt;&lt;code class="plain"&gt;&gt;&lt;/code&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt1"&gt;&lt;code class="number"&gt;11.&lt;/code&gt;&lt;span class="content"&gt;&lt;code class="spaces"&gt; &lt;/code&gt;&lt;span class="block" style="margin-left: 7px;"&gt;&lt;code class="plain"&gt;...&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="line alt2"&gt;&lt;code class="number"&gt;12.&lt;/code&gt;&lt;span class="content"&gt;&lt;span class="block" style="margin-left: 0px;"&gt;&lt;code class="plain"&gt;&lt;!--&lt;/code--&gt;&lt;code class="keyword"&gt;log4j&lt;/code&gt;&lt;code class="plain"&gt;&gt;&lt;/code&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;#1: Changed to use the rolling appender&lt;br /&gt;#2: Location of log file&lt;br /&gt;#3: Append to existing file on startup&lt;br /&gt;#4: Limit log file size to 10MB&lt;br /&gt;#5: Keep only the last 20 log files&lt;br /&gt;&lt;br /&gt;We did not change the errorHandler or layout settings from the default. By the way, the various appenders defined in the &lt;b&gt;org.jboss.logging.appender&lt;/b&gt; package are simple subclasses of the Log4J appenders defined in the &lt;b&gt;org.apache.log4j&lt;/b&gt; package that automatically create the &lt;b&gt;server/xxx/log&lt;/b&gt; directory.&lt;br /&gt;The system property &lt;b&gt;jboss.server.log.dir&lt;/b&gt; defines the location of the log file (#2).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/677131969527136022-7681144988265108653?l=mightyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/7681144988265108653/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=677131969527136022&amp;postID=7681144988265108653' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/7681144988265108653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/7681144988265108653'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/2009/06/customize-jboss-log-file-size.html' title='Customize JBoss log file size'/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-677131969527136022.post-3394224382515617799</id><published>2009-05-26T10:37:00.000-07:00</published><updated>2009-05-26T10:44:18.073-07:00</updated><title type='text'>Generic Data Access Objects</title><content type='html'>&lt;table id="BodyTable" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;/tr&gt;&lt;tr&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="leftside"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class="bodycell"&gt; &lt;div id="Content"&gt; &lt;!-- Start Body --&gt;                   &lt;a name="A1"&gt;&lt;/a&gt;&lt;span style="font-size:180%;"&gt;Generic Data Access Objects&lt;/span&gt; &lt;ul&gt;&lt;li&gt;&lt;a href="https://www.hibernate.org/328.html#A2"&gt;The DAO interfaces&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="https://www.hibernate.org/328.html#A3"&gt;An implementation with Hibernate&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="https://www.hibernate.org/328.html#A4"&gt;Preparing DAOs with factories&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="https://www.hibernate.org/328.html#A5"&gt;Preparing DAOs with manual dependency injection&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="https://www.hibernate.org/328.html#A6"&gt;Preparing DAOs with lookup&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="https://www.hibernate.org/328.html#A7"&gt;Writing DAOs as managed EJB 3.0 components&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="https://www.hibernate.org/328.html#A8"&gt;A Better typed Generic DAO? You decide!&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This is a pattern for Data Access Objects with JDK 5.0, from the &lt;a href="http://caveatemptor.hibernate.org/"&gt;CaveatEmptor&lt;/a&gt; example application. It is also explained in the book &lt;a href="http://www.manning.com/bauer2"&gt;Java Persistence with Hibernate&lt;/a&gt;. Two links you might find useful: &lt;a href="https://www.hibernate.org/42.html"&gt;Sessions and transactions&lt;/a&gt; and &lt;a href="https://www.hibernate.org/43.html"&gt;Open Session in View&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;This time I based the DAO example on interfaces. Tools like Hibernate already provide database portability, so persistence layer portability shouldn't be a driving motivation for interfaces. However, DAO interfaces make sense in more complex applications, when several persistence services are encapsulate in one persistence layer. I'd say that you should use Hibernate (or Java Persistence APIs) directly in most cases, the best reason to use an additional DAO layer is higher abstraction (e.g. methods like &lt;tt&gt;getMaximumBid()&lt;/tt&gt; instead of &lt;tt&gt;session.createQuery(...)&lt;/tt&gt; repeated a dozen times).&lt;/p&gt; &lt;a name="A2"&gt;&lt;/a&gt;&lt;h2&gt;The DAO interfaces&lt;/h2&gt;&lt;p&gt;I use one interface per persistent entity, with a super interface for common CRUD functionality:&lt;/p&gt; &lt;pre class="code"&gt;public interface GenericDAO&lt;t,&gt; {&lt;br /&gt;&lt;br /&gt;   T findById(ID id, boolean lock);&lt;br /&gt;&lt;br /&gt;   List&lt;t&gt; findAll();&lt;br /&gt;&lt;br /&gt;   List&lt;t&gt; findByExample(T exampleInstance);&lt;br /&gt;&lt;br /&gt;   T makePersistent(T entity);&lt;br /&gt;&lt;br /&gt;   void makeTransient(T entity);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;You can already see that this is going to be a pattern for a state-oriented data access API, with methods such as &lt;tt&gt;makePersistent()&lt;/tt&gt; and &lt;tt&gt;makeTransient()&lt;/tt&gt;. Furthermore, to implement a DAO you have to provide a type and an identifier argument. As for most ORM solutions, identifier types have to be serializable.&lt;/p&gt;&lt;p&gt;The DAO interface for a particular entity extends the generic interface and provides the type arguments:&lt;/p&gt; &lt;pre class="code"&gt;public interface ItemDAO extends GenericDAO&lt;item,&gt; {&lt;br /&gt;&lt;br /&gt;   public static final String QUERY_MAXBID = "ItemDAO.QUERY_MAXBID";&lt;br /&gt;   public static final String QUERY_MINBID = "ItemDAO.QUERY_MINBID";&lt;br /&gt;&lt;br /&gt;   Bid getMaxBid(Long itemId);&lt;br /&gt;   Bid getMinBid(Long itemId);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;We basically separate generic CRUD operations and actual business-related data access operations from each other. (Ignore the named query constants for now, they are convenient if you use annotations.) However, even if only CRUD operations are needed for a particular entity, you should still write an interface for it, even it it is going to be empty. It is important to use a concrete DAO in your controller code, otherwise you will face some refactoring once you have to introduce specific data access operations for this entity.&lt;/p&gt; &lt;a name="A3"&gt;&lt;/a&gt;&lt;h2&gt;An implementation with Hibernate&lt;/h2&gt;&lt;p&gt;An implementation of the interfaces could be done with any state-management capable persistence service. First, the generic CRUD implementation with Hibernate:&lt;/p&gt; &lt;pre class="code"&gt;public abstract class GenericHibernateDAO&lt;t,&gt;&lt;br /&gt;       implements GenericDAO&lt;t,&gt; {&lt;br /&gt;&lt;br /&gt;   private Class&lt;t&gt; persistentClass;&lt;br /&gt;   private Session session;&lt;br /&gt;&lt;br /&gt;   public GenericHibernateDAO() {&lt;br /&gt;       this.persistentClass = (Class&lt;t&gt;) ((ParameterizedType) getClass()&lt;br /&gt;                               .getGenericSuperclass()).getActualTypeArguments()[0];&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;   @SuppressWarnings("unchecked")&lt;br /&gt;   public void setSession(Session s) {&lt;br /&gt;       this.session = s;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   protected Session getSession() {&lt;br /&gt;       if (session == null)&lt;br /&gt;           throw new IllegalStateException("Session has not been set on DAO before usage");&lt;br /&gt;       return session;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public Class&lt;t&gt; getPersistentClass() {&lt;br /&gt;       return persistentClass;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   @SuppressWarnings("unchecked")&lt;br /&gt;   public T findById(ID id, boolean lock) {&lt;br /&gt;       T entity;&lt;br /&gt;       if (lock)&lt;br /&gt;           entity = (T) getSession().load(getPersistentClass(), id, LockMode.UPGRADE);&lt;br /&gt;       else&lt;br /&gt;           entity = (T) getSession().load(getPersistentClass(), id);&lt;br /&gt;&lt;br /&gt;       return entity;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   @SuppressWarnings("unchecked")&lt;br /&gt;   public List&lt;t&gt; findAll() {&lt;br /&gt;       return findByCriteria();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   @SuppressWarnings("unchecked")&lt;br /&gt;   public List&lt;t&gt; findByExample(T exampleInstance, String[] excludeProperty) {&lt;br /&gt;       Criteria crit = getSession().createCriteria(getPersistentClass());&lt;br /&gt;       Example example =  Example.create(exampleInstance);&lt;br /&gt;       for (String exclude : excludeProperty) {&lt;br /&gt;           example.excludeProperty(exclude);&lt;br /&gt;       }&lt;br /&gt;       crit.add(example);&lt;br /&gt;       return crit.list();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   @SuppressWarnings("unchecked")&lt;br /&gt;   public T makePersistent(T entity) {&lt;br /&gt;       getSession().saveOrUpdate(entity);&lt;br /&gt;       return entity;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public void makeTransient(T entity) {&lt;br /&gt;       getSession().delete(entity);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public void flush() {&lt;br /&gt;       getSession().flush();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public void clear() {&lt;br /&gt;       getSession().clear();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   /**&lt;br /&gt;    * Use this inside subclasses as a convenience method.&lt;br /&gt;    */&lt;br /&gt;   @SuppressWarnings("unchecked")&lt;br /&gt;   protected List&lt;t&gt; findByCriteria(Criterion... criterion) {&lt;br /&gt;       Criteria crit = getSession().createCriteria(getPersistentClass());&lt;br /&gt;       for (Criterion c : criterion) {&lt;br /&gt;           crit.add(c);&lt;br /&gt;       }&lt;br /&gt;       return crit.list();&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;There are some interesting things in this implementation. First, it clearly needs a &lt;tt&gt;Session&lt;/tt&gt; to work, provided with setter injection. You could also use constructor injection. How you set the &lt;tt&gt;Session&lt;/tt&gt; and what scope this &lt;tt&gt;Session&lt;/tt&gt; has is of no concern to the actual DAO implementation. A DAO should not control transactions or the &lt;tt&gt;Session&lt;/tt&gt; scope. &lt;/p&gt;&lt;p&gt;We need to suppress a few compile-time warnings about unchecked casts, because Hibernate's interfaces are JDK 1.4 only. What follows are the implementations of the generic CRUD operations, quite straightforward. The last method is quite nice, using another JDK 5.0 feature, &lt;em&gt;varargs&lt;/em&gt;. It helps us to build &lt;tt&gt;Criteria&lt;/tt&gt; queries in concrete entity DAOs. This is an example of a concrete DAO that extends the generic DAO implementation for Hibernate:&lt;/p&gt; &lt;pre class="code"&gt;public class ItemDAOHibernate&lt;br /&gt;       extends     GenericHibernateDAO&lt;item,&gt;&lt;br /&gt;       implements  ItemDAO {&lt;br /&gt;&lt;br /&gt;   public Bid getMaxBid(Long itemId) {&lt;br /&gt;       Query q = getSession().getNamedQuery(ItemDAO.QUERY_MAXBID);&lt;br /&gt;       q.setParameter("itemid", itemId);&lt;br /&gt;       return (Bid) q.uniqueResult();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public Bid getMinBid(Long itemId) {&lt;br /&gt;       Query q = getSession().getNamedQuery(ItemDAO.QUERY_MINBID);&lt;br /&gt;       q.setParameter("itemid", itemId);&lt;br /&gt;       return (Bid) q.uniqueResult();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Another example which uses the &lt;tt&gt;findByCriteria()&lt;/tt&gt; method of the superclass with variable arguments:&lt;/p&gt; &lt;pre class="code"&gt;public class CategoryDAOHibernate&lt;br /&gt;       extends     GenericHibernateDAO&lt;category,&gt;&lt;br /&gt;       implements  CategoryDAO {&lt;br /&gt;&lt;br /&gt;   public Collection&lt;category&gt; findAll(boolean onlyRootCategories) {&lt;br /&gt;       if (onlyRootCategories)&lt;br /&gt;           return findByCriteria( Expression.isNull("parent") );&lt;br /&gt;       else&lt;br /&gt;           return findAll();&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt; &lt;a name="A4"&gt;&lt;/a&gt;&lt;h2&gt;Preparing DAOs with factories&lt;/h2&gt;&lt;p&gt;We could bring it all together in a DAO factory, which not only sets the &lt;tt&gt;Session&lt;/tt&gt; when a DAO is constructed but also contains nested classes to implement CRUD-only DAOs with no business-related operations:&lt;/p&gt; &lt;pre class="code"&gt;public class HibernateDAOFactory extends DAOFactory {&lt;br /&gt;&lt;br /&gt;   public ItemDAO getItemDAO() {&lt;br /&gt;       return (ItemDAO)instantiateDAO(ItemDAOHibernate.class);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public CategoryDAO getCategoryDAO() {&lt;br /&gt;       return (CategoryDAO)instantiateDAO(CategoryDAOHibernate.class);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public CommentDAO getCommentDAO() {&lt;br /&gt;       return (CommentDAO)instantiateDAO(CommentDAOHibernate.class);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public ShipmentDAO getShipmentDAO() {&lt;br /&gt;       return (ShipmentDAO)instantiateDAO(ShipmentDAOHibernate.class);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   private GenericHibernateDAO instantiateDAO(Class daoClass) {&lt;br /&gt;       try {&lt;br /&gt;           GenericHibernateDAO dao = (GenericHibernateDAO)daoClass.newInstance();&lt;br /&gt;           dao.setSession(getCurrentSession());&lt;br /&gt;           return dao;&lt;br /&gt;       } catch (Exception ex) {&lt;br /&gt;           throw new RuntimeException("Can not instantiate DAO: " + daoClass, ex);&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   // You could override this if you don't want HibernateUtil for lookup&lt;br /&gt;   protected Session getCurrentSession() {&lt;br /&gt;       return HibernateUtil.getSessionFactory().getCurrentSession();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   // Inline concrete DAO implementations with no business-related data access methods.&lt;br /&gt;   // If we use public static nested classes, we can centralize all of them in one source file.&lt;br /&gt;&lt;br /&gt;   public static class CommentDAOHibernate&lt;br /&gt;           extends GenericHibernateDAO&lt;comment,&gt;&lt;br /&gt;           implements CommentDAO {}&lt;br /&gt;&lt;br /&gt;   public static class ShipmentDAOHibernate&lt;br /&gt;           extends GenericHibernateDAO&lt;shipment,&gt;&lt;br /&gt;           implements ShipmentDAO {}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;This concrete factory for Hibernate DAOs extends the abstract factory, which is the interface we'll use in application code:&lt;/p&gt; &lt;pre class="code"&gt;public abstract class DAOFactory {&lt;br /&gt;&lt;br /&gt;   /**&lt;br /&gt;    * Creates a standalone DAOFactory that returns unmanaged DAO&lt;br /&gt;    * beans for use in any environment Hibernate has been configured&lt;br /&gt;    * for. Uses HibernateUtil/SessionFactory and Hibernate context&lt;br /&gt;    * propagation (CurrentSessionContext), thread-bound or transaction-bound,&lt;br /&gt;    * and transaction scoped.&lt;br /&gt;    */&lt;br /&gt;   public static final Class HIBERNATE = org.hibernate.ce.auction.dao.hibernate.HibernateDAOFactory.class;&lt;br /&gt;&lt;br /&gt;   /**&lt;br /&gt;    * Factory method for instantiation of concrete factories.&lt;br /&gt;    */&lt;br /&gt;   public static DAOFactory instance(Class factory) {&lt;br /&gt;       try {&lt;br /&gt;           return (DAOFactory)factory.newInstance();&lt;br /&gt;       } catch (Exception ex) {&lt;br /&gt;           throw new RuntimeException("Couldn't create DAOFactory: " + factory);&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   // Add your DAO interfaces here&lt;br /&gt;   public abstract ItemDAO getItemDAO();&lt;br /&gt;   public abstract CategoryDAO getCategoryDAO();&lt;br /&gt;   public abstract CommentDAO getCommentDAO();&lt;br /&gt;   public abstract ShipmentDAO getShipmentDAO();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Note that this factory example is suitable for persistence layers which are primarily implemented with a single persistence service, such as Hibernate or EJB 3.0 persistence. If you have to mix persistence APIs, for example, Hibernate and plain JDBC, the pattern changes slightly. Keep in mind that you can also call &lt;tt&gt;session.connection()&lt;/tt&gt; &lt;em&gt;inside&lt;/em&gt; a Hibernate-specific DAO, or use one of the many bulk operation/SQL support options in Hibernate 3.1 to avoid plain JDBC.&lt;/p&gt;&lt;p&gt;Finally, this is how data access now looks like in controller/command handler code (pick whatever transaction demarcation strategy you like, the DAO code doesn't change):&lt;/p&gt; &lt;pre class="code"&gt;// EJB3 CMT: @TransactionAttribute(TransactionAttributeType.REQUIRED)&lt;br /&gt;public void execute() {&lt;br /&gt;&lt;br /&gt;   // JTA: UserTransaction utx = jndiContext.lookup("UserTransaction");&lt;br /&gt;   // JTA: utx.begin();&lt;br /&gt;&lt;br /&gt;   // Plain JDBC: HibernateUtil.getCurrentSession().beginTransaction();&lt;br /&gt;&lt;br /&gt;   DAOFactory factory = DAOFactory.instance(DAOFactory.HIBERNATE);&lt;br /&gt;   ItemDAO itemDAO = factory.getItemDAO();&lt;br /&gt;   UserDAO userDAO = factory.getUserDAO();&lt;br /&gt;&lt;br /&gt;   Bid currentMaxBid = itemDAO.getMaxBid(itemId);&lt;br /&gt;   Bid currentMinBid = itemDAO.getMinBid(itemId);&lt;br /&gt;&lt;br /&gt;   Item item = itemDAO.findById(itemId, true);&lt;br /&gt;&lt;br /&gt;   newBid = item.placeBid(userDAO.findById(userId, false),&lt;br /&gt;                           bidAmount,&lt;br /&gt;                           currentMaxBid,&lt;br /&gt;                           currentMinBid);&lt;br /&gt;&lt;br /&gt;   // JTA: utx.commit(); // Don't forget exception handling&lt;br /&gt;&lt;br /&gt;   // Plain JDBC: HibernateUtil.getCurrentSession().getTransaction().commit(); // Don't forget exception handling&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;The database transaction, either JTA or direct JDBC, is started and committed in an interceptor that runs for every &lt;tt&gt;execute()&lt;/tt&gt;, following the &lt;a href="https://www.hibernate.org/43.html"&gt;Open Session in View&lt;/a&gt; pattern. You can use AOP for this or any kind of interceptor that can be wrapped around a method call, see &lt;a href="https://www.hibernate.org/391.html"&gt;Session handling with AOP&lt;/a&gt;.&lt;/p&gt; &lt;a name="A5"&gt;&lt;/a&gt;&lt;h2&gt;Preparing DAOs with manual dependency injection&lt;/h2&gt;&lt;p&gt;You don't need to write the factories. You can as well just do this:&lt;/p&gt; &lt;pre class="code"&gt;// EJB3 CMT: @TransactionAttribute(TransactionAttributeType.REQUIRED)&lt;br /&gt;public void execute() {&lt;br /&gt;&lt;br /&gt;   // JTA: UserTransaction utx = jndiContext.lookup("UserTransaction");&lt;br /&gt;   // JTA: utx.begin();&lt;br /&gt;&lt;br /&gt;   // Plain JDBC: HibernateUtil.getCurrentSession().beginTransaction();&lt;br /&gt;&lt;br /&gt;   ItemDAOHibernate itemDAO = new ItemDAOHibernate();&lt;br /&gt;   itemDAO.setSession(HibernateUtil.getSessionFactory().getCurrentSession());&lt;br /&gt;&lt;br /&gt;   UserDAOHibernate userDAO = new UserDAOHibernate();&lt;br /&gt;   userDAO.setSession(HibernateUtil.getSessionFactory().getCurrentSession());&lt;br /&gt;&lt;br /&gt;   Bid currentMaxBid = itemDAO.getMaxBid(itemId);&lt;br /&gt;   Bid currentMinBid = itemDAO.getMinBid(itemId);&lt;br /&gt;&lt;br /&gt;   Item item = itemDAO.findById(itemId, true);&lt;br /&gt;&lt;br /&gt;   newBid = item.placeBid(userDAO.findById(userId, false),&lt;br /&gt;                           bidAmount,&lt;br /&gt;                           currentMaxBid,&lt;br /&gt;                           currentMinBid);&lt;br /&gt;&lt;br /&gt;   // JTA: utx.commit(); // Don't forget exception handling&lt;br /&gt;&lt;br /&gt;   // Plain JDBC: HibernateUtil.getCurrentSession().getTransaction().commit(); // Don't forget exception handling&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;The disadvantage here is that the implementation classes (i.e. &lt;tt&gt;ItemDAOHibernate&lt;/tt&gt; and &lt;tt&gt;UserDAOHibernate&lt;/tt&gt;) of the persistence layer are exposed to the client, the controller. Also, constructor injection of the current &lt;tt&gt;Session&lt;/tt&gt; might be more appropriate.&lt;/p&gt; &lt;a name="A6"&gt;&lt;/a&gt;&lt;h2&gt;Preparing DAOs with lookup&lt;/h2&gt;&lt;p&gt;Alternatively, call &lt;tt&gt;HibernateUtil.getSessionFactory().getCurrentSession()&lt;/tt&gt; as a fallback, if the client didn't provide a &lt;tt&gt;Session&lt;/tt&gt; when the DAO was constructed:&lt;/p&gt; &lt;pre class="code"&gt;public abstract class GenericHibernateDAO&lt;t,&gt;&lt;br /&gt;       implements GenericDAO&lt;t,&gt; {&lt;br /&gt;&lt;br /&gt;   private Class&lt;t&gt; persistentClass;&lt;br /&gt;   private Session session;&lt;br /&gt;&lt;br /&gt;   public GenericHibernateDAO() {&lt;br /&gt;       this.persistentClass = (Class&lt;t&gt;) ((ParameterizedType) getClass()&lt;br /&gt;                               .getGenericSuperclass()).getActualTypeArguments()[0];&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void setSession(Session session) {&lt;br /&gt;       this.session = session;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  protected void getSession() {&lt;br /&gt;      if (session == null)&lt;br /&gt;          session = HibernateUtil.getSessionFactory().getCurrentSession();&lt;br /&gt;      return session;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;The controller now uses these stateless data access objects through direct instantiation:&lt;/p&gt; &lt;pre class="code"&gt;// EJB3 CMT: @TransactionAttribute(TransactionAttributeType.REQUIRED)&lt;br /&gt;public void execute() {&lt;br /&gt;&lt;br /&gt;   // JTA: UserTransaction utx = jndiContext.lookup("UserTransaction");&lt;br /&gt;   // JTA: utx.begin();&lt;br /&gt;&lt;br /&gt;   // Plain JDBC: HibernateUtil.getCurrentSession().beginTransaction();&lt;br /&gt;&lt;br /&gt;   ItemDAO itemDAO = new ItemDAOHibernate();&lt;br /&gt;   UserDAO userDAO = new UserDAOHibernate();&lt;br /&gt;&lt;br /&gt;   Bid currentMaxBid = itemDAO.getMaxBid(itemId);&lt;br /&gt;   Bid currentMinBid = itemDAO.getMinBid(itemId);&lt;br /&gt;&lt;br /&gt;   Item item = itemDAO.findById(itemId, true);&lt;br /&gt;&lt;br /&gt;   newBid = item.placeBid(userDAO.findById(userId, false),&lt;br /&gt;                           bidAmount,&lt;br /&gt;                           currentMaxBid,&lt;br /&gt;                           currentMinBid);&lt;br /&gt;&lt;br /&gt;   // JTA: utx.commit(); // Don't forget exception handling&lt;br /&gt;&lt;br /&gt;   // Plain JDBC: HibernateUtil.getCurrentSession().getTransaction().commit(); // Don't forget exception handling&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;The only disadvantage of this very simple strategy is that the implementation classes (i.e. &lt;tt&gt;ItemDAOHibernate&lt;/tt&gt; and &lt;tt&gt;UserDAOHibernate&lt;/tt&gt;) of the persistence layer are again exposed to the client, the controller. You can still supply a custom &lt;tt&gt;Session&lt;/tt&gt; if needed (integration test, etc).&lt;/p&gt;&lt;p&gt;Each of these methods (factories, manual injection, lookup) for setting the current &lt;tt&gt;Session&lt;/tt&gt; and creating a DAO instance has advantages and drawbacks, use whatever you feel most comfortable with.&lt;/p&gt;&lt;p&gt;Naturally, the cleanest way is managed components and EJB 3.0 session beans:&lt;/p&gt; &lt;a name="A7"&gt;&lt;/a&gt;&lt;h2&gt;Writing DAOs as managed EJB 3.0 components&lt;/h2&gt;&lt;p&gt;Turn your DAO superclass into a base class for stateless session beans (all your concrete DAOs are then stateless EJBs, they already have a business interface). This is basically a single annotation which you could even move into an XML deployment descriptor if you like. You can then use dependency injection and get the "current" persistence context provided by the container:&lt;/p&gt; &lt;pre class="code"&gt;@Stateless&lt;br /&gt;public abstract class GenericHibernateDAO&lt;t,&gt;&lt;br /&gt;       implements GenericDAO&lt;t,&gt; {&lt;br /&gt;&lt;br /&gt;   private Class&lt;t&gt; persistentClass;&lt;br /&gt;  &lt;br /&gt;   @PersistenceContext&lt;br /&gt;   private EntityManager em;&lt;br /&gt;&lt;br /&gt;   public GenericHibernateDAO() {&lt;br /&gt;      setSession( (Session)em.getDelegate() );   &lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;You can then cast the delegate of an &lt;tt&gt;EntityManager&lt;/tt&gt; to a Hibernate &lt;tt&gt;Session&lt;/tt&gt;.&lt;/p&gt;&lt;p&gt;This only works if you use Hibernate as a Java Persistence provider, because the delegate is the &lt;tt&gt;Session&lt;/tt&gt; API. In JBoss AS you could even get a &lt;tt&gt;Session&lt;/tt&gt; injected directly. If you use a different Java Persistence provider, rely on the &lt;tt&gt;EntityManager&lt;/tt&gt; API instead of &lt;tt&gt;Session&lt;/tt&gt;. Now wire your DAOs into the controller, which is also a managed component:&lt;/p&gt; &lt;pre class="code"&gt;@Stateless&lt;br /&gt;public class ManageAuctionController implements ManageAuction {&lt;br /&gt;&lt;br /&gt;   @EJB ItemDAO itemDAO;&lt;br /&gt;   @EJB UserDAO userDAO;&lt;br /&gt;&lt;br /&gt;   @TransactionAttribute(TransactionAttributeType.REQUIRED) // This is even the default&lt;br /&gt;   public void execute() {&lt;br /&gt;&lt;br /&gt;       Bid currentMaxBid = itemDAO.getMaxBid(itemId);&lt;br /&gt;       Bid currentMinBid = itemDAO.getMinBid(itemId);&lt;br /&gt;&lt;br /&gt;       Item item = itemDAO.findById(itemId, true);&lt;br /&gt;&lt;br /&gt;       newBid = item.placeBid(userDAO.findById(userId, false),&lt;br /&gt;                              bidAmount,&lt;br /&gt;                              currentMaxBid,&lt;br /&gt;                              currentMinBid);&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;P.S. Credit has to be given to Eric Burke, who first posted the basics for this pattern on his blog. Unfortunately, not even the Google cache is available anymore.&lt;/p&gt; &lt;a name="A8"&gt;&lt;/a&gt;&lt;h2&gt;A Better typed Generic DAO? You decide!&lt;/h2&gt;&lt;p&gt;We are missing something on &lt;t&gt; end, since T allows you to "domain-ify" everything! and the Identifier type should ideally match the identifier type of T, but there's no way to do that on the code above. You decide which approach is better.&lt;/p&gt; &lt;pre class="code"&gt;// Our common Model interface that an abstract Domain model will implement and all domain // models will extend.&lt;br /&gt;public interface IModel&lt;id&gt; {&lt;br /&gt;       public abstract ID getId();&lt;br /&gt;       public abstract void setId(final ID pId);&lt;br /&gt;}&lt;br /&gt;// Our generic DAO, NOTE: MODEL's ID type is the same as ID now, which makes sense.&lt;br /&gt;// Also model type is more restrictive, dis-allowing all kinds of funky stuff to go in.&lt;br /&gt;public abstract class GenericHibernateDAO&lt;model&gt;, ID extends Serializable&gt; implements GenericDAO&lt;t,&gt; {&lt;br /&gt;&lt;br /&gt;   private Class&lt;model&gt; persistentClass;&lt;br /&gt;   private Session session;&lt;br /&gt;&lt;br /&gt;   public GenericHibernateDAO() {&lt;br /&gt;       // FIXME : I don't like magic number in the code, is there any way to fix 0 to something dynamic?&lt;br /&gt;       this.persistentClass = (Class&lt;model&gt;) ((ParameterizedType) getClass()&lt;br /&gt;                               .getGenericSuperclass()).getActualTypeArguments()[0];&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public final void setSession(final Session pSession) {&lt;br /&gt;       this.session = session;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  protected void getSession() {&lt;br /&gt;      if (session == null)&lt;br /&gt;          session = HibernateUtil.getSessionFactory().getCurrentSession();&lt;br /&gt;      return session;&lt;br /&gt;  }&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;In addition, we could add things like:&lt;/p&gt; &lt;pre class="code"&gt;public final String getRootAlias(){&lt;br /&gt;this.getPersistentClass().getSimpleName() + String.valueOf('_');&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Alhough this is not necessary or part of the enhanced version, but when criteria API is in use, this comes in handy.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Reference : https://www.hibernate.org/328.html&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/677131969527136022-3394224382515617799?l=mightyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/3394224382515617799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=677131969527136022&amp;postID=3394224382515617799' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/3394224382515617799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/3394224382515617799'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/2009/05/generic-data-access-objects.html' title='Generic Data Access Objects'/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-677131969527136022.post-2972240766295998871</id><published>2009-05-20T09:53:00.000-07:00</published><updated>2009-05-20T09:57:54.047-07:00</updated><title type='text'>Portal Links</title><content type='html'>&lt;a href="http://apps.plancomm.gov.bd:8080/portal-web/"&gt;Portal link&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://123.49.44.18:8080/portal-web/"&gt;Portal IP Link&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/677131969527136022-2972240766295998871?l=mightyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/2972240766295998871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=677131969527136022&amp;postID=2972240766295998871' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/2972240766295998871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/2972240766295998871'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/2009/05/portal-links.html' title='Portal Links'/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-677131969527136022.post-107272400631920359</id><published>2009-05-05T11:46:00.000-07:00</published><updated>2009-05-16T13:30:59.351-07:00</updated><title type='text'>Eclipse Tutorials links</title><content type='html'>&lt;a href="http://www.eclipse.org/webtools/community/new/new.php"&gt;web tools links&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.eclipse.org/webtools/jst/components/ws/tutorials/index.html"&gt;eclipse web services&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/677131969527136022-107272400631920359?l=mightyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/107272400631920359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=677131969527136022&amp;postID=107272400631920359' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/107272400631920359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/107272400631920359'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/2009/05/eclipse-tutorials-links.html' title='Eclipse Tutorials links'/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-677131969527136022.post-4601397417134010031</id><published>2009-04-28T13:13:00.000-07:00</published><updated>2009-05-09T16:01:32.302-07:00</updated><title type='text'>DAO Links</title><content type='html'>&lt;a href="http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html"&gt;DAO (Data Access Object) from sun&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://p4j5.dev.java.net/"&gt;p4j very useful link&lt;/a&gt;&lt;br /&gt;&lt;h4&gt;DataAccessObject&lt;/h4&gt; &lt;p&gt;The DataAccessObject is the primary object of this pattern. The DataAccessObject  abstracts the underlying data access implementation for the BusinessObject  to enable transparent access to the data source. The BusinessObject also  delegates data load and store operations to the DataAccessObject.&lt;/p&gt; &lt;h4&gt;DataSource&lt;/h4&gt; &lt;p&gt;This represents a data source implementation. A data source could be  a database such as an RDBMS, OODBMS, XML repository, flat file system,  and so forth. A data source can also be another system (legacy/mainframe),  service (B2B service or credit card bureau), or some kind of repository  (LDAP).&lt;/p&gt; &lt;h4&gt;TransferObject&lt;/h4&gt; &lt;p&gt;This represents a Transfer Object used as a data carrier. The DataAccessObject  may use a Transfer Object to return data to the client. The DataAccessObject  may also receive the data from the client in a Transfer Object to update  the data in the data source.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Here we go for some useful links....&lt;/p&gt;&lt;p&gt;   &lt;!--/htdig_noindex--&gt;  &lt;!--X-TopPNI-End--&gt; &lt;!--X-MsgBody--&gt; &lt;!--X-Subject-Header-Begin--&gt;       &lt;/p&gt;&lt;h1&gt;&lt;a href="http://www.mail-archive.com/ejb-interest@java.sun.com/msg24834.html"&gt;&lt;span style="font-size:100%;"&gt;&lt;span class="subject"&gt;Issues in calling DAO from Sateless session bean&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/h1&gt;&lt;p&gt;&lt;a href="http://www.javaworld.com/javaworld/jw-03-2002/jw-0301-dao.html"&gt;From JavaWorld&lt;/a&gt;&lt;/p&gt;&lt;h1&gt;&lt;a href="http://java.sun.com/blueprints/corej2eepatterns/Patterns/SessionFacade.html"&gt;&lt;span style="font-size:100%;"&gt;Core J2EE Patterns - Session Facade&lt;/span&gt;&lt;/a&gt;&lt;/h1&gt;&lt;br /&gt;&lt;h1&gt;&lt;a href="http://www.ibm.com/developerworks/java/library/j-genericdao.html"&gt;&lt;span style="font-size:100%;"&gt;Don't repeat the DAO!&lt;/span&gt;&lt;/a&gt;&lt;/h1&gt;&lt;a href="http://www.adam-bien.com/roller/abien/entry/jpa_ejb3_killed_the_dao"&gt;jpa-ejb killed dao&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.adam-bien.com/roller/abien/entry/jpa_ejb3_killed_the_dao"&gt;&lt;p class="entryTitle"&gt;JPA/EJB3 killed the DAO&lt;/p&gt;&lt;/a&gt;         &lt;p class="entryContent"&gt;                                 Regarding to the &lt;a href="http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html" target="_blank"&gt;abstract of the DAO-Pattern&lt;/a&gt;: "Access to data varies depending on the source of the data. Access to persistent storage, such as to a database, varies greatly depending on the type of storage (relational databases, object-oriented databases, flat files, and so forth) and the vendor implementation." the DAO tries to decouple the business logic from the proprietary resource. The solution to the problem is the following: "...The DataAccessObject is the primary object of this pattern. The DataAccessObject abstracts the underlying data access implementation for the BusinessObject to enable transparent access to the data source. The BusinessObject also delegates data load and store operations to the DataAccessObject..." [&lt;a href="http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html" target="_blank"&gt;Core J2EE Patterns&lt;/a&gt;].&lt;br /&gt;&lt;br /&gt;In the practise the DAO-Pattern was often realized by the following items:&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;DAO-Interface (provided a datasource-neutral interface)&lt;/li&gt;&lt;li&gt;DAO-Implementation (=access to the datasource implementation)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;DAO-Factory (the creation of the implementation)&lt;/li&gt;&lt;li&gt;Optional: ServiceLocator (location of resources in JNDI)&lt;/li&gt;&lt;/ul&gt;The main problem in J2EE was the insufficient power of CMP 2.0. The limited query capabilities, no access to native SQL and lack of dynamic queries forced the developers to access the database using plain-JDBC. It was a very good idea to encapsulate the database access behind a replaceable and mockable implementation.&lt;br /&gt;In EJB 3/Java EE 5 environment there is no need to use the low level JDBC to access the database any more. Actually you can use generic, but powerful Query Lanaguae, as well as Native SQL to fetch not only the persistent objects, but also data transfer objects and even primitive data types as well. It is even possible to execute update and delete statements. The JPA comes already with the EntityManager which provides already generic data access functionality. The usage cannot be simpler. The EntityManager will be just injected to the bean-class:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Courier New,Courier,mono;"&gt;@Stateless&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New,Courier,mono;"&gt;public class CustomerMgrBean implements CustomerMgr{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Courier New,Courier,mono;"&gt;    @PersistenceContext&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New,Courier,mono;"&gt;    private EntityManager em;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It's just one liner. The DAO pattern is actually no more interesting for general data access, but is still needed to access data from stored procedures, flat files etc. However the bean above can be considered as a "DAO", but very streamlined one...&lt;br /&gt;You will find some examples in &lt;a href="https://p4j5.dev.java.net/" target="_blank"&gt;p4j5&lt;/a&gt; - feel free to participate.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/677131969527136022-4601397417134010031?l=mightyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/4601397417134010031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=677131969527136022&amp;postID=4601397417134010031' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/4601397417134010031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/4601397417134010031'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/2009/04/dao-links.html' title='DAO Links'/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-677131969527136022.post-8704457286316146598</id><published>2009-04-28T10:28:00.000-07:00</published><updated>2009-04-28T10:51:14.238-07:00</updated><title type='text'>Faking css position: fixed in Internet Explorer 6</title><content type='html'>&lt;a href="http://ryanfait.com/position-fixed-ie6/"&gt;Useful link for IE6 css hack&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.howtocreate.co.uk/tutorials/jsexamples/statlogo.html"&gt;Try at last&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.finefrog.com/2007/02/26/faking-css-position-fixed-in-internet-explorer-6/"&gt;Another How to fix div position using javascript in IE 6.0&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This is a trick that I have been doing for some time, but now that Internet Explorer 7 is out and it supports position fixed in css; I think this trick will been even more useful now that it will allow web developers to take better advantage of css and at the same time not leave out the Internet Explorer 6 user base. I am posting this here because I sent this to a friend a couple days ago and thought others might be able to use it as well.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The trick is really quite basic. For simplicity I am just putting this example inline, but you can put it where you want.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;First your declare your intended style for IE7 (and basically every other browser):&lt;/p&gt;&lt;br /&gt;&lt;pre name="code" class="css"&gt;&lt;br /&gt;&amp;lt;style type="text/css"&amp;gt;&lt;br /&gt; #fixed_div {&lt;br /&gt;   position: fixed;&lt;br /&gt;   top: 0px; /* tweak this according to placement */&lt;br /&gt;   left: 0px; /* tweak this according to placement */&lt;br /&gt;   /* add additional styling, etc. */&lt;br /&gt; }&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Second add in your Javascript function which is going to be doing your movement for IE6:&lt;/p&gt;&lt;br /&gt;&lt;pre name="code" class="js"&gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&lt;br /&gt;function move_box() {&lt;br /&gt;   var offset = 0; // set offset (likely equal to your css top)&lt;br /&gt;   var element = document.getElementById('fixed_div');&lt;br /&gt;&lt;br /&gt;   element.style.top = (document.documentElement.scrollTop + offset) + 'px';&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Then declare the element itself:&lt;/p&gt;&lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;div id="fixed_div"&amp;gt;I am fixed, even in IE6&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Lastly, implement your fix for IE6 only:&lt;/p&gt;&lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;!--[if lt IE 7]&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;style type="text/css"&amp;gt;&lt;br /&gt; #fixed_div {&lt;br /&gt;   position: absolute;&lt;br /&gt;   top: 0px; /* tweak this according to placement */&lt;br /&gt;   left: 0px; /* tweak this according to placement */&lt;br /&gt; }&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;window.setInterval(move_box, 100);&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;![endif]--&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;I usually put this last part right before the end of the body (I guess you could just put the whole script there). This is because you don't want the window.setInterval to fire before your fixed div is declared. You could use the body onload but I try to stay away from that because I know it is popular for other uses on more advanced pages and I don't want to run the risk of interfering.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Here is the whole script put together:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;. . .&lt;br /&gt;&amp;lt;style type="text/css"&amp;gt;&lt;br /&gt; #fixed_div {&lt;br /&gt;   position: fixed;&lt;br /&gt;   top: 0px; /* tweak this according to placement */&lt;br /&gt;   left: 0px; /* tweak this according to placement */&lt;br /&gt;   /* add additional styling, etc. */&lt;br /&gt; }&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&lt;br /&gt;function move_box() {&lt;br /&gt;   var offset = 0; // set offset (likely equal to your css top)&lt;br /&gt;   var element = document.getElementById('fixed_div');&lt;br /&gt;&lt;br /&gt;   element.style.top = (document.documentElement.scrollTop + offset) + 'px';&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;. . .&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;. . .&lt;br /&gt;&amp;lt;div id="fixed_div"&amp;gt;I am fixed, even in IE6&amp;lt;/div&amp;gt;&lt;br /&gt;. . .&lt;br /&gt;&lt;br /&gt;&amp;lt;!--[if lt IE 7]&amp;gt;&lt;br /&gt;&amp;lt;style type="text/css"&amp;gt;&lt;br /&gt; #fixed_div {&lt;br /&gt;   position: absolute;&lt;br /&gt;   top: 0px; /* tweak this according to placement */&lt;br /&gt;   left: 0px; /* tweak this according to placement */&lt;br /&gt; }&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;window.setInterval(move_box, 100);&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;![endif]--&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;NOTE: This will only work properly on pages that have a valid &lt;a onclick="javascript:pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/Doctype');" href="http://en.wikipedia.org/wiki/Doctype"&gt;doctype definition&lt;/a&gt;. If you don't use one [you should start or] you need to change document.documentElement.scrollTop to document.body.scrollTop in the move_box function.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;You can also modify this script to apply to multiple elements by passing arguments to the function or something similar. If you are doing multiple elements on a single page, you may want to consider setting up some kind of Javascript array that tracks what elements need to be corrected, this could save you from having multiple window.setInterval instances running.&lt;/p&gt;http://www.finefrog.com/_code/59.html&lt;br /&gt;&lt;br /&gt;http://www.howtocreate.co.uk/fixedPosition.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/677131969527136022-8704457286316146598?l=mightyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/8704457286316146598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=677131969527136022&amp;postID=8704457286316146598' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/8704457286316146598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/8704457286316146598'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/2009/04/faking-css-position-fixed-in-internet.html' title='Faking css position: fixed in Internet Explorer 6'/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-677131969527136022.post-2080281200112687333</id><published>2009-04-24T15:17:00.000-07:00</published><updated>2009-04-24T15:44:54.801-07:00</updated><title type='text'>Some Useful Frameworks links</title><content type='html'>&lt;a href="http://www.jspresso.org/"&gt;Java RIA Framework&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.nobbi.com/monitor/indexen.html"&gt;SMS Software&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://twit88.com/blog/2008/10/04/java-develop-distributed-desktop-application/"&gt;Very useful Site&lt;/a&gt;&lt;br /&gt;&lt;h1 style="font-weight: normal;"&gt;&lt;a href="http://architects.dzone.com/news/10-papers-every-software"&gt;&lt;span style="font-size:100%;"&gt;10 Papers Every Software Architect Should Read (At Least Twice)&lt;/span&gt;&lt;/a&gt;&lt;/h1&gt;&lt;a href="http://labs.google.com/papers/mapreduce.html"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Research Publications &gt;&gt; &lt;/b&gt;&lt;b&gt;MapReduce: Simplified Data Processing on Large Clusters&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://research.sun.com/techrep/2007/smli_tr-2007-166.pdf"&gt;&lt;span style="font-size:85%;"&gt;sun research paper&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/677131969527136022-2080281200112687333?l=mightyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/2080281200112687333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=677131969527136022&amp;postID=2080281200112687333' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/2080281200112687333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/2080281200112687333'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/2009/04/some-useful-frameworks-links.html' title='Some Useful Frameworks links'/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-677131969527136022.post-2053484357327244831</id><published>2009-04-22T13:07:00.000-07:00</published><updated>2009-04-22T13:12:43.413-07:00</updated><title type='text'>Fluid Layout Template  - Fixed Buttons Div</title><content type='html'>&lt;p&gt;Reference : http://www.howtocreate.co.uk/fixedPosition.html&lt;/p&gt;&lt;p&gt;http://en.allexperts.com/q/Javascript-1520/position-fixed.htm&lt;/p&gt;&lt;p&gt;http://www.jtricks.com/javascript/navigation/fixed_menu.html&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Put in head tag: &lt;style type="text/css"&gt;&lt;br /&gt;#fixme { position: absolute; left: 200px; top: 150px; }&lt;br /&gt;#fixmetoo { position: absolute; right: 0px; bottom: 0px; }&lt;br /&gt;div &gt; div#fixme { position: fixed; }&lt;br /&gt;div &gt; div#fixmetoo { position: fixed; }&lt;br /&gt;pre.fixit { overflow:auto;border-left:1px dashed #000;border-right:1px dashed #000;padding-left:2px; }&lt;br /&gt;  &lt;/style&gt;&lt;!--[if gte IE 5.5]&gt;&lt;![if lt IE 7]&gt;&lt;br /&gt;  &lt;style type="text/css"&gt;&lt;br /&gt;div#fixme {&lt;br /&gt;left: expression( ( 200 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );&lt;br /&gt;top: expression( ( 150 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );&lt;br /&gt;}&lt;br /&gt;div#fixmetoo {&lt;br /&gt;right: auto; bottom: auto;&lt;br /&gt;left: expression( ( 0 - fixmetoo.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );&lt;br /&gt;top: expression( ( 0 - fixmetoo.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );&lt;br /&gt;}&lt;br /&gt;  &lt;/style&gt;&lt;br /&gt;  &lt;![endif]&gt;&lt;![endif]--&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Within body tag:&lt;/p&gt;&lt;p&gt;&lt;form id="frmMain" onsubmit="alert('hi')"&gt;&lt;br /&gt;&lt;div id="content"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Deprecated&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This fix is deprecated and is no longer supported (meaning that I will not help you to get it working with your pages). It was only written to fill the gap while waiting for Internet Explorer to implement fixed positioning. That has now happened in IE 7. Although this fix can make it work in IE 6 as well, that is counter productive for the future of the Web. IE 6 is a major problem to Web developers (IE 7 is a problem as well, but for now, let's overlook that, since it does at least implement fixed positioning), and the sooner it stops being used, the better.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Instead of using this hack, users of IE 6 should be encouraged to upgrade to IE 7. Users who cannot upgrade to IE 7 (because IE 7 is not being released for most Windows operating systems) should use a better browser, such as Opera or Firefox. They have been abandoned by Microsoft.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;What is position: fixed;?&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;position: fixed;&lt;/code&gt; is an alternative to &lt;a href="tutorials/css/position"&gt;&lt;code&gt;position: absolute;&lt;/code&gt; &lt;code&gt;position: relative;&lt;/code&gt;&lt;/a&gt; and &lt;code&gt;position: static;&lt;/code&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;position: fixed;&lt;/code&gt; is basically the same as &lt;code&gt;position: absolute;&lt;/code&gt; except that when the user scrolls the page, the element&lt;br /&gt;does not scroll with it, it just says exactly where it was. There are many pages that want to use this in order to position&lt;br /&gt;logos or menus.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;What is wrong with position: fixed;?&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Well, ... nothing. The problem is that the most popular browser - Internet Explorer for Windows - does not understand&lt;br /&gt;it, and instead of reverting to &lt;code&gt;position: absolute;&lt;/code&gt; which would be better than nothing, it reverts to &lt;code&gt;position: static;&lt;/code&gt; as&lt;br /&gt;specified by the CSS standard. This has the same effect as having no positioning at all. Note that IE 7 from beta 2 upwards&lt;br /&gt;&lt;em&gt;does&lt;/em&gt; support &lt;code&gt;position: fixed;&lt;/code&gt; (if you use a document type declaration that triggers &lt;a href="http://www.hut.fi/u/hsivonen/doctype.html"&gt;strict mode&lt;/a&gt;) so I will exclude IE 7 from this fix.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;As a result, serveral people write &lt;a href="tutorials/jsexamples/statlogo.html"&gt;scripts&lt;/a&gt; that use setInterval to reposition an absolutely positioned element every few&lt;br /&gt;miliseconds, or (ignoring Netscape 4) when the onscroll event is detected. This produces a slightly jerky effect. It would&lt;br /&gt;be better if the &lt;code&gt;position: fixed;&lt;/code&gt; style could be applied in browsers that supported it, and browsers that didn't could use&lt;br /&gt;&lt;code&gt;position: absolute;&lt;/code&gt; and JavaScript. Some authors use the &lt;code&gt;&amp;gt;&lt;/code&gt; CSS selector to isolate Internet Explorer and leave the element&lt;br /&gt;positioned absolutely in that browser, without the scrolling effect.&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;div#fixme { position: absolute; left: 0px; top: 0px; }&lt;br /&gt;body &amp;gt; div#fixme { position: fixed; }&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;It produces a reasonably nice effect, but it is even better when coupled with a JavaScript that checks if the position is&lt;br /&gt;'absolute' using the currentStyle property, and then repositioning the element when the onscroll event is detected.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="fixme" style="border:2px solid #000;border-top:none;border-left:none;background-color:#fff;text-align:center;padding:10px;"&gt;&lt;br /&gt;F&lt;br /&gt;i&lt;br /&gt;x&lt;br /&gt; &lt;br /&gt;M&lt;br /&gt;e&lt;br /&gt;&lt;br /&gt;&lt;input type="submit" value="Click me"&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div id="fixmetoo" style="border:2px solid #000;border-bottom:none;border-right:none;background-color:#fff;text-align:center;padding:10px;"&gt;&lt;br /&gt;F&lt;br /&gt;i&lt;br /&gt;x&lt;br /&gt; &lt;br /&gt;M&lt;br /&gt;e&lt;br /&gt; &lt;br /&gt;T&lt;br /&gt;o&lt;br /&gt;o&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/677131969527136022-2053484357327244831?l=mightyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/2053484357327244831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=677131969527136022&amp;postID=2053484357327244831' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/2053484357327244831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/2053484357327244831'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/2009/04/fluid-layout-template-fixed-buttons-div.html' title='Fluid Layout Template  - Fixed Buttons Div'/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-677131969527136022.post-5325215060751224181</id><published>2009-04-17T12:32:00.001-07:00</published><updated>2009-04-18T11:39:04.933-07:00</updated><title type='text'>Send mail using javamail and gmail</title><content type='html'>&lt;p&gt;This is my fully tested code. You need javamail 1.4 api to run this. If u find any kind of exception check ur system firewall that is blocking to send mail.&lt;/p&gt;&lt;p&gt;Add mail.jar and activation.jar in ur buildpath and run the code:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;import java.io.File;&lt;br /&gt;import java.util.Properties;&lt;br /&gt;&lt;br /&gt;import javax.activation.DataHandler;&lt;br /&gt;import javax.activation.DataSource;&lt;br /&gt;import javax.activation.FileDataSource;&lt;br /&gt;import javax.mail.Message;&lt;br /&gt;import javax.mail.Multipart;&lt;br /&gt;import javax.mail.Session;&lt;br /&gt;import javax.mail.Transport;&lt;br /&gt;import javax.mail.internet.InternetAddress;&lt;br /&gt;import javax.mail.internet.MimeBodyPart;&lt;br /&gt;import javax.mail.internet.MimeMessage;&lt;br /&gt;import javax.mail.internet.MimeMultipart;&lt;br /&gt;&lt;br /&gt;public class SimpleSSLMail {&lt;br /&gt;&lt;br /&gt;    private static final String SMTP_HOST_NAME = "smtp.gmail.com";&lt;br /&gt;    private static final int SMTP_HOST_PORT = 465;&lt;br /&gt;    private static final String SMTP_AUTH_USER = "xxxxx@gmail.com";&lt;br /&gt;    private static final String SMTP_AUTH_PWD  = "xxxx";&lt;br /&gt;&lt;br /&gt;    public static void main(String[] args) throws Exception{&lt;br /&gt;       new SimpleSSLMail().test();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void test() throws Exception{&lt;br /&gt;        Properties props = new Properties();&lt;br /&gt;&lt;br /&gt;        props.put("mail.transport.protocol", "smtps");&lt;br /&gt;        props.put("mail.smtps.host", SMTP_HOST_NAME);&lt;br /&gt;        props.put("mail.smtps.auth", "true");&lt;br /&gt;        // props.put("mail.smtps.quitwait", "false");&lt;br /&gt;&lt;br /&gt;        Session mailSession = Session.getDefaultInstance(props);&lt;br /&gt;        &lt;br /&gt;        mailSession.setDebug(true);&lt;br /&gt;        &lt;br /&gt;        Transport transport = mailSession.getTransport();&lt;br /&gt;&lt;br /&gt;        MimeMessage message = new MimeMessage(mailSession);&lt;br /&gt;        message.setSubject("Hello Attatched world");&lt;br /&gt;        &lt;br /&gt;        //message.setContent("This is a test", "text/plain");&lt;br /&gt;        &lt;br /&gt;        // content&lt;br /&gt;        MimeBodyPart mimeBodyPart = new MimeBodyPart();&lt;br /&gt;                      &lt;br /&gt;        //mimeBodyPart.setText("Link goes here:");        &lt;br /&gt;        String strLink = " Link goes here : http://www.google.com";&lt;br /&gt;        mimeBodyPart.setText(strLink);&lt;br /&gt;        &lt;br /&gt;        // multipart is the main content holder&lt;br /&gt;        Multipart multipart = new MimeMultipart();&lt;br /&gt;        multipart.addBodyPart(mimeBodyPart);&lt;br /&gt;        &lt;br /&gt;        // Part two is attachment&lt;br /&gt;        File f = new File("F:\\angel.JPG");&lt;br /&gt;        if(f.exists() &amp;amp;&amp;amp; f.isFile())&lt;br /&gt;        {&lt;br /&gt;         System.out.println("attatching file......."+f.getName());&lt;br /&gt;         mimeBodyPart = new MimeBodyPart();&lt;br /&gt;         DataSource source = new FileDataSource(f);         &lt;br /&gt;         DataHandler handler = new DataHandler(source);&lt;br /&gt;         mimeBodyPart.setDataHandler(handler);&lt;br /&gt;         &lt;br /&gt;         mimeBodyPart.setFileName(f.getName());&lt;br /&gt;         &lt;br /&gt;         multipart.addBodyPart(mimeBodyPart);&lt;br /&gt;        &lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        // add multipart data to message&lt;br /&gt;        message.setContent(multipart);&lt;br /&gt;        &lt;br /&gt;        &lt;br /&gt;        message.addRecipient(Message.RecipientType.TO,&lt;br /&gt;             new InternetAddress("xxxx@yahoo.com"));&lt;br /&gt;&lt;br /&gt;        transport.connect&lt;br /&gt;          (SMTP_HOST_NAME, SMTP_HOST_PORT, SMTP_AUTH_USER, SMTP_AUTH_PWD);&lt;br /&gt;&lt;br /&gt;             &lt;br /&gt;        transport.sendMessage(message,&lt;br /&gt;            message.getRecipients(Message.RecipientType.TO));&lt;br /&gt;        transport.close();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/677131969527136022-5325215060751224181?l=mightyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/5325215060751224181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=677131969527136022&amp;postID=5325215060751224181' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/5325215060751224181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/5325215060751224181'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/2009/04/send-mail-using-javamail-and-gmail.html' title='Send mail using javamail and gmail'/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-677131969527136022.post-8551307807449555963</id><published>2009-03-25T10:49:00.000-07:00</published><updated>2009-03-25T10:54:45.180-07:00</updated><title type='text'>Lets Start MapServer</title><content type='html'>Here we go&lt;br /&gt;&lt;ul&gt;&lt;li&gt; &lt;a href="http://www.mapserver.org/"&gt;Home Page of MapServer&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://ms.gis.umn.edu/"&gt;UMN Map Server&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://umn.mapserver.ch/index_en.php"&gt;Tools to Create Map Files&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.mobilegeographics.com/mapserver/"&gt;Simple Recipes for UMN MapServer&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/677131969527136022-8551307807449555963?l=mightyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/8551307807449555963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=677131969527136022&amp;postID=8551307807449555963' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/8551307807449555963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/8551307807449555963'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/2009/03/lets-start-mapserver.html' title='Lets Start MapServer'/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-677131969527136022.post-5846126564834338530</id><published>2009-03-18T10:43:00.000-07:00</published><updated>2009-03-25T11:02:49.268-07:00</updated><title type='text'>ORA-1017: invalid username/password; logon denied</title><content type='html'>This problem occur in oracle 11g. This is because login information case sensitivity. By default in oracle 11g, 10 versions have login case sensitivity value set true - you have to change it to false to resolve it. Just execute the following command in oracle :&lt;br /&gt;&lt;br /&gt;       ALTER SYSTEM SET SEC_CASE_SENSITIVE_LOGON = FALSE&lt;br /&gt;&lt;br /&gt;Hope it will help you cause it really helped me a lot!!!&lt;br /&gt;&lt;br /&gt;For further information visit following links:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://forums.oracle.com/forums/thread.jspa?messageID=2196228"&gt;Solution 1 From Oracle Forum&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/B28359_01/network.111/b28531/authentication.htm#CHDJDCGI"&gt;Configure Oracle Authentication&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://forums.oracle.com/forums/thread.jspa?threadID=376075"&gt;Another Solution&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/677131969527136022-5846126564834338530?l=mightyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/5846126564834338530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=677131969527136022&amp;postID=5846126564834338530' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/5846126564834338530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/5846126564834338530'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/2009/03/ora-1017-invalid-usernamepassword-logon.html' title='ORA-1017: invalid username/password; logon denied'/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-677131969527136022.post-4637274376427210512</id><published>2009-02-06T10:35:00.000-08:00</published><updated>2009-02-06T10:51:12.205-08:00</updated><title type='text'>Pagination in Hibernate and EJB3</title><content type='html'>This class with SQL Server 2000 and jTDS 0.8.1 and it works very well.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt; * Created on Oct 27, 2004&lt;br /&gt; */&lt;br /&gt;package com.ugs.it.salescentre.navigation;&lt;br /&gt;&lt;br /&gt;import java.util.List;&lt;br /&gt;&lt;br /&gt;import org.apache.log4j.Logger;&lt;br /&gt;&lt;br /&gt;import com.ugs.it.salescentre.logger.SalesCentreLogger;&lt;br /&gt;&lt;br /&gt;import net.sf.hibernate.HibernateException;&lt;br /&gt;import net.sf.hibernate.Query;&lt;br /&gt;import net.sf.hibernate.ScrollableResults;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * This class provides pagination for displaying results from a large result set&lt;br /&gt; * over a number of pages (i.e. with a given number of results per page).&lt;br /&gt; *&lt;br /&gt; * Taken from http://blog.hibernate.org/cgi-bin/blosxom.cgi/2004/08/14#fn.html.&lt;br /&gt; *&lt;br /&gt; * @author Gavin King&lt;br /&gt; * @author Eric Broyles&lt;br /&gt; */&lt;br /&gt;public class Page&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    private List results;&lt;br /&gt;    private int pageSize;&lt;br /&gt;    private int page;&lt;br /&gt;    private ScrollableResults scrollableResults;&lt;br /&gt;    private int totalResults = 0;&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * Construct a new Page. Page numbers are zero-based, so the&lt;br /&gt;     * first page is page 0.&lt;br /&gt;     *&lt;br /&gt;     * @param query&lt;br /&gt;     *            the Hibernate Query&lt;br /&gt;     * @param page&lt;br /&gt;     *            the page number (zero-based)&lt;br /&gt;     * @param pageSize&lt;br /&gt;     *            the number of results to display on the page&lt;br /&gt;     */&lt;br /&gt;    public Page(Query query, int page, int pageSize)&lt;br /&gt;    {&lt;br /&gt;        this.page = page;&lt;br /&gt;        this.pageSize = pageSize;&lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;            scrollableResults = query.scroll();&lt;br /&gt;            /*&lt;br /&gt;             * We set the max results to one more than the specfied pageSize to&lt;br /&gt;             * determine if any more results exist (i.e. if there is a next page&lt;br /&gt;             * to display). The result set is trimmed down to just the pageSize&lt;br /&gt;             * before being displayed later (in getList()).&lt;br /&gt;             */&lt;br /&gt;            results = query.setFirstResult(page * pageSize).setMaxResults(&lt;br /&gt;                    pageSize + 1).list();&lt;br /&gt;        }&lt;br /&gt;        catch (HibernateException e)&lt;br /&gt;        {&lt;br /&gt;            getLogger().error(&lt;br /&gt;                    "Failed to get paginated results: " + e.getMessage());&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public boolean isFirstPage()&lt;br /&gt;    {&lt;br /&gt;        return page == 0;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public boolean isLastPage()&lt;br /&gt;    {&lt;br /&gt;        return page &gt;= getLastPageNumber();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public boolean hasNextPage()&lt;br /&gt;    {&lt;br /&gt;        return results.size() &gt; pageSize;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public boolean hasPreviousPage()&lt;br /&gt;    {&lt;br /&gt;        return page &gt; 0;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public int getLastPageNumber()&lt;br /&gt;    {&lt;br /&gt;        /*&lt;br /&gt;         * We use the Math.floor() method because page numbers are zero-based&lt;br /&gt;         * (i.e. the first page is page 0).&lt;br /&gt;         */&lt;br /&gt;        double totalResults = new Integer(getTotalResults()).doubleValue();&lt;br /&gt;        return new Double(Math.floor(totalResults / pageSize)).intValue();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public List getList()&lt;br /&gt;    {&lt;br /&gt;        /*&lt;br /&gt;         * Since we retrieved one more than the specified pageSize when the&lt;br /&gt;         * class was constructed, we now trim it down to the pageSize if a next&lt;br /&gt;         * page exists.&lt;br /&gt;         */&lt;br /&gt;        return hasNextPage() ? results.subList(0, pageSize) : results;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public Logger getLogger()&lt;br /&gt;    {&lt;br /&gt;        return SalesCentreLogger.getStaticLogger(this);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public int getTotalResults()&lt;br /&gt;    {&lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;            getScrollableResults().last();&lt;br /&gt;            totalResults = getScrollableResults().getRowNumber();&lt;br /&gt;        }&lt;br /&gt;        catch (HibernateException e)&lt;br /&gt;        {&lt;br /&gt;            getLogger().error(&lt;br /&gt;                    "Failed to get last row number from scollable results: "&lt;br /&gt;                            + e.getMessage());&lt;br /&gt;        }&lt;br /&gt;        return totalResults;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public int getFirstResultNumber()&lt;br /&gt;    {&lt;br /&gt;        return page * pageSize + 1;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public int getLastResultNumber()&lt;br /&gt;    {&lt;br /&gt;        int fullPage = getFirstResultNumber() + pageSize - 1;&lt;br /&gt;        return getTotalResults() &lt; fullPage ? getTotalResults() : fullPage;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public int getNextPageNumber()&lt;br /&gt;    {&lt;br /&gt;        return page + 1;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public int getPreviousPageNumber()&lt;br /&gt;    {&lt;br /&gt;        return page - 1;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    protected ScrollableResults getScrollableResults()&lt;br /&gt;    {&lt;br /&gt;        return scrollableResults;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blog.hibernate.org/1677.lace#comments"&gt;Reference&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/677131969527136022-4637274376427210512?l=mightyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/4637274376427210512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=677131969527136022&amp;postID=4637274376427210512' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/4637274376427210512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/4637274376427210512'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/2009/02/pagination-in-hibernate-and-ejb3.html' title='Pagination in Hibernate and EJB3'/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-677131969527136022.post-5908745800845652746</id><published>2009-01-07T10:15:00.000-08:00</published><updated>2009-01-07T12:35:58.864-08:00</updated><title type='text'>Java Important Tips</title><content type='html'>&lt;a href="http://www.hibernate.org/118.html#A7"&gt;Hibernate Collection Sorting&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.javajobs.net/index.php"&gt;Java Jobs&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://javapapers.com/"&gt;Java Papers&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://faqs.javabeat.net/servlet/java-servlets-interview-questions-faqs.php"&gt;Servlet&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.allapplabs.com/interview_questions/servlet_interview_questions.htm"&gt;Servlet Interview Questions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.roseindia.net/tutorialsearch/?t=Java+Tutorials&amp;amp;x=46&amp;amp;y=24"&gt;RoseIndia's Java&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.javaworld.com/javaworld/jw-12-2002/jw-1227-sort.html?page=2"&gt;Sort Java (for sql query generated / except hibernate relational data) Collections&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://mindprod.com/jgloss/sort.html"&gt;Full Example to sort Collection&lt;/a&gt;&lt;br /&gt;&lt;h2&gt;Generic Sorts&lt;/h2&gt; If you write a sort for a &lt;span class="jinterface"&gt;List&lt;/span&gt;, e.g. &lt;span class="jclass"&gt;ArrayList&lt;/span&gt;, with proper generics, it will work on collections of any type that supports &lt;span class="jinterface"&gt;Comparable&lt;/span&gt; or &lt;span class="jclass"&gt;Comparator&lt;/span&gt;. To see how to pull it off, have a look at the source for any of my sorts, or Sun’s sort. &lt;p&gt; However, because of Java’s lack of orthogonality, your &lt;span class="jinterface"&gt;List&lt;/span&gt; sort won’t work for arrays of such &lt;span class="jclass"&gt;Object&lt;/span&gt;s. You need to write very similar code to do that. Even that array version won’t sort an array of primitives such as &lt;span class="keyword"&gt;long&lt;/span&gt;, &lt;span class="keyword"&gt;int&lt;/span&gt; or &lt;span class="keyword"&gt;byte&lt;/span&gt;. You have to write yet another slightly different version of the sort to handle each type of primitive. &lt;/p&gt;&lt;h2&gt;&lt;a name="EXAMPLE"&gt;&lt;/a&gt;Complete Example:&lt;/h2&gt;&lt;span class="importantkeyword"&gt;package &lt;/span&gt;&lt;span class="jvar"&gt;com&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;mindprod&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;example&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;pre class="java"&gt;&lt;br /&gt;&lt;span class="keyword"&gt;import &lt;/span&gt;&lt;span class="jvar"&gt;com&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;mindprod&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;palette&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jclass"&gt;NamedColor&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jclass"&gt;Alphabetically&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="keyword"&gt;import &lt;/span&gt;&lt;span class="jvar"&gt;com&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;mindprod&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;palette&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jclass"&gt;NamedColor&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jclass"&gt;ByRGB&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="keyword"&gt;import &lt;/span&gt;&lt;span class="jvar"&gt;java&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;awt&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jclass"&gt;Color&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="keyword"&gt;import static &lt;/span&gt;&lt;span class="jvar"&gt;java&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;lang&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jclass"&gt;System&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;out&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="keyword"&gt;import &lt;/span&gt;&lt;span class="jvar"&gt;java&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;util&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jclass"&gt;ArrayList&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="keyword"&gt;import &lt;/span&gt;&lt;span class="jvar"&gt;java&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;util&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jclass"&gt;Collections&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="keyword"&gt;import &lt;/span&gt;&lt;span class="jvar"&gt;java&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;util&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jclass"&gt;Comparator&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt; * Demonstrate how to sort a Collection in Various orders using Sun's Collections.sort&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt; * Created by IntelliJ IDEA.&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt; *&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt; * @author Roedy Green&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt; */&lt;/span&gt;&lt;br /&gt;&lt;span class="keyword"&gt;public &lt;/span&gt;&lt;span class="importantkeyword"&gt;class &lt;/span&gt;&lt;span class="jclass"&gt;TestSort&lt;/span&gt;&lt;br /&gt;  &lt;span class="fence1"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="commentslashslash"&gt;// --------------------------- main() method ---------------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span class="keyword"&gt;public static void &lt;/span&gt;&lt;span class="jmethod"&gt;main&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jclass"&gt;String&lt;/span&gt;&lt;span class="fence1"&gt;[&lt;/span&gt;&lt;span class="fence1"&gt;]&lt;/span&gt; &lt;span class="jvardef"&gt;args &lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt;&lt;br /&gt;      &lt;span class="fence2"&gt;{&lt;/span&gt;&lt;br /&gt;      &lt;span class="commentslashslash"&gt;// build ArrayList of Animals&lt;/span&gt;&lt;br /&gt;      &lt;span class="jclass"&gt;ArrayList&lt;/span&gt;&lt;span class="operator"&gt;&lt;&lt;/span&gt;&lt;span class="jclass"&gt;Animal&lt;/span&gt;&lt;span class="operator"&gt;&gt; &lt;/span&gt;&lt;span class="jvar"&gt;animals &lt;/span&gt;&lt;span class="operator"&gt;= &lt;/span&gt;&lt;span class="keyword"&gt;new &lt;/span&gt;&lt;span class="jclass"&gt;ArrayList&lt;/span&gt;&lt;span class="operator"&gt;&lt;&lt;/span&gt;&lt;span class="jclass"&gt;Animal&lt;/span&gt;&lt;span class="operator"&gt;&gt;&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="decimallow"&gt;5 &lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="jvar"&gt;animals&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;add&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="keyword"&gt;new &lt;/span&gt;&lt;span class="jclassdef"&gt;Animal&lt;/span&gt;&lt;span class="fence2"&gt;(&lt;/span&gt; &lt;span class="string"&gt;"panther"&lt;/span&gt;&lt;span class="operator"&gt;, &lt;/span&gt;&lt;span class="jclass"&gt;Color&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jconstant"&gt;BLACK&lt;/span&gt;&lt;span class="operator"&gt;, &lt;/span&gt;&lt;span class="decimallow"&gt;4 &lt;/span&gt;&lt;span class="fence2"&gt;)&lt;/span&gt; &lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="jvar"&gt;animals&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;add&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="keyword"&gt;new &lt;/span&gt;&lt;span class="jclassdef"&gt;Animal&lt;/span&gt;&lt;span class="fence2"&gt;(&lt;/span&gt; &lt;span class="string"&gt;"frog"&lt;/span&gt;&lt;span class="operator"&gt;, &lt;/span&gt;&lt;span class="jclass"&gt;Color&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jconstant"&gt;GREEN&lt;/span&gt;&lt;span class="operator"&gt;, &lt;/span&gt;&lt;span class="decimallow"&gt;4 &lt;/span&gt;&lt;span class="fence2"&gt;)&lt;/span&gt; &lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="jvar"&gt;animals&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;add&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="keyword"&gt;new &lt;/span&gt;&lt;span class="jclassdef"&gt;Animal&lt;/span&gt;&lt;span class="fence2"&gt;(&lt;/span&gt; &lt;span class="string"&gt;"crab"&lt;/span&gt;&lt;span class="operator"&gt;, &lt;/span&gt;&lt;span class="jclass"&gt;Color&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jconstant"&gt;RED&lt;/span&gt;&lt;span class="operator"&gt;, &lt;/span&gt;&lt;span class="decimallow"&gt;10 &lt;/span&gt;&lt;span class="fence2"&gt;)&lt;/span&gt; &lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="jvar"&gt;animals&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;add&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="keyword"&gt;new &lt;/span&gt;&lt;span class="jclassdef"&gt;Animal&lt;/span&gt;&lt;span class="fence2"&gt;(&lt;/span&gt; &lt;span class="string"&gt;"elephant"&lt;/span&gt;&lt;span class="operator"&gt;, &lt;/span&gt;&lt;span class="jclass"&gt;Color&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jconstant"&gt;GRAY&lt;/span&gt;&lt;span class="operator"&gt;, &lt;/span&gt;&lt;span class="decimallow"&gt;2 &lt;/span&gt;&lt;span class="fence2"&gt;)&lt;/span&gt; &lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="jvar"&gt;animals&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;add&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="keyword"&gt;new &lt;/span&gt;&lt;span class="jclassdef"&gt;Animal&lt;/span&gt;&lt;span class="fence2"&gt;(&lt;/span&gt; &lt;span class="string"&gt;"spider"&lt;/span&gt;&lt;span class="operator"&gt;, &lt;/span&gt;&lt;span class="jclass"&gt;Color&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jconstant"&gt;BLACK&lt;/span&gt;&lt;span class="operator"&gt;, &lt;/span&gt;&lt;span class="decimallow"&gt;8 &lt;/span&gt;&lt;span class="fence2"&gt;)&lt;/span&gt; &lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      &lt;span class="jvar"&gt;out&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;println&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="string"&gt;"sort in Natural Order (by legs)"&lt;/span&gt; &lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="jclass"&gt;Collections&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;sort&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jvar"&gt;animals &lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="keyword"&gt;for &lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jclass"&gt;Animal &lt;/span&gt;&lt;span class="jvardef"&gt;animal &lt;/span&gt;&lt;span class="operator"&gt;: &lt;/span&gt;&lt;span class="jvar"&gt;animals &lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt;&lt;br /&gt;          &lt;span class="fence3"&gt;{&lt;/span&gt;&lt;br /&gt;          &lt;span class="jvar"&gt;out&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;println&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jvar"&gt;animal&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;toString&lt;/span&gt;&lt;span class="fence2"&gt;(&lt;/span&gt;&lt;span class="fence2"&gt;)&lt;/span&gt; &lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;          &lt;span class="fence3"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      &lt;span class="jvar"&gt;out&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;println&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="string"&gt;"sort in Reverse Natural Order (by legs)"&lt;/span&gt; &lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="jclass"&gt;Collections&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;sort&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jvar"&gt;animals&lt;/span&gt;&lt;span class="operator"&gt;, &lt;/span&gt;&lt;span class="jclass"&gt;Collections&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;reverseOrder&lt;/span&gt;&lt;span class="fence2"&gt;(&lt;/span&gt;&lt;span class="fence2"&gt;)&lt;/span&gt; &lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="keyword"&gt;for &lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jclass"&gt;Animal &lt;/span&gt;&lt;span class="jvardef"&gt;animal &lt;/span&gt;&lt;span class="operator"&gt;: &lt;/span&gt;&lt;span class="jvar"&gt;animals &lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt;&lt;br /&gt;          &lt;span class="fence3"&gt;{&lt;/span&gt;&lt;br /&gt;          &lt;span class="jvar"&gt;out&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;println&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jvar"&gt;animal&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;toString&lt;/span&gt;&lt;span class="fence2"&gt;(&lt;/span&gt;&lt;span class="fence2"&gt;)&lt;/span&gt; &lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;          &lt;span class="fence3"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      &lt;span class="jvar"&gt;out&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;println&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="string"&gt;"sort alphabetically"&lt;/span&gt; &lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="jclass"&gt;Collections&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;sort&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jvar"&gt;animals&lt;/span&gt;&lt;span class="operator"&gt;, &lt;/span&gt;&lt;span class="keyword"&gt;new &lt;/span&gt;&lt;span class="jclass"&gt;Animal&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jclassdef"&gt;Alphabetically&lt;/span&gt;&lt;span class="fence2"&gt;(&lt;/span&gt;&lt;span class="fence2"&gt;)&lt;/span&gt; &lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="keyword"&gt;for &lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jclass"&gt;Animal &lt;/span&gt;&lt;span class="jvardef"&gt;animal &lt;/span&gt;&lt;span class="operator"&gt;: &lt;/span&gt;&lt;span class="jvar"&gt;animals &lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt;&lt;br /&gt;          &lt;span class="fence3"&gt;{&lt;/span&gt;&lt;br /&gt;          &lt;span class="jvar"&gt;out&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;println&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jvar"&gt;animal&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;toString&lt;/span&gt;&lt;span class="fence2"&gt;(&lt;/span&gt;&lt;span class="fence2"&gt;)&lt;/span&gt; &lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;          &lt;span class="fence3"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      &lt;span class="jvar"&gt;out&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;println&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="string"&gt;"sort reverse alphabetically"&lt;/span&gt; &lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="jclass"&gt;Collections&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;sort&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jvar"&gt;animals&lt;/span&gt;&lt;span class="operator"&gt;, &lt;/span&gt;&lt;span class="jclass"&gt;Collections&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;reverseOrder&lt;/span&gt;&lt;span class="fence2"&gt;(&lt;/span&gt; &lt;span class="keyword"&gt;new &lt;/span&gt;&lt;span class="jclass"&gt;Animal&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jclassdef"&gt;Alphabetically&lt;/span&gt;&lt;span class="fence3"&gt;(&lt;/span&gt;&lt;span class="fence3"&gt;)&lt;/span&gt; &lt;span class="fence2"&gt;)&lt;/span&gt; &lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="keyword"&gt;for &lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jclass"&gt;Animal &lt;/span&gt;&lt;span class="jvardef"&gt;animal &lt;/span&gt;&lt;span class="operator"&gt;: &lt;/span&gt;&lt;span class="jvar"&gt;animals &lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt;&lt;br /&gt;          &lt;span class="fence3"&gt;{&lt;/span&gt;&lt;br /&gt;          &lt;span class="jvar"&gt;out&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;println&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jvar"&gt;animal&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;toString&lt;/span&gt;&lt;span class="fence2"&gt;(&lt;/span&gt;&lt;span class="fence2"&gt;)&lt;/span&gt; &lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;          &lt;span class="fence3"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      &lt;span class="jvar"&gt;out&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;println&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="string"&gt;"sort by color"&lt;/span&gt; &lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="jclass"&gt;Collections&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;sort&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jvar"&gt;animals&lt;/span&gt;&lt;span class="operator"&gt;, &lt;/span&gt;&lt;span class="keyword"&gt;new &lt;/span&gt;&lt;span class="jclass"&gt;Animal&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jclassdef"&gt;ByRGB&lt;/span&gt;&lt;span class="fence2"&gt;(&lt;/span&gt;&lt;span class="fence2"&gt;)&lt;/span&gt; &lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="keyword"&gt;for &lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jclass"&gt;Animal &lt;/span&gt;&lt;span class="jvardef"&gt;animal &lt;/span&gt;&lt;span class="operator"&gt;: &lt;/span&gt;&lt;span class="jvar"&gt;animals &lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt;&lt;br /&gt;          &lt;span class="fence3"&gt;{&lt;/span&gt;&lt;br /&gt;          &lt;span class="jvar"&gt;out&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;println&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jvar"&gt;animal&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;toString&lt;/span&gt;&lt;span class="fence2"&gt;(&lt;/span&gt;&lt;span class="fence2"&gt;)&lt;/span&gt; &lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;          &lt;span class="fence3"&gt;}&lt;/span&gt;&lt;br /&gt;      &lt;span class="commentslashslash"&gt;// end main&lt;/span&gt;&lt;br /&gt;      &lt;span class="fence2"&gt;}&lt;/span&gt;&lt;br /&gt;  &lt;span class="fence1"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt; * objects we will sort, represent animals, not nested&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt; */&lt;/span&gt;&lt;br /&gt;&lt;span class="importantkeyword"&gt;class &lt;/span&gt;&lt;span class="jclass"&gt;Animal &lt;/span&gt;&lt;span class="keyword"&gt;implements &lt;/span&gt;&lt;span class="jclass"&gt;Comparable&lt;/span&gt;&lt;span class="operator"&gt;&lt;&lt;/span&gt;&lt;span class="jclass"&gt;Animal&lt;/span&gt;&lt;span class="operator"&gt;&gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class="fence1"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span class="javadoc"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * what color this animal is.&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     */&lt;/span&gt;&lt;br /&gt;  &lt;span class="keyword"&gt;final &lt;/span&gt;&lt;span class="jclass"&gt;Color &lt;/span&gt;&lt;span class="jvardef"&gt;color&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span class="javadoc"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * name of the animal&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     */&lt;/span&gt;&lt;br /&gt;  &lt;span class="keyword"&gt;final &lt;/span&gt;&lt;span class="jclass"&gt;String &lt;/span&gt;&lt;span class="jvardef"&gt;name&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span class="javadoc"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * how many legs this animal has&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     */&lt;/span&gt;&lt;br /&gt;  &lt;span class="keyword"&gt;final int &lt;/span&gt;&lt;span class="jvar"&gt;legs&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="commentslashslash"&gt;// -------------------------- PUBLIC INSTANCE  METHODS --------------------------&lt;/span&gt;&lt;br /&gt;  &lt;span class="javadoc"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * compare by legs then by colour (numerically).&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     *&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * @param o other animal to compare with&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * @return +ve if this animal is bigger, -ve if smaller, 0 if equal&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     */&lt;/span&gt;&lt;br /&gt;  &lt;span class="keyword"&gt;public int &lt;/span&gt;&lt;span class="jmethod"&gt;compareTo&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jclass"&gt;Animal &lt;/span&gt;&lt;span class="jvardef"&gt;o &lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt;&lt;br /&gt;      &lt;span class="fence2"&gt;{&lt;/span&gt;&lt;br /&gt;      &lt;span class="keyword"&gt;int &lt;/span&gt;&lt;span class="jvardef"&gt;diff &lt;/span&gt;&lt;span class="operator"&gt;= &lt;/span&gt;&lt;span class="jvar"&gt;legs &lt;/span&gt;&lt;span class="operator"&gt;- &lt;/span&gt;&lt;span class="jvar"&gt;o&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;legs&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="keyword"&gt;if &lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jvar"&gt;diff &lt;/span&gt;&lt;span class="operator"&gt;!= &lt;/span&gt;&lt;span class="decimallow"&gt;0 &lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt;&lt;br /&gt;          &lt;span class="fence3"&gt;{&lt;/span&gt;&lt;br /&gt;          &lt;span class="importantkeyword"&gt;return &lt;/span&gt;&lt;span class="jvar"&gt;diff&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;          &lt;span class="fence3"&gt;}&lt;/span&gt;&lt;br /&gt;      &lt;span class="importantkeyword"&gt;return &lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jvar"&gt;color&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;getRGB&lt;/span&gt;&lt;span class="fence2"&gt;(&lt;/span&gt;&lt;span class="fence2"&gt;)&lt;/span&gt; &lt;span class="operator"&gt;&amp;amp; &lt;/span&gt;&lt;span class="numericindicator"&gt;0x&lt;/span&gt;&lt;span class="hexhigh"&gt;ff&lt;/span&gt;&lt;span class="hexlow"&gt;ffff &lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt; &lt;span class="operator"&gt;- &lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jvar"&gt;o&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;color&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;getRGB&lt;/span&gt;&lt;span class="fence2"&gt;(&lt;/span&gt;&lt;span class="fence2"&gt;)&lt;/span&gt; &lt;span class="operator"&gt;&amp;amp; &lt;/span&gt;&lt;span class="numericindicator"&gt;0x&lt;/span&gt;&lt;span class="hexhigh"&gt;ff&lt;/span&gt;&lt;span class="hexlow"&gt;ffff &lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="fence2"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span class="javadoc"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * what colour is the animal&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     *&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * @return colour&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     */&lt;/span&gt;&lt;br /&gt;  &lt;span class="keyword"&gt;public &lt;/span&gt;&lt;span class="jclass"&gt;Color &lt;/span&gt;&lt;span class="jmethoddef"&gt;getColor&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt;&lt;br /&gt;      &lt;span class="fence2"&gt;{&lt;/span&gt;&lt;br /&gt;      &lt;span class="importantkeyword"&gt;return &lt;/span&gt;&lt;span class="jvar"&gt;color&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="fence2"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span class="javadoc"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * how many legs has this animal?&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     *&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * @return number of legs&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     */&lt;/span&gt;&lt;br /&gt;  &lt;span class="keyword"&gt;public int &lt;/span&gt;&lt;span class="jmethod"&gt;getLegs&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt;&lt;br /&gt;      &lt;span class="fence2"&gt;{&lt;/span&gt;&lt;br /&gt;      &lt;span class="importantkeyword"&gt;return &lt;/span&gt;&lt;span class="jvar"&gt;legs&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="fence2"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span class="javadoc"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * override usual ToString to give a debugging represenation.&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     *&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * @return name, color, legs as a string.&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     */&lt;/span&gt;&lt;br /&gt;  &lt;span class="keyword"&gt;public &lt;/span&gt;&lt;span class="jclass"&gt;String &lt;/span&gt;&lt;span class="jmethoddef"&gt;toString&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt;&lt;br /&gt;      &lt;span class="fence2"&gt;{&lt;/span&gt;&lt;br /&gt;      &lt;span class="importantkeyword"&gt;return &lt;/span&gt;&lt;span class="jvar"&gt;name &lt;/span&gt;&lt;span class="operator"&gt;+ &lt;/span&gt;&lt;span class="string"&gt;"  "&lt;/span&gt; &lt;span class="operator"&gt;+ &lt;/span&gt;&lt;span class="jvar"&gt;color &lt;/span&gt;&lt;span class="operator"&gt;+ &lt;/span&gt;&lt;span class="string"&gt;" "&lt;/span&gt; &lt;span class="operator"&gt;+ &lt;/span&gt;&lt;span class="jvar"&gt;legs&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="fence2"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="commentslashslash"&gt;// --------------------------- CONSTRUCTORS ---------------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span class="javadoc"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * constructor&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     *&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * @param name  name of the animal.&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * @param color what colonr the animal is&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * @param legs  howw many legs the animal has&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     */&lt;/span&gt;&lt;br /&gt;  &lt;span class="jclassdef"&gt;Animal&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jclass"&gt;String &lt;/span&gt;&lt;span class="jvardef"&gt;name&lt;/span&gt;&lt;span class="operator"&gt;, &lt;/span&gt;&lt;span class="jclass"&gt;Color &lt;/span&gt;&lt;span class="jvardef"&gt;color&lt;/span&gt;&lt;span class="operator"&gt;, &lt;/span&gt;&lt;span class="keyword"&gt;int &lt;/span&gt;&lt;span class="jvardef"&gt;legs &lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt;&lt;br /&gt;      &lt;span class="fence2"&gt;{&lt;/span&gt;&lt;br /&gt;      &lt;span class="keyword"&gt;this&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;name &lt;/span&gt;&lt;span class="operator"&gt;= &lt;/span&gt;&lt;span class="jvar"&gt;name&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="keyword"&gt;this&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;color &lt;/span&gt;&lt;span class="operator"&gt;= &lt;/span&gt;&lt;span class="jvar"&gt;color&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="keyword"&gt;this&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;legs &lt;/span&gt;&lt;span class="operator"&gt;= &lt;/span&gt;&lt;span class="jvar"&gt;legs&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="fence2"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt; * Comparator for sorting Animals by alphabetically, case insensitive&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt; */&lt;/span&gt;&lt;br /&gt;&lt;span class="keyword"&gt;static &lt;/span&gt;&lt;span class="importantkeyword"&gt;class &lt;/span&gt;&lt;span class="jclass"&gt;Alphabetically &lt;/span&gt;&lt;span class="keyword"&gt;implements &lt;/span&gt;&lt;span class="jclass"&gt;Comparator&lt;/span&gt;&lt;span class="operator"&gt;&lt;&lt;/span&gt;&lt;span class="jclass"&gt;Animal&lt;/span&gt;&lt;span class="operator"&gt;&gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class="fence2"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="commentslashslash"&gt;// -------------------------- PUBLIC INSTANCE  METHODS --------------------------&lt;/span&gt;&lt;br /&gt;  &lt;span class="javadoc"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * compare two animal objects&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     *&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * @param o1 first object&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * @param o2 second object&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * @return +ve if o1 is biggern, -ve if smaller, 0 if equal&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     */&lt;/span&gt;&lt;br /&gt;  &lt;span class="keyword"&gt;public int &lt;/span&gt;&lt;span class="jmethod"&gt;compare&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jclass"&gt;Animal &lt;/span&gt;&lt;span class="jvardef"&gt;o1&lt;/span&gt;&lt;span class="operator"&gt;, &lt;/span&gt;&lt;span class="jclass"&gt;Animal &lt;/span&gt;&lt;span class="jvardef"&gt;o2 &lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt;&lt;br /&gt;      &lt;span class="fence3"&gt;{&lt;/span&gt;&lt;br /&gt;      &lt;span class="importantkeyword"&gt;return &lt;/span&gt;&lt;span class="jvar"&gt;o1&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;name&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;compareToIgnoreCase&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jvar"&gt;o2&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;name &lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="fence3"&gt;}&lt;/span&gt;&lt;br /&gt;  &lt;span class="fence2"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt; * Comparator for sorting Animals by Color then legs&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt; */&lt;/span&gt;&lt;br /&gt;&lt;span class="keyword"&gt;static &lt;/span&gt;&lt;span class="importantkeyword"&gt;class &lt;/span&gt;&lt;span class="jclass"&gt;ByRGB &lt;/span&gt;&lt;span class="keyword"&gt;implements &lt;/span&gt;&lt;span class="jclass"&gt;Comparator&lt;/span&gt;&lt;span class="operator"&gt;&lt;&lt;/span&gt;&lt;span class="jclass"&gt;Animal&lt;/span&gt;&lt;span class="operator"&gt;&gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class="fence2"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="commentslashslash"&gt;// -------------------------- PUBLIC INSTANCE  METHODS --------------------------&lt;/span&gt;&lt;br /&gt;  &lt;span class="javadoc"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * compare two animal objects&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     *&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * @param o1 first object&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * @param o2 second object&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     * @return +ve if o1 is biggern, -ve if smaller, 0 if equal&lt;/span&gt;&lt;br /&gt;&lt;span class="javadoc"&gt;     */&lt;/span&gt;&lt;br /&gt;  &lt;span class="keyword"&gt;public int &lt;/span&gt;&lt;span class="jmethod"&gt;compare&lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jclass"&gt;Animal &lt;/span&gt;&lt;span class="jvardef"&gt;o1&lt;/span&gt;&lt;span class="operator"&gt;, &lt;/span&gt;&lt;span class="jclass"&gt;Animal &lt;/span&gt;&lt;span class="jvardef"&gt;o2 &lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt;&lt;br /&gt;      &lt;span class="fence3"&gt;{&lt;/span&gt;&lt;br /&gt;      &lt;span class="keyword"&gt;int &lt;/span&gt;&lt;span class="jvardef"&gt;diff &lt;/span&gt;&lt;span class="operator"&gt;= &lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jvar"&gt;o1&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;color&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;getRGB&lt;/span&gt;&lt;span class="fence2"&gt;(&lt;/span&gt;&lt;span class="fence2"&gt;)&lt;/span&gt; &lt;span class="operator"&gt;&amp;amp; &lt;/span&gt;&lt;span class="numericindicator"&gt;0x&lt;/span&gt;&lt;span class="hexhigh"&gt;ff&lt;/span&gt;&lt;span class="hexlow"&gt;ffff &lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt; &lt;span class="operator"&gt;- &lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jvar"&gt;o2&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;color&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jmethod"&gt;getRGB&lt;/span&gt;&lt;span class="fence2"&gt;(&lt;/span&gt;&lt;span class="fence2"&gt;)&lt;/span&gt; &lt;span class="operator"&gt;&amp;amp; &lt;/span&gt;&lt;span class="numericindicator"&gt;0x&lt;/span&gt;&lt;span class="hexhigh"&gt;ff&lt;/span&gt;&lt;span class="hexlow"&gt;ffff &lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="keyword"&gt;if &lt;/span&gt;&lt;span class="fence1"&gt;(&lt;/span&gt; &lt;span class="jvar"&gt;diff &lt;/span&gt;&lt;span class="operator"&gt;!= &lt;/span&gt;&lt;span class="decimallow"&gt;0 &lt;/span&gt;&lt;span class="fence1"&gt;)&lt;/span&gt;&lt;br /&gt;          &lt;span class="fence3"&gt;{&lt;/span&gt;&lt;br /&gt;          &lt;span class="importantkeyword"&gt;return &lt;/span&gt;&lt;span class="jvar"&gt;diff&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;          &lt;span class="fence3"&gt;}&lt;/span&gt;&lt;br /&gt;      &lt;span class="importantkeyword"&gt;return &lt;/span&gt;&lt;span class="jvar"&gt;o1&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;legs &lt;/span&gt;&lt;span class="operator"&gt;- &lt;/span&gt;&lt;span class="jvar"&gt;o2&lt;/span&gt;&lt;span class="operator"&gt;.&lt;/span&gt;&lt;span class="jvar"&gt;legs&lt;/span&gt;&lt;span class="semicolon"&gt;;&lt;/span&gt;&lt;br /&gt;      &lt;span class="fence3"&gt;}&lt;/span&gt;&lt;br /&gt;  &lt;span class="fence2"&gt;}&lt;/span&gt;&lt;br /&gt;  &lt;span class="fence1"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/677131969527136022-5908745800845652746?l=mightyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/5908745800845652746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=677131969527136022&amp;postID=5908745800845652746' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/5908745800845652746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/5908745800845652746'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/2009/01/java-important-tips.html' title='Java Important Tips'/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-677131969527136022.post-2581955539782567469</id><published>2009-01-06T10:12:00.000-08:00</published><updated>2009-01-06T10:22:30.790-08:00</updated><title type='text'>Software Site Links</title><content type='html'>&lt;a href="http://www.justdreamweaver.com/dreamweaver-extensions.html"&gt;Dreamweaver Extensions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://jigsaw.w3.org/css-validator/DOWNLOAD.html"&gt;Css Validator&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.onyx-design.net/weblog2/other/cross-browser-compatible-in-5-steps/"&gt;Cross Browser Compatible Useful Article&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/677131969527136022-2581955539782567469?l=mightyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/2581955539782567469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=677131969527136022&amp;postID=2581955539782567469' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/2581955539782567469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/2581955539782567469'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/2009/01/software-site-links.html' title='Software Site Links'/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-677131969527136022.post-2606588895408749531</id><published>2009-01-06T10:07:00.000-08:00</published><updated>2009-01-06T10:11:52.305-08:00</updated><title type='text'>Make your site cross browser compatible in 5 steps </title><content type='html'>&lt;h2 class="pagetitle"&gt;Make your site cross browser compatible in 5 steps&lt;/h2&gt;                         &lt;div class="post" id="post-84"&gt; 			&lt;div class="entrytext"&gt;  &lt;a href="http://www.onyx-design.net/weblog2/other/cross-browser-compatible-in-5-steps/"&gt;&lt;img src="http://www.onyx-design.net/weblog2/wp-content/uploads/2008/03/crossbrowser.png" alt="Make your site cross browser compatible in 5 steps" class="screen" /&gt;&lt;/a&gt;  				&lt;p&gt;Making your site cross browser compatible is not easy, but with this tutorial you can make your site cross browser compatible in 5 simple steps.&lt;/p&gt; &lt;p&gt;&lt;span id="more-84"&gt;&lt;/span&gt;&lt;/p&gt; &lt;h3&gt;Step 1: Validate&lt;/h3&gt; &lt;p&gt;Lots of bugs are caused by invalid (X)&lt;acronym title="HyperText Markup Language"&gt;HTML&lt;/acronym&gt; or &lt;acronym title="Cascading Style Sheets"&gt;CSS&lt;/acronym&gt;. If you have your site validated, it will be a lot easier to make it cross browser compatible. Validate your (X)&lt;acronym title="HyperText Markup Language"&gt;HTML&lt;/acronym&gt; code with the &lt;a href="http://validator.w3.org/"&gt;&lt;acronym title="World Wide Web Consortium"&gt;W3C&lt;/acronym&gt; validator&lt;/a&gt; and your &lt;acronym title="Cascading Style Sheets"&gt;CSS&lt;/acronym&gt; file with the &lt;a href="http://jigsaw.w3.org/css-validator/"&gt;&lt;acronym title="World Wide Web Consortium"&gt;W3C&lt;/acronym&gt; &lt;acronym title="Cascading Style Sheets"&gt;CSS&lt;/acronym&gt; validator&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;img src="http://www.onyx-design.net/weblog2/wp-content/uploads/2008/03/validhtml1.jpg" alt="validhtml" width="500" height="150" /&gt;&lt;/p&gt; &lt;h3&gt;Step 2: Check your Website&lt;/h3&gt; &lt;p&gt;Now you have to check your website in all browsers. I always check my site in the browsers, I’ve installed on my computer (Opera, Safari, Internet Explorer and Firefox). Do it and make a note of the bugs.&lt;/p&gt; &lt;p&gt;Of course, checking your website in the browsers installed on your computer is not enough. You have to check the website in different browser versions on different operating systems. The solution is &lt;a href="http://www.browsershots.org/"&gt;Browsershots.org&lt;/a&gt;. With this website you can take full-length screen shots of your website in a lot of browsers. Just type in your url, bookmark the page and come back 20 minutes later to view the screen shots.&lt;/p&gt; &lt;p&gt;&lt;img src="http://www.onyx-design.net/weblog2/wp-content/uploads/2008/03/browsers1.jpg" alt="browsers" width="500" height="150" /&gt;&lt;/p&gt; &lt;p&gt;Analyse the screen shots and look for bugs. Be sure to write them down.&lt;/p&gt; &lt;h3&gt;Step 3: Is it worth my time?&lt;/h3&gt; &lt;p&gt;If you notice bugs in very old or uncommon used browsers, ask yourself if it’s worth your time to fix the problems. Look at the &lt;a href="http://www.w3schools.com/browsers/browsers_stats.asp"&gt;browser statistics of w3schools.com&lt;/a&gt;, but don’t forget to look to your own stats (I recommend AWstats). If you have one or two visitors every month still browsing with &lt;acronym title="Internet Explorer 5"&gt;IE5&lt;/acronym&gt;.5, you should really ask yourself if it’s necessary to make the changes.&lt;/p&gt; &lt;p&gt;&lt;img src="http://www.onyx-design.net/weblog2/wp-content/uploads/2008/03/browserstats.jpg" alt="browserstats" width="500" height="150" /&gt;&lt;/p&gt; &lt;h3&gt;Step 4: Search the cause&lt;/h3&gt; &lt;p&gt;Now you know about the bugs, you’ll have to look for the &lt;acronym title="Cascading Style Sheets"&gt;CSS&lt;/acronym&gt; attribute or &lt;acronym title="HyperText Markup Language"&gt;HTML&lt;/acronym&gt; code that is causing this problem. This is often obvious. A good reference can be found on &lt;a href="http://www.westciv.com/style_master/academy/browser_support/index.html"&gt;westciv.com&lt;/a&gt;. There is a complete list of css attributes with their support in different browsers. Too bad Firefox isn’t in the tables.&lt;/p&gt; &lt;p&gt;If you still cannot find the cause of the issue, search for topics on webmaster forums or post a topic yourself, with a screen shot and (a part of) your &lt;acronym title="Cascading Style Sheets"&gt;CSS&lt;/acronym&gt; and &lt;acronym title="HyperText Markup Language"&gt;HTML&lt;/acronym&gt; code. A forum I visit often is &lt;a href="http://www.ozzu.com/"&gt;Ozzu&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;img src="http://www.onyx-design.net/weblog2/wp-content/uploads/2008/03/ozzu.jpg" alt="ozzu" width="500" height="150" /&gt;&lt;/p&gt; &lt;h3&gt;Step 5: Fix the issues&lt;/h3&gt; &lt;p&gt;Now we’re at the essential part of making your website cross browser compatible: fixing the issues. If you know the code that is causing the trouble, find a way to &lt;em&gt;rewrite&lt;/em&gt; the code for the specific browser. There are loads of &lt;acronym title="Cascading Style Sheets"&gt;CSS&lt;/acronym&gt; hacks to do that, but I recommend the use of conditional comments. There is an &lt;a href="http://www.456bereastreet.com/archive/200510/stop_using_css_hacks_now/"&gt;article on 456 Berea St.&lt;/a&gt; explaining why you should use conditional comments instead of &lt;acronym title="Cascading Style Sheets"&gt;CSS&lt;/acronym&gt; hacks.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Conditional Comments&lt;/strong&gt;.&lt;br /&gt;With conditional comments you can link to separate style sheets for all versions of Internet Explorer. A complete reference can be found on &lt;a href="http://www.quirksmode.org/css/condcom.html"&gt;quirksmode&lt;/a&gt;. For example:&lt;br /&gt;&lt;code&gt;&lt;!--[if &lt;acronym title="Internet Explorer"&gt;IE&lt;/acronym&gt; 6]&gt;&lt;br /&gt;&lt;link rel="”stylesheet”" type="”text/css”" href="”ie6style.css”"&gt;&lt;br /&gt;&lt;![endif]–&gt;&lt;/code&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;acronym title="Cascading Style Sheets"&gt;CSS&lt;/acronym&gt; hacks In-&lt;acronym title="Cascading Style Sheets"&gt;CSS&lt;/acronym&gt;&lt;br /&gt;&lt;/strong&gt;If you don’t want to edit your &lt;acronym title="HyperText Markup Language"&gt;HTML&lt;/acronym&gt; file with conditional comments, see my article about &lt;a href="http://www.onyx-design.net/weblog2/featured/css-hacks-inside-css/"&gt;&lt;acronym title="Cascading Style Sheets"&gt;CSS&lt;/acronym&gt; hacks inside your &lt;acronym title="Cascading Style Sheets"&gt;CSS&lt;/acronym&gt; file&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Transparency of Images in &lt;acronym title="Internet Explorer 6"&gt;IE6&lt;/acronym&gt; and lower&lt;br /&gt;&lt;/strong&gt;Internet Explorer 6 and lower will not display your transparent &lt;acronym title="Portable Network Graphics"&gt;PNG&lt;/acronym&gt;’s correctly, there is however a simple solution using Java script. It can be found &lt;a href="http://homepage.ntlworld.com/bobosola/"&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;And of course there are loads of other &lt;acronym title="Cascading Style Sheets"&gt;CSS&lt;/acronym&gt; hacks. There is a &lt;a href="http://centricle.com/ref/css/filters/"&gt;complete list&lt;/a&gt; on centricle.com, also viewing the browsers that will apply the rules.&lt;/p&gt; &lt;h3&gt;Conclusion&lt;/h3&gt; &lt;p&gt;Making your site cross browser compatible will cost you some time, but it’s not impossible. The is very good documentation on the web, which can help you in this process. If you use other ways to make your site cross browser compatible, please leave a comment and share it. If you liked this article don’t forget to digg or float it.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.onyx-design.net/weblog2/other/cross-browser-compatible-in-5-steps/"&gt;Original Post&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/677131969527136022-2606588895408749531?l=mightyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/2606588895408749531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=677131969527136022&amp;postID=2606588895408749531' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/2606588895408749531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/2606588895408749531'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/2009/01/make-your-site-cross-browser-compatible.html' title='Make your site cross browser compatible in 5 steps '/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-677131969527136022.post-4178213440588848451</id><published>2008-12-20T11:35:00.000-08:00</published><updated>2008-12-20T11:38:02.957-08:00</updated><title type='text'>Sun Java Certification in Bangladesh Contact Information</title><content type='html'>&lt;table border="0" cellpadding="2" cellspacing="0" width="560"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="3" valign="top"&gt;&lt;img src="http://www.register.prometric.com/images/spacer.gif" alt="" border="0" width="330" height="5" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="3" valign="top"&gt;If you want to sit for SCJP Exam then contact with one of the following : &lt;img src="http://www.register.prometric.com/images/spacer.gif" alt="" border="0" width="330" height="5" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;&lt;b&gt;Test Sites&lt;/b&gt;&lt;/p&gt; &lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;&lt;b&gt;Address&lt;/b&gt;&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="150"&gt;&lt;a href="http://www.register.prometric.com/Centers.asp?Page=1&amp;amp;MODE=1&amp;amp;rdosite=BD21"&gt;Schedule Appointment&lt;/a&gt;&lt;br /&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;&lt;b&gt;New Horizons C L C - Chittagong&lt;/b&gt;&lt;br /&gt;Chittagong 4000&lt;br /&gt;     Phone: 657306 Site Code: BD21&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;p&gt;Admin Resort 4F&lt;br /&gt;110 CDA Avenue&lt;br /&gt;Nasirabad&lt;br /&gt;&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="3"&gt; &lt;hr color="#999999" size="1"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="150"&gt;&lt;a href="http://www.register.prometric.com/Centers.asp?Page=1&amp;amp;MODE=1&amp;amp;rdosite=BD4"&gt;Schedule Appointment&lt;/a&gt;&lt;br /&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;&lt;b&gt;NEW HORIZONS&lt;/b&gt;&lt;br /&gt;DHAKA 1205&lt;br /&gt;     Phone: 88028619613 Site Code: BD4&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;p&gt;MOMTAZ PLAZA 3RD FLOOR&lt;br /&gt;HOUSE 7 ROAD 4 MIRPUR ROAD&lt;br /&gt;DHANMONDI R/A&lt;br /&gt;&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="3"&gt; &lt;hr color="#999999" size="1"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="150"&gt;&lt;a href="http://www.register.prometric.com/Centers.asp?Page=1&amp;amp;MODE=1&amp;amp;rdosite=BD0"&gt;Schedule Appointment&lt;/a&gt;&lt;br /&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;&lt;b&gt;DESKTOP COMPUTER CONNECTION&lt;/b&gt;&lt;br /&gt;DHAKA 1000&lt;br /&gt;     Phone: 933 0765 Site Code: BD0&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;p&gt;146 - 2 NEW BAILY ROAD&lt;br /&gt;&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="3"&gt; &lt;hr color="#999999" size="1"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="150"&gt;&lt;a href="http://www.register.prometric.com/Centers.asp?Page=1&amp;amp;MODE=1&amp;amp;rdosite=BD17"&gt;Schedule Appointment&lt;/a&gt;&lt;br /&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;&lt;b&gt;IDB-BISEW&lt;/b&gt;&lt;br /&gt;DHAKA, Dhaka zila 1207&lt;br /&gt;     Phone: 91131150 Site Code: BD17&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;p&gt;IDB-BISEW&lt;br /&gt;IDB BHABAN (4TH FLOOR)&lt;br /&gt;E/8-A, ROKEYA SHARANI&lt;br /&gt;SHER-E-BANGLA NAGAR&lt;br /&gt;&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="3"&gt; &lt;hr color="#999999" size="1"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="150"&gt;&lt;a href="http://www.register.prometric.com/Centers.asp?Page=1&amp;amp;MODE=1&amp;amp;rdosite=BD18"&gt;Schedule Appointment&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ussoftwareltd.com/" target="new"&gt;View Test Site Web Site&lt;/a&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;&lt;b&gt;GRAMEEN STAR EDUCATION CENTER-PANTHAPATH&lt;/b&gt;&lt;br /&gt;DHAKA 1205&lt;br /&gt;     Phone: 9668986 Site Code: BD18&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;p&gt;69 B  2ND FLOOR GREEN ROAD&lt;br /&gt;PANTHAPATH&lt;br /&gt;&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="3"&gt; &lt;hr color="#999999" size="1"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="150"&gt;&lt;a href="http://www.register.prometric.com/Centers.asp?Page=1&amp;amp;MODE=1&amp;amp;rdosite=BD19"&gt;Schedule Appointment&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.daffodilvarsity.edu.bd/" target="new"&gt;View Test Site Web Site&lt;/a&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;&lt;b&gt;DAFFODIL INTERNATIONAL UNIVERSITY&lt;/b&gt;&lt;br /&gt;DHAKA 1207&lt;br /&gt;     Phone: 9138234 Site Code: BD19&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;p&gt;102 SUKRABAD&lt;br /&gt;MIRPUR ROAD&lt;br /&gt;DHANMONDI&lt;br /&gt;&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="3"&gt; &lt;hr color="#999999" size="1"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="150"&gt;&lt;a href="http://www.register.prometric.com/Centers.asp?Page=1&amp;amp;MODE=1&amp;amp;rdosite=BD25"&gt;Schedule Appointment&lt;/a&gt;&lt;br /&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;&lt;b&gt;Southtech Limited&lt;/b&gt;&lt;br /&gt;DHAKA 1230&lt;br /&gt;     Phone: 8916331 Site Code: BD25&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;p&gt;Plot #1 Road #13&lt;br /&gt;Sector1&lt;br /&gt;UTTARA&lt;br /&gt;&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="3"&gt; &lt;hr color="#999999" size="1"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="150"&gt;&lt;a href="http://www.register.prometric.com/Centers.asp?Page=1&amp;amp;MODE=1&amp;amp;rdosite=bd35"&gt;Schedule Appointment&lt;/a&gt;&lt;br /&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;&lt;b&gt;Genuity Training&lt;/b&gt;&lt;br /&gt;Dhaka, Madaripur zila 1216&lt;br /&gt;     Phone: 8057038 Site Code: bd35&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;p&gt;Sruti Tower, 6th Floor&lt;br /&gt;Main Road Plot#8&lt;br /&gt;Block # KA&lt;br /&gt;Section #6 Mirpur 2&lt;br /&gt;&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="3"&gt; &lt;hr color="#999999" size="1"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="3" valign="top"&gt;&lt;img src="http://www.register.prometric.com/images/spacer.gif" alt="" border="0" width="330" height="8" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="3" valign="top"&gt; &lt;div id="pnlbuttons"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/677131969527136022-4178213440588848451?l=mightyjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mightyjava.blogspot.com/feeds/4178213440588848451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=677131969527136022&amp;postID=4178213440588848451' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/4178213440588848451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/677131969527136022/posts/default/4178213440588848451'/><link rel='alternate' type='text/html' href='http://mightyjava.blogspot.com/2008/12/sun-java-certification-in-bangladesh.html' title='Sun Java Certification in Bangladesh Contact Information'/><author><name>darkhorse</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
