<?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-7300550709382233175</id><updated>2012-01-27T09:32:06.457-08:00</updated><category term='Java EE6'/><category term='Collection APIs'/><category term='Struts'/><category term='JVM'/><category term='Pesonal Interview Questions'/><category term='JSP'/><category term='Test Driven Development'/><category term='EJB3'/><category term='JAXP'/><category term='OOP Concepts'/><category term='Spring Framework'/><category term='Hibernate'/><category term='Code Snippet'/><category term='EBooks'/><category term='J2EE Connector Architecture'/><category term='JTA'/><category term='Java 7'/><category term='UML'/><category term='Core Java'/><category term='Java 5'/><category term='JFC  vs AWT'/><category term='Velocity Framework'/><category term='JDBC'/><category term='log4j'/><category term='Java EE5'/><category term='Forum'/><category term='EJB'/><category term='JFC'/><category term='Webservices'/><category term='Version Control Software Systems'/><category term='ANT'/><category term='AXIS'/><category term='Java Tools'/><category term='Master List Core Java'/><category term='Service Oriented Architecture'/><category term='JMS'/><category term='Eclipse IDE'/><category term='OOAD'/><category term='UDDI4j'/><category term='JEE'/><category term='Java Mail'/><category term='Design Patterns'/><category term='Java Coding Standards'/><category term='Servlet'/><category term='Webhosting'/><title type='text'>Interview Questions On Java,Java EE</title><subtitle type='html'>World of tricky Core Java Q&amp;amp;A(Java SE),Java EE and Open source technologies like Struts,Hibernate,Spring,Velocity  etc</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.interviewjava.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default?start-index=101&amp;max-results=100'/><author><name>Deepun</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>371</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7300550709382233175.post-8179073243054121444</id><published>2015-04-03T08:38:00.000-07:00</published><updated>2012-01-15T01:23:04.331-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Core Java'/><title type='text'>Core Java Interview Questions</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Every year many thousand technocrats choose &lt;b&gt;Java careers&lt;/b&gt; across the globe,after formally taking &lt;b&gt;Java training classes,courses &lt;/b&gt;and/or &lt;b&gt;Java certifications&lt;/b&gt; like &lt;b&gt;SCJP &lt;/b&gt;etc.While appearing for &lt;b&gt;technical interviews&lt;/b&gt;,these budding &lt;b&gt;Java programmers&lt;/b&gt; face variety of technical questions, are asked to write code snippets to prove their mettle in relevant topics of Java.They are not only assessed on language basics but also on their familiarity with Java development tools, &lt;b&gt;&lt;a href="http://www.interviewjava.com/search/label/Java%20Coding%20Standards"&gt;coding standards and guidelines&lt;/a&gt;,optimization&lt;/b&gt; of &lt;b&gt;Java code,load tests&lt;/b&gt;,securing code through &lt;a href="http://www.interviewjava.com/2008/05/what-is-obfuscation-how-this-technique.html"&gt;&lt;b&gt;Java obfuscation&lt;/b&gt;&lt;/a&gt; and many more. It is their performance in these interviews which decides their career fate and is highly dependent on to-the-point and not too verbose answers.&lt;br /&gt;&lt;br /&gt;Apart from technical questions, an interviewee faces a spate of personal questions as well.In post, &lt;a href="http://www.interviewjava.com/2007/05/personal-questions-in-interview.html"&gt;Personal Interview Questions&lt;/a&gt; you will find variety of questions asked on personal front.In wired world, it is very important to know where your &lt;a href="http://www.interviewjava.com/2009/09/ebooks-on-java-javaee-technologies.html"&gt;resources&lt;/a&gt; are lying and how credible are they.&lt;br /&gt;&lt;br /&gt;This blog intends to provide a consolidated knowledge base for all netizens,budding Java Engineers or experienced ones, interested in Java technology.This blog will primarily focus on 'Core Java' related questions and later on advanced topics in Java EE space,Open source technologies and frameworks and more.At this point this is a nice idea to put a roadmap right away to put all these questions in an organized fashion. In order to access questions list on a particular topic,please click the links associated with it.It will open the questions list in the same browser window and in order to comeback to this page, while going through various posts, you have to click back button in your bowser window.Each answer for a question on various topics will open in a fresh window,while you are through with reading an answer,close the open window in order to comeback to the questions list.If you want to access &lt;b&gt;Master List of Core Java Interview Questions&lt;/b&gt; then &lt;a href="http://www.interviewjava.com/2007/06/master-list-of-core-java-questions.html"&gt;&lt;b&gt;click here&lt;/b&gt;&lt;/a&gt;.In order to jump to &lt;b&gt;recent posts&lt;/b&gt; straightaway, you can view a list of these in a widget box as shown below:&lt;br /&gt;&lt;br /&gt;&lt;embed align="middle" height="338" menu="false" name="InsertWidget_725b2c36-c812-4b9d-9c42-25288a3e893d" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" src="http://widgetserver.com/syndication/flash/wrapper/InsertWidget.swf?appId=725b2c36-c812-4b9d-9c42-25288a3e893d" type="application/x-shockwave-flash" width="400" wmode="transparent"&gt;&lt;/embed&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Java Language Fundamentals (Click Link To Access Questions' List)&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://www.interviewjava.com/2007/04/java-and-object-oriented-analysis-and.html"&gt;Object Oriented Analysis and Design Basics, UML And Java&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.interviewjava.com/2007/04/inside-java-virtual-machine.html"&gt;Inside JVM&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.interviewjava.com/2007/04/java-fundamentalsdatatypeskeywordsopera.html"&gt;Datatypes,Keywords,Operators and Assignments,Identifies etc.&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.interviewjava.com/2007/04/questions-on-declarations-and.html"&gt;Declarations and Modifiers,Conversion,Casting and Promotion &lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.interviewjava.com/2007/04/flow-control.html"&gt;Flow control&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.interviewjava.com/2007/05/questions-on-assertions.html"&gt;Assertions&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.interviewjava.com/2007/04/garbage-collection.html"&gt;Exception Handling and Garbage Collection&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.interviewjava.com/2007/04/objects-and-classes.html"&gt;Objects and Classes&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;strong&gt;Packages and their classes (Click Link To Access Questions' List)&lt;/strong&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://www.interviewjava.com/2007/04/javalang-package.html"&gt;java.lang.*&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.interviewjava.com/2007/05/questions-on-javautil-and-javaio.html"&gt;java.util.*&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.interviewjava.com/2007/05/questions-on-javautil-and-javaio.html"&gt;java.io.*&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.interviewjava.com/2007/05/questions-on-awt-and-jfc-swing.html"&gt;java.awt.*&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.interviewjava.com/2007/06/interview-questions-on-javanet.html"&gt;java.net.*&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;a href="http://www.interviewjava.com/2007/05/questions-on-java-database-connectivity.html"&gt;&lt;strong&gt;Java and Database Access&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2007/05/questions-on-awt-and-jfc-swing.html"&gt;&lt;strong&gt;JFC Swing&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/08/collection-apis-related-interview.html"&gt;Collection APIs&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Check more miscellaneous short questions on Core Java with short answers,&lt;a href="http://www.interviewjava.com/2007/05/miscellaneous-core-java-questions-with.html"&gt;here.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you starve for more knowledge on Core Java,you may like to check out online &lt;a href="http://www.interviewjava.com/2009/09/ebooks-on-java-javaee-technologies.html"&gt;e-books and other resources on Core Java or access all Online Java and Java EE resources&lt;/a&gt;. All suggestions,comments are welcome in order to make this space more productive and useful for all its audiences.&lt;br /&gt;&lt;br /&gt;Read more on Core Java:&lt;br /&gt;- &lt;a href="http://www.interviewjava.com/search/label/Core%20Java%20Questions%20With%20Short%20Answers"&gt;Short Questions On Core Java&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://www.interviewjava.com/search/label/Java%205"&gt;Interview Questions on Java 5&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://www.interviewjava.com/2012/01/what-are-enhancements-in-java-se-7.html" target="_blank"&gt;Enhancements in Java 7&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-8179073243054121444?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/8179073243054121444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=8179073243054121444' title='37 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/8179073243054121444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/8179073243054121444'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2007/04/test.html' title='Core Java Interview Questions'/><author><name>Deepun</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>37</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7300550709382233175.post-4747186188452860565</id><published>2015-04-02T03:00:00.000-07:00</published><updated>2009-08-31T07:22:59.949-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JEE'/><title type='text'>Java EE,Open Source,Advanced Technologies Interview Questions</title><content type='html'>In continuation of earlier post on &lt;a href="http://www.interviewjava.com/"&gt;Java Interview Questions&lt;/a&gt; this post is focussed on interview questions in several &lt;b&gt;Java EE technologies&lt;/b&gt;(erstwhile &lt;b&gt;J2EE&lt;/b&gt;).Apart from Java EE, interview questions on most widely used open source technologies like Struts,Hibernate,Spring and Velocity and more will also be covered.&lt;br /&gt;&lt;br /&gt;On constant requests by readers to put something on personal interview questions, consequently, you may like to read post on &lt;a href="http://www.interviewjava.com/2007/05/personal-questions-in-interview.html"&gt;personal interview questions&lt;/a&gt; , prior talking about Java Enterprise Edition.&lt;br /&gt;&lt;br /&gt;Sun Microsystems introduced  Java EE 5 specification under &lt;a href="http://jcp.org/en/jsr/detail?id=244" class="external text" title="http://jcp.org/en/jsr/detail?id=244" rel="nofollow"&gt;JSR 244&lt;/a&gt; and the final release was made public on May ,2006.Java EE has become a cornerstone technology for enterprise level web based solution development.It has more than three million downloads and more than twenty six vendors' application servers support this specification.It is significant to go through an &lt;a href="http://www.interviewjava.com/2007/05/what-is-java-ee-5.html"&gt;introduction of Java EE 5&lt;/a&gt; before jumping to questions list straightaway.You can capture essence of Java EE 5 &lt;a href="http://java.sun.com/javaee/"&gt;here&lt;/a&gt; in detail.&lt;br /&gt;&lt;br /&gt;If you directly want to access &lt;b&gt;Master List of Java EE Interview Questions&lt;/b&gt; then &lt;a style="font-weight: bold; color: rgb(255, 0, 0);" href="http://www.interviewjava.com/2007/06/master-list-of-java-ee-questionsrelease.html"&gt; click here.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The list of questions on various topics covered under Java EE hood is as follows(on the basis of different technologies covered under Java EE umbrella) :&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Java EE 5&lt;/i&gt;&lt;i&gt;(Click To Access Questions' List)&lt;/i&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2007/04/java-servlets-and-jsps.html"&gt;Java Servlets&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2007/04/interview-questions-on-jsp.html"&gt;Java Server Pages and JSP Standard Tag Libraries&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2007/05/interview-questions-on-enterprise-java.html"&gt;Enterprise Java Beans&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2007/07/interview-questions-on-jms.html"&gt;Java Message Services&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2008/08/what-is-jaxp.html"&gt;Java APIs for XML Parsing&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/03/what-are-different-system-contracts-in.html"&gt;Java Connector Architecture&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2008/03/sending-email-to-gmail-smtp-server.html"&gt;Java Mail&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2007/05/interview-questions-on-ejb-transactions.html"&gt;Java Transaction APIs&lt;/a&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;i&gt;Open Source Technologies/Emerging Frameworks:&lt;/i&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2007/06/interview-questions-on-struts-framework.html"&gt;Struts&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2007/06/interview-questions-on-hibernate.html"&gt;Hibernate Framework&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2007/06/interview-questions-on-spring-framework.html"&gt;Spring Framework&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2007/11/velocity-framework.html"&gt;Velocity&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/search/label/AXIS"&gt;Apache AXIS&lt;/a&gt;&lt;br /&gt;Annotations or attributes based programming (xdoclet etc).&lt;br /&gt;Aspect Oriented Programming (AOP).&lt;br /&gt;EJB 3.0.&lt;br /&gt;Inversion of Control (IOC) (Also known as Dependency Injection).&lt;br /&gt;JavaServer Faces (JSF) framework.&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2008/09/what-is-test-driven-development.html"&gt;Test Driven Development (TDD)&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Architectures:&lt;/i&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2008/04/simplifying-service-oriented.html"&gt;Service Oriented Architecture&lt;/a&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;Others&lt;br /&gt;&lt;/i&gt;&lt;a href="http://www.interviewjava.com/2007/07/interview-questions-on-java-design.html"&gt;Java Design Patterns&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If anyone of you has come across a very unique experience in terms of technical and personal questions asked, feel free to share your experience.&lt;br /&gt;&lt;br /&gt;Keep sharing your &lt;a href="http://javajeeresources.blogspot.com/"&gt;resources &lt;/a&gt;for ongoing learning...&lt;br /&gt;&lt;br /&gt;Learn more about Java EE, &lt;a href="http://java.sun.com/javaee/" target="_blank"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-4747186188452860565?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/4747186188452860565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=4747186188452860565' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/4747186188452860565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/4747186188452860565'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2007/05/java-ee-interview-questions.html' title='Java EE,Open Source,Advanced Technologies Interview Questions'/><author><name>Deepun</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>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7300550709382233175.post-5261139969436436891</id><published>2015-03-02T00:54:00.000-08:00</published><updated>2009-08-15T10:08:27.399-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Master List Core Java'/><title type='text'>Master List Of Core Java Questions</title><content type='html'>&lt;ol&gt;&lt;b&gt;OOPS&lt;/b&gt;&lt;br /&gt;&lt;li&gt;&lt;a HREF="/2007/04/what-is-object.html" target="_blank"&gt;What is an Object? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-class.html" target="_blank"&gt;What is a Class? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-ooad.html" target="_blank"&gt;What is OOAD? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-data-abstraction.html" target="_blank"&gt;What is Data Abstraction ? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-data-encapsulation.html" target="_blank"&gt;What is Data Encapsulation?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-difference-between-data.html" target="_blank"&gt;What is the difference between Data Abstraction and Information Hiding? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-inheritance-and-what-are.html" target="_blank"&gt;What is Inheritance and what are different types of it?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/why-java-uses-singly-rooted-hierarchy.html" target="_blank"&gt;Why Java uses Singly rooted hierarchy? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/why-does-java-not-support-multiple.html" target="_blank"&gt;Why does Java not support Multiple Inheritance? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/why-is-java-not-100-pure-oop-language.html" target="_blank"&gt;Why is Java not 100% pure OOP language?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-early-binding.html" target="_blank"&gt;What is Early Binding? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-polymorphismlate-binding.html" target="_blank"&gt;What is Polymorphism/Late Binding?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-method-overloading.html" target="_blank"&gt;What is method overloading?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-method-overriding.html" target="_blank"&gt;What is method overriding? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/how-is-java-different-from-c.html" target="_blank"&gt;How is Java different from C++? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-uml-and-how-is-it-useful-in.html" target="_blank"&gt;What is UML and how is it useful in designing large systems? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/is-uml-useful-for-procedural.html" target="_blank"&gt;Is UML useful for procedural programming ?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-are-different-notations-used-in.html" target="_blank"&gt;What are different notations used in UML ?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-use-case-and-actor.html" target="_blank"&gt;What is a Use case and an Actor?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/how-to-identify-actor.html" target="_blank"&gt;How to identify an Actor? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-generalization.html" target="_blank"&gt;What is Generalization?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-association-and-how-it-maps.html" target="_blank"&gt;What is Association and how it maps into a Java class? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-aggregation-and-how-it-maps.html" target="_blank"&gt;What is Aggregation and how it maps into a Java class? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-composition-and-how-it-maps.html" target="_blank"&gt;What is Composition and how it maps into a Java class?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-dependency-and-how-it-maps-into.html" target="_blank"&gt;What is Dependency and how it maps into a Java class?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-purpose-of-state-machine.html" target="_blank"&gt;What is the purpose of State machine diagrams? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-are-different-kinds-of-structure.html" target="_blank"&gt;What are different kinds of Structure diagrams? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-are-different-kinds-of-interaction.html" target="_blank"&gt;What are different kinds of Interaction diagrams? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-are-different-kinds-of-behavior.html" target="_blank"&gt;What are different kinds of Behavior diagrams?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;b&gt; Java Fundamentals&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-java-virtual-machine-jvm.html" target="_blank"&gt;What is a Java Virtual Machine (JVM)? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-jvm-consisted-of.html" target="_blank"&gt;What is a JVM consisted of?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-class-loader-and-what-is-its.html" target="_blank"&gt;What is a class loader and what is its responsibilities?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-heap-and-stack.html" target="_blank"&gt;What is heap and stack?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/how-is-your-java-program-executed.html" target="_blank"&gt;How is your Java program executed inside JVM?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-java-class-files-magic-number.html" target="_blank"&gt;What is Java class file's magic number?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/how-jvm-performs-thread-synchronization.html" target="_blank"&gt;How JVM performs Thread Synchronization?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/how-jvm-performs-garbage-collection.html" target="_blank"&gt;How JVM performs Garbage Collection?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/how-to-profile-heap-usage.html" target="_blank"&gt;How to profile heap usage?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-will-you-do-if-vm-exits-while.html" target="_blank"&gt;What will you do if VM exits while printing "OutOfMemoryError" and increasing max heap size doesn't help?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/should-one-pool-objects-to-help-gc.html" target="_blank"&gt;Should one pool objects to help Garbage Collector?Should one call System.gc() periodically?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/application-has-lot-of-threads-and-is.html" target="_blank"&gt;An application has a lot of threads and is running out of memory, why?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/if-your-program-is-io-bound-or-running.html" target="_blank"&gt;If your program is I/O bound or running in native methods, do these activities engage JVM?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-difference-between-interpreted.html" target="_blank"&gt;What is the difference between interpreted code and compiled code?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/why-java-based-gui-intensive-program.html" target="_blank"&gt;Why Java based GUI intensive program has performance issues?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-64-bit-java.html" target="_blank"&gt;What is 64 bit Java ?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-difference-between-jvm-and-jre.html" target="_blank"&gt;What is the difference between JVM and JRE?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-are-different-datatypes-in-java.html" target="_blank" name="1"&gt;What are different primitive datatypes in Java?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-are-expressionsstatements-and.html" target="_blank" name="2"&gt;What are expressions,statements and blocks in Java?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-transient-variable.html" target="_blank" name="4"&gt;What is a transient variable?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-difference-between-operator-and.html" target="_blank" name="5"&gt;What is the difference between the '&amp;amp;' operator and the '&amp;amp;&amp;amp;' operator?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/why-main-method-of-java-has-public.html" target="_blank" name="6"&gt;Why main method of Java has public static void?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/if-you-have-static-block-constructor.html" target="_blank" name="7"&gt;If you have static block, constructor and main method in Java file then what will be the sequence of method calls?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-are-command-line-arguments.html" target="_blank" name="8"&gt;What are the command line arguments?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/does-java-support-multi-dimensional.html" target="_blank" name="9"&gt;Does Java support multi dimensional arrays?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-are-restrictions-for-static-method.html" target="_blank" name="10"&gt;What are the restrictions for static method?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/why-abstract-method-cannot-be-static.html" target="_blank" name="11"&gt;Why a abstract method cannot be static?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/is-sizeof-keyword.html" target="_blank" name="13"&gt;Is 'sizeof' a keyword?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-precedence-of-operators-in-java.html" target="_blank" name="14"&gt;What is the precedence of operators in Java? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/how-is-argument-passed-in-java-methods.html" target="_blank"&gt;How is an argument passed in Java methods?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-difference-between-class.html" target="_blank"&gt;What is the difference between class variable, member variable and automatic(local) variable?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/when-are-static-and-non-static.html" target="_blank"&gt;When are static and non static variables of a class initialized? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/can-shift-operators-be-applied-to-float.html" target="_blank"&gt;Can shift operators be applied to float types?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-are-different-java-declarations.html" target="_blank"&gt;What are different Java declarations and their associated rules? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-are-java-modifiers.html" target="_blank"&gt;What are Java Modifiers?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/explain-final-modifier.html" target="_blank"&gt;Explain final modifier.&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/can-you-change-reference-of-final.html" target="_blank"&gt;Can you change the reference of the final object?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/can-abstract-class-be-instantiated.html" target="_blank"&gt;Can abstract class be instantiated?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/when-does-compiler-insist-that-class.html" target="_blank"&gt;When does the compiler insist that the class must be abstract? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/where-can-static-modifiers-be-used.html" target="_blank"&gt;Where can static modifiers be used?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-static-initializer-code.html" target="_blank"&gt;What is static initializer code?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/can-anonymous-class-implement-interface.html" target="_blank"&gt;Can an anonymous class implement an interface and extend a class at the same time? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-are-volatile-variables.html" target="_blank"&gt;What are volatile variables? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/can-protected-or-friendly-features-be.html" target="_blank"&gt;Can protected or friendly features be accessed from different packages? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/how-many-ways-can-one-write-infinite.html" target="_blank"&gt;How many ways can one write an infinite loop?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/when-do-you-use-continue-and-break.html" target="_blank"&gt;When do you use 'continue' and 'break' statements? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-difference-between-while-and-do.html" target="_blank"&gt;What is the difference between 'while' and 'do while' loop?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-assertion-and-why-using.html" target="_blank"&gt;What is an Assertion and why using assertion in your program is a good idea ?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/explain-assertions-with-code-example.html" target="_blank"&gt;Explain Assertions with a code exmaple.&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/how-many-forms-of-assertions-we-have.html" target="_blank"&gt;How many forms of assertions we have?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/when-assertions-should-be-avoided.html" target="_blank"&gt;When assertions should be avoided?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-situations-are-best-suitable-for.html" target="_blank"&gt;What situations are best suitable for implementing assertions?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-exception.html" target="_blank"&gt;What is Exception ? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-user-defined-exception.html" target="_blank"&gt;What is a user-defined exception? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-do-you-know-about-garbage.html" target="_blank"&gt;What do you know about the garbage collector?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/why-java-does-not-support-pointers.html" target="_blank"&gt;Why Java does not support pointers? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/does-garbage-collection-guarantee-that.html" target="_blank"&gt;Does garbage collection guarantee that a program will not run out of memory? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-finally-in-exception-handling.html" target="_blank"&gt;What is finally in Exception handling?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-can-prevent-execution-of-code-in.html" target="_blank"&gt;What can prevent the execution of the code in finally block? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/explain-trycatch-and-finally-blocks.html" target="_blank"&gt;Explain 'try','catch' and 'finally' blocks? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/define-checked-and-unchecked-exception.html" target="_blank"&gt;Define Checked and Unchecked exception.&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-difference-between-abstract.html" target="_blank"&gt;What is the difference between an abstract class and an interface?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-use-of-interface.html" target="_blank"&gt;What is the use of interface?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.interviewjava.com/2007/05/what-is-serializable-interface.html" target="_blank"&gt;What is serializable interface?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/does-class-inherit-constructors-from.html" target="_blank"&gt;Does a class inherit constructors from its superclass? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/whats-difference-between-constructors.html" target="_blank"&gt;What's the difference between constructors and other methods? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/if-method-to-be-overridden-has-access.html" target="_blank"&gt;If the method to be overridden has access type 'protected', can subclass have the access type as 'private'?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/if-you-use-super-or-this-in-constructor.html" target="_blank"&gt;If you use super() or this() in a constructor where should it appear in the constructor?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-modifiers-may-be-used-with-inner.html" target="_blank"&gt;What modifiers may be used with an inner class that is a member of an outer class?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/can-inner-class-be-defined-inside.html" target="_blank"&gt;Can an inner class be defined inside a method?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-anonymous-class.html" target="_blank"&gt;What is an anonymous class?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-thread.html" target="_blank"&gt;What is a thread?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-difference-between-process-and.html" target="_blank"&gt;What is the difference between process and threads?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-are-two-types-of-multitasking.html" target="_blank"&gt;What are two types of multitasking? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-are-two-ways-of-creating-threads.html" target="_blank"&gt;What are two ways of creating threads in Java and why so? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/how-does-multithreading-take-place-on.html" target="_blank"&gt;How does multithreading take place on a computer with a single CPU? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/how-java-object-be-locked-for-exclusive.html" target="_blank"&gt;How a Java object be locked for exclusive use by a given thread?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-synchronization.html" target="_blank"&gt;What is Synchronization? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/explain-waitnotify-and-notifyall.html" target="_blank"&gt;Explain wait(),notify(), and notifyAll() methods?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-daemon-thread.html" target="_blank"&gt;What is a Daemon thread?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/how-dead-thread-can-be-started.html" target="_blank"&gt;How a dead thread can be started? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-difference-between-string-and.html" target="_blank"&gt;What is the difference between String and StringBuffer?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/how-is-different-from-equals-method-in.html" target="_blank"&gt;How is '==' different from .equals() method in case of String objects?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/explain-streamtokenizer.html" target="_blank"&gt;Explain StreamTokenizer?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-collection.html" target="_blank"&gt;What is Collection?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/explain-listsetmap.html" target="_blank"&gt;Explain List,Set and Map.&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-serialization.html" target="_blank"&gt;What is the serialization?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-difference-between-serializable.html" target="_blank"&gt;What is the difference between Serializable and Externalizable interface?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-memory-leak.html" target="_blank"&gt;What is memory leak? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/difference-between-arraylist-and-vector.html" target="_blank"&gt;Difference between ArrayList and Vector class? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-difference-between-hashtable.html" target="_blank"&gt;What is the difference between Hashtable and HashMap?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-jfc.html" target="_blank"&gt;What is JFC?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-difference-between-jfc-swing.html" target="_blank"&gt;What is the difference between JFC Swing and AWT? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-base-class-for-all-swing.html" target="_blank"&gt;What is the base class for all swing components? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-are-lightweight-and-heavyweight.html" target="_blank"&gt;What are lightweight and heavyweight components ? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/how-can-gui-component-handle-its-own.html" target="_blank"&gt;How can a GUI component handle its own events?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-layout-manager-and-what-are-its.html" target="_blank"&gt;What is a Layout Manager and what are its different types and their advantages? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/how-are-elements-of-gridbaglayout.html" target="_blank"&gt;How are the elements of a GridBagLayout organized? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-are-problems-faced-by-java.html" target="_blank"&gt;What are the problems faced by Java programmers in absence of layout managers?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/where-cardlayout-is-used.html" target="_blank"&gt;Where the CardLayout is used? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-difference-between-gridlayout.html" target="_blank"&gt;What is the difference between GridLayout and GridBagLayout?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/how-will-you-add-panel-to-frame.html" target="_blank"&gt;How will you add a panel to a frame? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-difference-between-application.html" target="_blank"&gt;What is the difference between Application and Applet?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/explain-lifecycle-of-applet-and-what-is.html" target="_blank"&gt;Explain Lifecycle of the Applet and what is the order of method invocation in an applet?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-difference-between-java-class.html" target="_blank"&gt;What is the difference between Java class and bean?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-difference-between-trusted-and.html" target="_blank"&gt;What is difference between trusted and untrusted applet?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/how-do-you-set-java-library-path.html"&gt;How do you set Java Library path programmatically?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/explain-usage-of-javautildate-and-more.html"&gt;Explain the usage of java.util.Date and more classes and APIs for date handling in Java?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;b&gt;JDBC&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-jdbc.html" target="_blank"&gt;What is JDBC ? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-are-four-drivers-available-in-jdbc.html" target="_blank"&gt;What are four drivers available in JDBC? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/how-do-you-establish-database.html" target="_blank"&gt;How do you establish database connection using JDBC?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href="/2007/10/how-do-you-connect-to-mysql-database.html" target="_blank"&gt;How do you connect to a MySql Database using JDBC?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-are-different-types-of-statements.html" target="_blank"&gt;What are the different types of Statements?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-preparedstatement-and-how-is.html" target="_blank"&gt;What is PreparedStatement and how is different from Statement? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-difference-between-executequery.html" target="_blank"&gt;What is the difference between executeQuery () and execute() ?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-difference-between-executequery_22.html" target="_blank"&gt;What is the difference between executeQuery () and executeUpdate()? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/how-do-you-call-stored-procedure-in.html" target="_blank"&gt;How do you call a stored procedure in Java?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-are-new-features-from-jdbc20.html" target="_blank"&gt;What are new features from JDBC2.0 onwards?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/how-can-cursor-move-in-scrollable.html" target="_blank"&gt;How can a cursor move in scrollable result sets?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/differentiate-typescrollinsensitive-and.html" target="_blank"&gt;Differentiate TYPE_SCROLL_INSENSITIVE and TYPE_SCROLL_SENSITIVE?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/how-will-you-differentiate-following.html" target="_blank"&gt; How will you differentiate the following two ways of loading a database driver?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/how-can-you-display-particular-web-page.html" target="_blank"&gt; How can you display a particular web page from an applet?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/how-can-you-get-hostname-on-basis-of-ip.html" target="_blank"&gt;How can you get the hostname on the basis of IP addres ?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/how-will-you-get-ip-address-of-machine.html" target="_blank"&gt;How can you get an IP address of a machine from its hostname?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/how-do-you-know-who-is-accessing-your.html" target="_blank"&gt; How do you know who is accessing your server?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/what-are-different-socket-options.html" target="_blank"&gt;What are different socket options?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/what-should-i-use-serversocket-or.html" target="_blank"&gt;What should I use a ServerSocket or DatagramSocket in my applications?&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-5261139969436436891?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/5261139969436436891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=5261139969436436891' title='44 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/5261139969436436891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/5261139969436436891'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2007/06/master-list-of-core-java-questions.html' title='Master List Of Core Java Questions'/><author><name>Deepun</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>44</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7300550709382233175.post-6830031140854350771</id><published>2015-03-01T08:32:00.000-08:00</published><updated>2009-08-31T07:23:21.055-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JEE'/><title type='text'>Master List Of Java EE,Open Source,Advanced Technologies Questions(Release I )</title><content type='html'>&lt;ol&gt;&lt;strong&gt;Servlets&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-servlet-explain-its-lifecyle.html" target="_blank"&gt;What is a servlet? Explain its lifecycle.&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-difference-between-cgi-and.html" target="_blank"&gt;What is the difference between CGI and servlets? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-middleware-and-what-is.html" target="_blank"&gt;What is a middleware and what is the functionality of Webserver?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/can-there-be-more-than-one-instance-of.html" target="_blank"&gt;Can there be more than one instance of a servlet at one time ?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/why-there-are-no-constructors-in.html" target="_blank"&gt;Why there are no constructors in servlets?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-servlet-context.html" target="_blank"&gt;What is a Servlet Context?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-meant-by-session-tell-me.html" target="_blank"&gt;What is meant by Session tell me something about HttpSession? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-difference-between.html" target="_blank"&gt;What is the difference between GenericServlet and HTTPServlet?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-difference-between-doget-and.html" target="_blank"&gt;What is the difference between doGet and doPost methods of HttpServlet class? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/why-do-genericservlet-and-httpservlet.html" target="_blank"&gt;Why do GenericServlet and HttpServlet class implement Serializable interface?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/how-will-you-pass-values-from-html-to.html" target="_blank"&gt;How will you pass values from HTML to the servlet?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/can-you-use-systemexit-in-your-servlet.html" target="_blank"&gt;Can you use System.exit in your servlet end code?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/if-my-browser-does-not-support-cookie.html" target="_blank"&gt;If my browser does not support Cookie and my server sends a Cookie instance what will happen? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/can-you-use-systemexit-in-your-servlet.html" target="_blank"&gt;Can you use System.exit in your servlet end code?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-difference-in-between.html" target="_blank"&gt;What is the difference in between encodeRedirectURL and encodeURL?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/how-do-you-make-servlet-thread-safe.html" target="_blank"&gt;How do you make servlet thread-safe?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/how-do-you-communicate-between-applet.html" target="_blank"&gt;How do you communicate between applet and servlet?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;strong&gt;JSP&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-difference-between-java.html" target="_blank"&gt;What is the difference between Java Servlets and Java ServerPages (JSP)? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-difference-between-include-file.html" target="_blank"&gt;What is the difference between page directive 'include' and 'jsp include' action command? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-difference-between-jspforward.html" target="_blank"&gt;What is the difference between 'jsp:forward' and HttpResponse.sendRedirect()? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-is-difference-between-include-file.html" target="_blank"&gt;What is the difference between 'include file=".."' and 'jsp:include page = ... '?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/04/what-are-implicit-objects-in-jsp.html" target="_blank"&gt;What are implicit objects in JSP?&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=7300550709382233175&amp;amp;postID=6820491473515948214" target="_blank"&gt;Explain the life-cycle methods of JSP&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/explain-different-constituents-of-jsp.html" target="_blank"&gt;Explain different constituents of JSP like comments,expressions,declarations,scriptlets.&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/does-jsp-support-xml-pages-creation.html" target="_blank"&gt;Does JSP support XML pages creation?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/how-can-i-show-various-kind-of.html" target="_blank"&gt;How can I show various kind of documents to a web client from JSP's and/or servlets?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/how-will-you-handle-runtime-exceptions.html" target="_blank"&gt;How will you handle runtime exceptions in your JSPs?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/how-can-you-prevent-caching-in-jsp.html" target="_blank"&gt;How can you prevent caching in JSP?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;strong&gt;EJB&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/how-ejb-evolved-over-years.html" target="_blank"&gt;How EJB evolved over the years?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-are-entity-bean-and-session-bean.html" target="_blank"&gt;What are Entity Bean and Session Bean?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/how-is-container-managed-entity-bean.html" target="_blank"&gt;How is container managed entity bean created?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-difference-between-container.html" target="_blank"&gt;What is the difference between Container managed persistent and Bean managed persistent&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-difference-between-ejbcreate.html" target="_blank"&gt;What is the difference between ejbCreate() and ejbPostCreate() in EntityBean?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-are-services-provided-by-ejb.html" target="_blank"&gt;What are the services provided by the EJB container ? &lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-are-new-features-of-ejb3.html" target="_blank"&gt;What are new features of EJB3?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-connection-pooling-is-it.html" target="_blank"&gt;What is Connection Pooling? Is it advantageous?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/whats-difference-between-servletjsp.html" target="_blank"&gt;What's difference between Servlet/JSP session and EJB session?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/how-is-jdojava-data-object-different.html" target="_blank"&gt;How is JDO(Java Data Object) different from VO(Value Object) ?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-session-facade.html" target="_blank"&gt;What is session facade?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;strong&gt;EJB Transactions&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-are-bean-managed-transactions.html" target="_blank"&gt;What are Bean-Managed Transactions?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-are-some-tips-for-using-bean.html" target="_blank"&gt;What are some tips for using bean-managed transaction demarcation?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-is-jts.html" target="_blank"&gt;What is JTS ?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-are-transaction-properties.html" target="_blank"&gt;What are transaction properties?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/what-are-transaction-attributes-which.html" target="_blank"&gt;What are transaction attributes ? Which transaction attributes should I use in which situations?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/05/how-can-you-handle-transaction.html" target="_blank"&gt;How can you handle transaction isolation?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;strong&gt;Struts Framework&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/what-is-struts-and-how-it-helps-in-web.html" target="_blank"&gt;What is Struts and how it helps in web development?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/explain-struts1x-in-nutshell.html" target="_blank"&gt;Explain Struts1.x in a nutshell?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/what-are-methods-in-action-class.html" target="_blank"&gt;What are the methods in Action class?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/how-you-will-handle-errors-and.html" target="_blank"&gt;How you will handle errors and exceptions in Struts?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/how-does-validator-framework-work-in.html" target="_blank"&gt;How does Validator framework work in Struts?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/what-is-dispatchaction.html" target="_blank"&gt;What is DispatchAction?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2008/02/how-to-handle-duplicate-submits-in.html"&gt; How to handle duplicate submits in Struts?&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;(new)&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;strong&gt;Spring Framework&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/what-is-spring-framework.html" target="_blank"&gt;What is Spring framework&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/why-is-spring-framework-needed-anyway.html" target="_blank"&gt;Why is Spring Framework needed anyway?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/what-do-you-understand-by-inversion-of.html" target="_blank"&gt;What do you understand by Inversion of Control/Dependency Injection?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/what-is-beanfactory.html" target="_blank"&gt;What is BeanFactory?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/explain-applicationcontext-in-spring.html" target="_blank"&gt;Explain ApplicationContext in Spring framework.&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/what-is-aspect-oriented-programming-and.html" target="_blank"&gt;What is Aspect Oriented Programming and how is it related with Spring?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/07/what-are-problems-you-have-with-jdbc.html" target="_blank"&gt;What are the problems you have with JDBC and how does Spring framework help to resolve them?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/07/explain-typical-bean-life-cycle-in.html" target="_blank"&gt;Explain typical Bean life cycle in Spring Bean Factory Container&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/07/what-are-orms-supported-by-spring-and.html" target="_blank"&gt;What are ORMs supported by Spring and how it integrates with Hibernate?&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;strong&gt;Java Message Service APIs&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/07/what-is-messaging-and-how-is-it.html"&gt;What is messaging and how is it different from RMI?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/07/when-is-jms-needed.html"&gt;When is JMS needed?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/07/how-does-jms-api-work-with-java-ee.html"&gt;How Does the JMS API Work with the Java EE Platform?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/07/explain-jms-api-architecture.html"&gt;Explain JMS API Architecture.&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/07/explain-point-to-point-messaging-domain.html"&gt;Explain Point-to-Point Messaging Domain.&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/07/explain-publishsubscribe-messaging.html"&gt;Explain Publish/Subscribe Messaging Domain.&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;strong&gt;Java Design Patterns&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/07/what-are-design-patterns-and-why-one.html"&gt;What are Design Patterns and why one needs them?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/07/what-are-different-types-of-design.html"&gt;What are different types of design patterns?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/07/what-is-singleton-design-pattern.html" target="_blank"&gt;What is Singleton Design Pattern?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/07/what-is-difference-between-abstract.html" target="_blank"&gt;What is difference between Abstract Factory and Factory Method design patterns?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/09/explain-adapter-design-pattern-in-java.html" target="_blank"&gt;Explain Adapter Design Pattern in Java&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/09/explain-decorator-design-pattern-in.html" target="_blank"&gt;Explain Decorator Design Pattern in Java&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/10/explain-facade-design-pattern-in-java.html"&gt;Explain Facade Design Pattern in Java&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;/ol&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-6830031140854350771?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/6830031140854350771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=6830031140854350771' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/6830031140854350771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/6830031140854350771'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2007/06/master-list-of-java-ee-questionsrelease.html' title='Master List Of Java EE,Open Source,Advanced Technologies Questions(Release I )'/><author><name>Deepun</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-7300550709382233175.post-3192572842021880014</id><published>2015-02-01T08:43:00.000-08:00</published><updated>2009-08-31T06:55:39.176-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Core Java'/><title type='text'>Miscellaneous Core Java Questions With Short Answers</title><content type='html'>&lt;ol&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;In a Java program, how can you divert program messages to the system console, but error messages, say to a file?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A. The class 'System has a variable out that represents the standard output, and the variable err that represents the standard error device. By default, they both point at the system console. This how the standard output could be re-directed:&lt;br /&gt;&lt;pre class="programlisting"&gt;&lt;br /&gt;Stream stream = new Stream(new FileOutputStream("error.txt"));&lt;br /&gt;System.setErr(stream);&lt;br /&gt;System.setOut(stream);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;How do you know if an explicit object casting is needed?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A. In order to assign a superclass object to a variable of a subclass,one needs to do explicit casting. For example:&lt;br /&gt;&lt;pre class="programlisting"&gt;&lt;br /&gt;Person person;&lt;br /&gt;Man man;&lt;br /&gt;man = (Man)person;&lt;br /&gt;&lt;/pre&gt;While automatic casting happens when you typecast a subclass object as parent class object.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt; What's the difference between the methods sleep() and wait() &lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A. The code sleep(1000); puts thread aside for exactly one second. The code wait(1000), causes a wait of up to one second. A thread could stop waiting earlier if it receives the notify() or notifyAll() call. The method wait() is defined in the class Object and the method sleep() is defined in the class Thread.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;Why would you use a synchronized block vs. synchronized method?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A. A synchronized blocks place locks for shorter periods than synchronized methods.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;Can you write a Java class that could be used both as an applet as well as an application?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A. Yes. Add a main() method to the applet.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;Can you call one constructor from another if a class has multiple constructors&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A. Yes. Use this() syntax.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;How will you convert a String array to an ArrayList object?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A.&lt;pre class="programlisting"&gt;&lt;br /&gt;String[] stringArray = new String[] {"x", "y", "Z"};&lt;br /&gt;List list = Arrays.asList(stringArray);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt; Does it matter in what order catch statements for FileNotFoundException and IOExceptipon are written? &lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A. Yes, it does. The &lt;i&gt;FileNoFoundException &lt;/i&gt; is inherited from the &lt;i&gt;IOException&lt;/i&gt;. Exception's subclasses have to be caught first.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;Can an inner class declared inside of a method access local variables of this method?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A. It's possible if these variables are final.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;b&gt;&lt;i&gt;What can go wrong if you replace &amp;amp;&amp;amp; with &amp;amp; in the following code:&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;pre class="programlisting"&gt;&lt;br /&gt;String a=null;&lt;br /&gt;if (a!=null &amp;amp;&amp;amp; a.length()&amp;gt;10) {...}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;A. A single ampersand here would lead to a NullPointerException.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;When should the method invokeLater()be used?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A. To ensure that Swing components are updated through the event-dispatching thread.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;What's the difference between a queue and a stack?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A. Stacks works by last-in-first-out rule (LIFO), while queues use the FIFO rule&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;You can create an abstract class that contains only abstract methods. On the other hand, you can create an interface that declares the same methods. So can you use abstract classes instead of interfaces? &lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A. Sometimes. But your class may be a descendant of another class and in this case the interface is your only option.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;If you're overriding the method equals() of an object, which other method you might also consider? &lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A.hashCode()&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;You are planning to do an indexed search in a list of objects. Which of the two Java collections should you use: &lt;/i&gt;&lt;/b&gt; &lt;b&gt;&lt;i&gt;ArrayList or LinkedList?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A. ArrayList&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;How would you make a copy of an entire Java object with its state?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A. Have this class implement Cloneable interface and call its method clone().&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;How can you minimize the need of garbage collection and make the memory use more effective?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A. Use object pooling and weak object references.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;There are two classes: A and B. The class B need to inform a class A when some important event has happened. What Java technique would you use to implement it? &lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A. If these classes are threads then consider &lt;i&gt;notify() &lt;/i&gt;or &lt;i&gt;notifyAll().&lt;/i&gt; For regular classes one can use the &lt;i&gt;   Observer &lt;/i&gt;interface.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;How will you sort a collection object?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A. &lt;pre class="programlisting"&gt;  &lt;br /&gt;// Sort&lt;br /&gt;Collections.sort(list);&lt;br /&gt;&lt;br /&gt;// Case-insensitive sort&lt;br /&gt;Collections.sort(list, String.CASE_INSENSITIVE_ORDER);&lt;br /&gt;&lt;br /&gt;// Reverse-order sort&lt;br /&gt;Collections.sort(list, Collections.reverseOrder  ());&lt;br /&gt;&lt;br /&gt;// Case-insensitive reverse-order sort&lt;br /&gt;Collections.sort(list, String.CASE_INSENSITIVE_ORDER);&lt;br /&gt;Collections.reverse(list);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;&lt;i&gt;In a Java class, one has 10 variables. One wants to serialize only 3 variables,how can this be achieved?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A.Make variables as 'transient' which are not to be serialized.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-3192572842021880014?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/3192572842021880014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=3192572842021880014' title='18 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/3192572842021880014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/3192572842021880014'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2007/05/miscellaneous-core-java-questions-with.html' title='Miscellaneous Core Java Questions With Short Answers'/><author><name>Deepun</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>18</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7300550709382233175.post-1384270668548784189</id><published>2015-01-26T06:18:00.000-08:00</published><updated>2009-08-15T10:10:03.412-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Code Snippet'/><title type='text'>Master List Of Code Snippets</title><content type='html'>&lt;ol&gt;&lt;li&gt;&lt;a href="/2007/07/code-snippetsxml-parsing-using-sax.html" target="_blank"&gt;XML Parsing Using SAX&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/07/code-snippetfile-operations.html" target="_blank"&gt;File Operations&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/07/code-snippetsexperimenting-with.html" target="_blank"&gt;Experimenting with java.util.Date.&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/code-snippets-using-javalangreflect.html" target="_blank"&gt;Using java.lang.reflect.* APIs&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/code-snippets-using-javalangcomparable.html" target="_blank"&gt;Using java.lang.Comparable.* interface&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2007/06/explain-code-snippets-thread.html" target="_blank"&gt;Thread Interruption&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2008/03/get-locale-specific-date.html" target="_blank"&gt;Get Locale Specific Date&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2008/03/write-into-excel-file-using-java.html" target="_blank"&gt; Write Into An Excel File Using Java&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2008/03/sending-email-to-gmail-smtp-server.html" target="_blank"&gt;Sending EMail To GMail SMTP Server Using Java Mail APIs&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2008/03/some-commonly-used-validations-like.html" target="_blank"&gt; Some commonly used validations like EMail,Phone Number,SSN,Numeric values through Regular Expressions&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-1384270668548784189?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/1384270668548784189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=1384270668548784189' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/1384270668548784189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/1384270668548784189'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2015/01/master-list-of-code-snippets.html' title='Master List Of Code Snippets'/><author><name>Deepun</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-7300550709382233175.post-8101714370717194044</id><published>2015-01-11T21:35:00.000-08:00</published><updated>2009-08-31T07:13:48.982-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Service Oriented Architecture'/><title type='text'>Simplifying Service Oriented Architecture</title><content type='html'>&lt;ol&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2008/04/what-is-soa.html"&gt;What is SOA?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2008/04/why-soa.html"&gt;Why SOA?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2008/04/what-are-constituents-of-soa.html"&gt;What are the constituents of SOA?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2008/04/who-suits-best-for-soa.html"&gt;Who suits best for SOA?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2008/04/when-to-avoid-implementation-of-soa.html"&gt;When to avoid implementation of SOA?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2008/04/how-to-avoid-risks-in-soa.html"&gt;How to avoid risks in SOA implementation?&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2008/04/how-soa-makes-things-better-or-even.html"&gt;How SOA makes things better or even worse?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2008/04/how-to-developtest-and-maintain-soa.html" target="_new"&gt;How to develop,test and maintain SOA based solutions?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2008/04/how-to-register-web-services-with.html" target="_new"&gt;How to register Web Services with UDDI4j?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2008/04/webservices-apache-axis-way.html" target="_new"&gt;Webservices, Apache Axis Way&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2008/04/webserivces-with-apache-axis-continued.html" target="_new"&gt;Webserivces With Apache Axis Continued...&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="/2008/04/apache-axis-with-ibms-wsadrad.html" target="_new"&gt;Apache AXIS with IBM's WSAD/RAD&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-8101714370717194044?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/8101714370717194044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=8101714370717194044' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/8101714370717194044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/8101714370717194044'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2008/04/simplifying-service-oriented.html' title='Simplifying Service Oriented Architecture'/><author><name>Deepun</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>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7300550709382233175.post-7820224320214598891</id><published>2012-01-15T01:19:00.000-08:00</published><updated>2012-01-15T01:19:50.190-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java 7'/><title type='text'>What are the enhancements in Java SE 7?</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;b&gt;Binary Literals &lt;/b&gt;- Integral types (byte, short, int, and long) can also be expressed using the binary number system. To specify a binary literal, add the prefix 0b or 0B to the number.&lt;br /&gt;&lt;b&gt;Underscores in Numeric Literals&lt;/b&gt; - Any number of underscore characters (_) can appear anywhere between digits in a numerical literal.&lt;br /&gt;&lt;b&gt;Strings in switch Statements&lt;/b&gt; - The String class in the expression of a switch statement.&lt;br /&gt;&lt;b&gt;Type Inference for Generic Instance Creation&lt;/b&gt; - One can replace the type arguments required to invoke the constructor of a generic class with an empty set of type parameters (&amp;lt;&amp;gt;) as long as the compiler can infer the type arguments from the context. This pair of angle brackets is informally called the diamond.&lt;br /&gt;&lt;b&gt;Improved Compiler Warnings and Errors When Using Non-Reifiable Formal Parameters with Varargs Methods &lt;/b&gt;- The Java SE 7 complier generates a warning at the declaration site of a varargs method or constructor with a non-reifiable varargs formal parameter. Java SE 7 introduces the compiler option -Xlint:varargs and the annotations @SafeVarargs and @SuppressWarnings({"unchecked", "varargs"}) to supress these warnings.&lt;br /&gt;&lt;b&gt;The try-with-resources Statement&lt;/b&gt; - The try-with-resources statement is a try statement that declares one or more resources. A resource is an object that must be closed after the program is finished with it. The try-with-resources statement ensures that each resource is closed at the end of the statement. Any object that implements the new &lt;i&gt;java.lang.AutoCloseable&lt;/i&gt; interface or the &lt;i&gt;java.io.Closeable&lt;/i&gt; interface can be used as a resource. The classes java.io.InputStream, OutputStream, Reader, Writer, java.sql.Connection, Statement, and ResultSet have been retrofitted to implement the AutoCloseable interface and can all be used as resources in a try-with-resources statement.&lt;br /&gt;&lt;b&gt;Catching Multiple Exception Types and Rethrowing Exceptions with Improved Type Checking&lt;/b&gt; - A single catch block can handle more than one type of exception. In addition, the compiler performs more precise analysis of rethrown exceptions than earlier releases of Java SE. This enables you to specify more specific exception types in the throws clause of a method declaration&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-7820224320214598891?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/7820224320214598891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/7820224320214598891'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2012/01/what-are-enhancements-in-java-se-7.html' title='What are the enhancements in Java SE 7?'/><author><name>Deepun</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></entry><entry><id>tag:blogger.com,1999:blog-7300550709382233175.post-4826290843103847961</id><published>2010-01-03T02:32:00.000-08:00</published><updated>2010-01-03T02:35:16.958-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hibernate'/><title type='text'>How to use Annotations with Hibernate?</title><content type='html'>Before getting into details of using annotations with Hibernate, I would suggest you to go through the &lt;a href="http://www.interviewjava.com/2009/11/how-to-persist-java-objects-using.html"&gt;previous example&lt;/a&gt;&amp;nbsp;. The example posted here is similar to the old one except it uses&amp;nbsp;annotations.Here .hbm.xml will not be required.&lt;br /&gt;&lt;br /&gt;In addition to existing jar files, following jar files are also required in class path:&lt;br /&gt;&lt;br /&gt;-hibernate-commons-annotations.jar&lt;br /&gt;-ejb3-persistence.jar&lt;br /&gt;-hibernate-annotations.jar&lt;br /&gt;&lt;br /&gt;Download these binaries from &lt;a href="http://sourceforge.net/projects/hibernate/files/hibernate-annotations/3.4.0.GA/hibernate-annotations-3.4.0.GA.zip/download" target="_blank"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The annotations&amp;nbsp;are supported Java 5 environment(both by Java SE 5.0 and Java EE 5.0) onwards and having strong coupling with under lying database.In order to support&amp;nbsp;multiple databases,&amp;nbsp;annotations&amp;nbsp;are not meant for that and better to use&amp;nbsp;hibernate&amp;nbsp;mapping files.&lt;br /&gt;&lt;br /&gt;Let us start writing with Department.java class:&lt;br /&gt;&lt;div id="iframeDiv0a371b66-d424-46e9-b3dc-9deb3d3187f3" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframe0a371b66-d424-46e9-b3dc-9deb3d3187f3" src="http://www.blogtrog.com/code.aspx?id=0a371b66-d424-46e9-b3dc-9deb3d3187f3" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 500px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDiv0a371b66-d424-46e9-b3dc-9deb3d3187f3" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: blue;"&gt;package&lt;/span&gt;&lt;span style="color: black;"&gt; com.iqjava.department;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; javax.persistence.Column;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; javax.persistence.Entity;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; javax.persistence.GeneratedValue;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; javax.persistence.Id;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; javax.persistence.Table;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;@Entity&lt;br /&gt;@Table(name&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;DEPTT&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt; Department {&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;long&lt;/span&gt;&lt;span style="color: black;"&gt; departmentId;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt;&lt;span style="color: black;"&gt; String departmentName;&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; Department() {&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; Department(String departmentName) {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;&lt;span style="color: black;"&gt;.departmentName &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; departmentName;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Id&lt;br /&gt;    @GeneratedValue&lt;br /&gt;    @Column(name&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;DEPTT_ID&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;long&lt;/span&gt;&lt;span style="color: black;"&gt; getDepartmentId() {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;&lt;span style="color: black;"&gt;.departmentId;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;span style="color: black;"&gt; setDepartmentId(&lt;/span&gt;&lt;span style="color: blue;"&gt;long&lt;/span&gt;&lt;span style="color: black;"&gt; departmentId) {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;&lt;span style="color: black;"&gt;.departmentId &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; departmentId;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Column(name&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;DEPTT_NAME&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;, nullable&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;false&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; String getDepartmentName() {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;&lt;span style="color: black;"&gt;.departmentName;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;span style="color: black;"&gt; setDepartmentName(String departmentName) {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;&lt;span style="color: black;"&gt;.departmentName &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; departmentName;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('0a371b66-d424-46e9-b3dc-9deb3d3187f3');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Some highlights of the above code:&lt;br /&gt;&lt;br /&gt;- Hibernate supports EJB 3 Annotations persistence which are contained inside javax.persistence package.&lt;br /&gt;The following annotations are used in the above code:&lt;br /&gt;&lt;br /&gt;-@Entity: represents the Entity bean class.&lt;br /&gt;-@Table: underlying RDBMS table is mapped with this tag where data is persisted.If this annotation is not mentioned then Hibernate takes class name as default table name&lt;br /&gt;-@Id: represents identifier property of Entity bean class.It determines default access strategy used by Hibernate.So if @Id is put over field then field access will be used and if it is placed over getter method then property access will be used.&lt;br /&gt;-@GenertaedValue: specify Primary Key generation strategy&lt;br /&gt;-@Column: represents the column of the table to which a property is mapped to&lt;br /&gt;&lt;br /&gt;hibernate.cfg.xml looks like as given below:&lt;br /&gt;&lt;br /&gt;&lt;div id="iframeDivb07caa44-9009-4c48-8ce7-af8f1a1b4f9b" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframeb07caa44-9009-4c48-8ce7-af8f1a1b4f9b" src="http://www.blogtrog.com/code.aspx?id=b07caa44-9009-4c48-8ce7-af8f1a1b4f9b" style="border: 1px solid #e0e0e0; height: 300px; margin: 0px; width: 500px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDivb07caa44-9009-4c48-8ce7-af8f1a1b4f9b" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: blue;"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: magenta;"&gt;xml version="1.0" encoding="UTF-8"&lt;/span&gt;&lt;span style="color: blue;"&gt;?&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;!&lt;/span&gt;&lt;span style="color: magenta;"&gt;DOCTYPE hibernate-configuration PUBLIC&lt;br /&gt;        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"&lt;br /&gt;        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;hibernate-configuration&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;session-factory&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;property &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="hibernate.connection.driver_class"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;org.hsqldb.jdbcDriver&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;property&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;property &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="hibernate.connection.url"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;jdbc:hsqldb:hsql://localhost&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;property&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;property &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="hibernate.connection.username"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;sa&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;property&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;property &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="hibernate.dialect"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;org.hibernate.dialect.HSQLDialect&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;property&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;property &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="connection.password"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;property&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;property &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="connection.pool_size"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;property&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;property &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="hibernate.dialect"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt; org.hibernate.dialect.HSQLDialect&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;property&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;property &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="show_sql"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;true&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;property&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;property &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="hbm2ddl.auto"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;create&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;property&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;mapping &lt;/span&gt;&lt;span style="color: red;"&gt;class&lt;/span&gt;&lt;span style="color: blue;"&gt;="com.iqjava.department.Department"&lt;/span&gt;&lt;span style="color: red;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;session-factory&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;hibernate-configuration&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('b07caa44-9009-4c48-8ce7-af8f1a1b4f9b');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;In HibernateUtil.java file, AnnotationConfiguration object is used instead of Configuration object.&lt;br /&gt;&lt;br /&gt;&lt;div id="iframeDiv0ab14f50-e7ca-45fa-bfe6-d2d5635a9280" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframe0ab14f50-e7ca-45fa-bfe6-d2d5635a9280" src="http://www.blogtrog.com/code.aspx?id=0ab14f50-e7ca-45fa-bfe6-d2d5635a9280" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 500px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDiv0ab14f50-e7ca-45fa-bfe6-d2d5635a9280" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: blue;"&gt;package&lt;/span&gt;&lt;span style="color: black;"&gt; com.iqjava.util;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.hibernate.SessionFactory;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.hibernate.cfg.AnnotationConfiguration;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt; HibernateUtil {&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;final&lt;/span&gt;&lt;span style="color: black;"&gt; SessionFactory sessionFactory;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt;&lt;span style="color: black;"&gt; {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;span style="color: black;"&gt; {&lt;br /&gt;            sessionFactory &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; AnnotationConfiguration().configure().buildSessionFactory();&lt;br /&gt;        } &lt;/span&gt;&lt;span style="color: blue;"&gt;catch&lt;/span&gt;&lt;span style="color: black;"&gt; (Throwable ex) {&lt;br /&gt;            System.err.println(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Initial SessionFactory creation failed.&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;+&lt;/span&gt;&lt;span style="color: black;"&gt; ex);&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;throw&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; ExceptionInInitializerError(ex);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt;&lt;span style="color: black;"&gt; SessionFactory getSessionFactory() {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; sessionFactory;&lt;br /&gt;    }&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('0ab14f50-e7ca-45fa-bfe6-d2d5635a9280');&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-4826290843103847961?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/4826290843103847961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/4826290843103847961'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2010/01/how-to-use-annotations-with-hibernate.html' title='How to use Annotations with Hibernate?'/><author><name>Deepun</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></entry><entry><id>tag:blogger.com,1999:blog-7300550709382233175.post-3942234584192617979</id><published>2009-11-04T05:59:00.000-08:00</published><updated>2010-01-03T01:30:06.479-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hibernate'/><title type='text'>How to persist the java objects using Hibernate ORM framework?</title><content type='html'>The answer to this question takes the form of a tutorial, where I will go in details, step by step.&amp;nbsp;Hibernate&amp;nbsp;reduces number of lines of coding/writing SQLs for persisting object into the database considerably. This takes focus from doing repetitive work to focus on implementing business logic to address a business problem.&lt;br /&gt;&lt;br /&gt;Hibernate uses a object relation mapping file in form of an XML or properties file. In this file there exists a mapping between a Java object and corresponding database table.First thing first, let us create the needed environment to achieve our objective. &lt;br /&gt;&lt;br /&gt;We need following tools and binaries:&lt;br /&gt;&lt;br /&gt;1.The IDE used is Eclipse Galileo(latest one while writing this post).&lt;br /&gt;2.Hibernate binaries(Hibernate Core 3.3.2 GA and Hibernate Tools 3.2.4 GA)can be downloaded from&amp;nbsp;&lt;a href="https://www.hibernate.org/6.html" target="_blank"&gt;here&lt;/a&gt;&lt;br /&gt;3.&lt;a href="http://sourceforge.net/projects/hsqldb/files/" target="_blank"&gt;Database HSQLDB 1.9&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial; line-height: 19px;"&gt;The next step is unzip Hibernate Tools 3.2.4 GA and put features and plugins contents to features and plugins directory of Eclipse Galileo. Ensure you have closed Eclipse IDE prior to this step and once you are done with copying part then restart the Eclipse Galileo.&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="line-height: 19px;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;You have to ensure following JARs have been included in the project:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="line-height: 19px;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="line-height: 19px;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;-hibernate3.jar(contains all core Hibernate files)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="line-height: 19px;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;-antlr-2.7.6.jar&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="line-height: 19px;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;-commons-collections-3.1.jar&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="line-height: 19px;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;-dom4j-1.6.1.jar&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="line-height: 19px;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;-javassist-3.9.0.GA.jar&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="line-height: 19px;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;-jta-1.1.jar&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="line-height: 19px;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;-slf4j-api-1.5.8.jar(used for logging purposes)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="line-height: 19px;"&gt;-slf4j-simple-1.5.8.jar(download it from &lt;a href="http://www.slf4j.org/dist/"&gt;here&lt;/a&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="line-height: 19px;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;-&lt;/span&gt;&lt;/span&gt;&lt;span style="line-height: 14px;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;hsqldb.jar(used for connecting to HSQL Database)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="line-height: 19px;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Once all above steps are over then choose Hibernate perspective in Eclipse IDE.Go to Window-Open Perspective-Other and select Hibernate perspective as show in the image given below:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_o-aO_ImO6Ec/SvAbua1akEI/AAAAAAAABQw/hJVgQuvuV0s/s1600-h/OpenPerspective.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_o-aO_ImO6Ec/SvAbua1akEI/AAAAAAAABQw/hJVgQuvuV0s/s320/OpenPerspective.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Next step is to define object relation mapping XML file which has .hbm.xml extension. First create a package named &lt;span style="font-style: italic;"&gt;com.iqjava.employee &lt;/span&gt;and inside this package we will create a new OR mapping XML named 'employee.hbm.xml'.(Right click on package&amp;nbsp;&lt;span style="font-style: italic;"&gt;com.iqjava.employee, &lt;/span&gt;select New -Hibernate XML Mapping File)&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_o-aO_ImO6Ec/SvAcPH0ftqI/AAAAAAAABQ4/gZ3yUpu3Hr4/s1600-h/hbmFile.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_o-aO_ImO6Ec/SvAcPH0ftqI/AAAAAAAABQ4/gZ3yUpu3Hr4/s320/hbmFile.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;having contents as given below:&lt;br /&gt;&lt;div id="iframeDive8ab9513-01b3-4db3-96e6-1d0127611b21" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframee8ab9513-01b3-4db3-96e6-1d0127611b21" src="http://www.blogtrog.com/code.aspx?id=e8ab9513-01b3-4db3-96e6-1d0127611b21" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 500px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDive8ab9513-01b3-4db3-96e6-1d0127611b21" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: blue;"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: magenta;"&gt;xml version="1.0"&lt;/span&gt;&lt;span style="color: blue;"&gt;?&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;!&lt;/span&gt;&lt;span style="color: magenta;"&gt;DOCTYPE hibernate-mapping PUBLIC&lt;br /&gt;    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"&lt;br /&gt;    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;hibernate-mapping&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;class &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="com.iqjava.employee.Employee"&lt;/span&gt;&lt;span style="color: red;"&gt; table&lt;/span&gt;&lt;span style="color: blue;"&gt;="EMP"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;meta &lt;/span&gt;&lt;span style="color: red;"&gt;attribute&lt;/span&gt;&lt;span style="color: blue;"&gt;="class-description"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;This class contains the employee details.&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;meta&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;id &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="employeeId"&lt;/span&gt;&lt;span style="color: red;"&gt; type&lt;/span&gt;&lt;span style="color: blue;"&gt;="long"&lt;/span&gt;&lt;span style="color: red;"&gt; column&lt;/span&gt;&lt;span style="color: blue;"&gt;="EMP_ID"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;generator &lt;/span&gt;&lt;span style="color: red;"&gt;class&lt;/span&gt;&lt;span style="color: blue;"&gt;="native"&lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;id&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;property &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="employeeName"&lt;/span&gt;&lt;span style="color: red;"&gt; type&lt;/span&gt;&lt;span style="color: blue;"&gt;="string"&lt;/span&gt;&lt;span style="color: red;"&gt; column&lt;/span&gt;&lt;span style="color: blue;"&gt;="EMP_NAME"&lt;/span&gt;&lt;span style="color: red;"&gt; not-null&lt;/span&gt;&lt;span style="color: blue;"&gt;="true"&lt;/span&gt;&lt;span style="color: red;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;class&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;hibernate-mapping&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('e8ab9513-01b3-4db3-96e6-1d0127611b21');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;In this OR Mapping file, class element depicts the class which will be mapped with an underlying table of RDBMS, in this case EMP table.The id element represents primary key of the table wherein attribute name represents a variable(employeeId) in Java class which is mapped with the column (attribute of id element) of the table(EMP_ID).&lt;br /&gt;&lt;br /&gt;The type attribute represents the hibernate mapping type which will convert data from Java String type to underlying database String datatype .The generator element is used for&amp;nbsp;&lt;span style="line-height: 19px;"&gt;automatically generate the primary key values.The&amp;nbsp;&lt;em style="font-size: 10pt; font-style: normal; line-height: 1.5; margin-bottom: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;"&gt;native value of class attributes ascertain that&amp;nbsp;&lt;/em&gt;hibernate picks either&amp;nbsp;&lt;em style="font-size: 10pt; font-style: normal; line-height: 1.5; margin-bottom: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;"&gt;identity&lt;/em&gt;,&amp;nbsp;&lt;em style="font-size: 10pt; font-style: normal; line-height: 1.5; margin-bottom: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;"&gt;sequence&lt;/em&gt;&amp;nbsp;or&amp;nbsp;&lt;em style="font-size: 10pt; font-style: normal; line-height: 1.5; margin-bottom: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;"&gt;hilo&lt;/em&gt;&amp;nbsp;algorithm depending upon the capabilities of the underlying database. The&amp;nbsp;&lt;em style="font-size: 10pt; font-style: normal; line-height: 1.5; margin-bottom: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;"&gt;property&lt;/em&gt;&amp;nbsp;element is used to link a property in the Java class to a column in the database table.&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The next step is to create Hibernate configuration file.Select 'src' folder, right click and choose New--Hibernate Configuration File menu option.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_o-aO_ImO6Ec/SvAd1bJQaEI/AAAAAAAABRA/epCu2NLOctg/s1600-h/cfg.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_o-aO_ImO6Ec/SvAd1bJQaEI/AAAAAAAABRA/epCu2NLOctg/s320/cfg.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The following wizard window will appear and you will have to enter the data as shown in the picture given below:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_o-aO_ImO6Ec/SvAePrqFYqI/AAAAAAAABRI/APCtAosZBLg/s1600-h/cfgXML.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_o-aO_ImO6Ec/SvAePrqFYqI/AAAAAAAABRI/APCtAosZBLg/s320/cfgXML.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The content of the&amp;nbsp;Hibernate configuration file is shown as below:&lt;br /&gt;&lt;div id="iframeDiveb305649-5741-4979-953d-528259ec0931" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframeeb305649-5741-4979-953d-528259ec0931" src="http://www.blogtrog.com/code.aspx?id=eb305649-5741-4979-953d-528259ec0931" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 500px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDiveb305649-5741-4979-953d-528259ec0931" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: blue;"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: magenta;"&gt;xml version="1.0" encoding="UTF-8"&lt;/span&gt;&lt;span style="color: blue;"&gt;?&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;!&lt;/span&gt;&lt;span style="color: magenta;"&gt;DOCTYPE hibernate-configuration PUBLIC&lt;br /&gt;        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"&lt;br /&gt;        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;hibernate-configuration&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;session-factory&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;property &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="hibernate.connection.driver_class"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;org.hsqldb.jdbcDriver&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;property&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;property &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="hibernate.connection.url"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;jdbc:hsqldb:hsql://localhost&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;property&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;property &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="hibernate.connection.username"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;sa&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;property&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;property &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="hibernate.dialect"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;org.hibernate.dialect.HSQLDialect&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;property&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;property &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="connection.password"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;property&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;property &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="connection.pool_size"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;property&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;property &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="hibernate.dialect"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt; org.hibernate.dialect.HSQLDialect&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;property&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;property &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="show_sql"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;true&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;property&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;property &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="hbm2ddl.auto"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;create&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;property&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;mapping &lt;/span&gt;&lt;span style="color: red;"&gt;resource&lt;/span&gt;&lt;span style="color: blue;"&gt;="com/iqjava/employee/employee.hbm.xml"&lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;session-factory&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;hibernate-configuration&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('eb305649-5741-4979-953d-528259ec0931');&lt;/script&gt;&lt;br /&gt;&lt;span style="white-space: normal;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Once you are done with this step then next step is to create a new&amp;nbsp;a Hibernate console configuration. To do this right click the project folder, select New --- Hibernate Console Configuration.The following Wizard appears:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: Arial; font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_o-aO_ImO6Ec/SvAf_iOq5JI/AAAAAAAABRQ/H2JXpbOrHFM/s1600-h/consoleHib.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_o-aO_ImO6Ec/SvAf_iOq5JI/AAAAAAAABRQ/H2JXpbOrHFM/s320/consoleHib.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: Arial; font-size: 13px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;By default the wizard will load the Hibernate configuration file information. Just click the Finish button to create the Hibernate console configuration.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Once above step is done, you can generate code by selecting the Hibernate Code Generation Configurations option form Run option on toolbar as depicted below:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_o-aO_ImO6Ec/SvAjCfUlyoI/AAAAAAAABRY/wqldFOJQso0/s1600-h/HibernateCodeGen.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_o-aO_ImO6Ec/SvAjCfUlyoI/AAAAAAAABRY/wqldFOJQso0/s320/HibernateCodeGen.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Once the Wizard shows up, please ensure following tabs have details according to images shown as below:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_o-aO_ImO6Ec/SvAkFc-PQ2I/AAAAAAAABRg/fI746yEKLnU/s1600-h/Main.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_o-aO_ImO6Ec/SvAkFc-PQ2I/AAAAAAAABRg/fI746yEKLnU/s320/Main.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_o-aO_ImO6Ec/SvAkOYBAvoI/AAAAAAAABRo/9bUJQxxdk14/s1600-h/exporters.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_o-aO_ImO6Ec/SvAkOYBAvoI/AAAAAAAABRo/9bUJQxxdk14/s320/exporters.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Once all these settings are ensured then hit Run button and you get Employee.java file being generated from .hbm.xml file and its contents are as shown below:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div id="iframeDive89a1433-0b8a-4a98-9ff4-d71b130aa1fb" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframee89a1433-0b8a-4a98-9ff4-d71b130aa1fb" src="http://www.blogtrog.com/code.aspx?id=e89a1433-0b8a-4a98-9ff4-d71b130aa1fb" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 500px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDive89a1433-0b8a-4a98-9ff4-d71b130aa1fb" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: blue;"&gt;package&lt;/span&gt;&lt;span style="color: black;"&gt; com.iqjava.employee;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: green;"&gt;//&lt;/span&gt;&lt;span style="color: green;"&gt; Generated Nov 3, 2009 6:02:21 PM by Hibernate Tools 3.2.4.GA&lt;/span&gt;&lt;span style="color: green;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: green;"&gt;/**&lt;/span&gt;&lt;span style="color: green;"&gt;&lt;br /&gt; * This class contains the employee details.&lt;br /&gt; &lt;/span&gt;&lt;span style="color: green;"&gt;*/&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt; Employee &lt;/span&gt;&lt;span style="color: blue;"&gt;implements&lt;/span&gt;&lt;span style="color: black;"&gt; java.io.Serializable {&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;long&lt;/span&gt;&lt;span style="color: black;"&gt; employeeId;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt;&lt;span style="color: black;"&gt; String employeeName;&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; Employee() {&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; Employee(String employeeName) {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;&lt;span style="color: black;"&gt;.employeeName &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; employeeName;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;long&lt;/span&gt;&lt;span style="color: black;"&gt; getEmployeeId() {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;&lt;span style="color: black;"&gt;.employeeId;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;span style="color: black;"&gt; setEmployeeId(&lt;/span&gt;&lt;span style="color: blue;"&gt;long&lt;/span&gt;&lt;span style="color: black;"&gt; employeeId) {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;&lt;span style="color: black;"&gt;.employeeId &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; employeeId;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; String getEmployeeName() {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;&lt;span style="color: black;"&gt;.employeeName;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;span style="color: black;"&gt; setEmployeeName(String employeeName) {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;&lt;span style="color: black;"&gt;.employeeName &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; employeeName;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Now we create HibernateUtil.java file which creates a SessionFactory from the Hibernate configuration file. The implementation of HibernateUtil.java is given as below:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial; font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div id="iframeDiv48707309-f898-49f4-97c6-4039a75567c1" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframe48707309-f898-49f4-97c6-4039a75567c1" src="http://www.blogtrog.com/code.aspx?id=48707309-f898-49f4-97c6-4039a75567c1" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 500px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDiv48707309-f898-49f4-97c6-4039a75567c1" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: blue;"&gt;package&lt;/span&gt;&lt;span style="color: black;"&gt; com.iqjava.util;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.hibernate.SessionFactory;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.hibernate.cfg.Configuration;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt; HibernateUtil {&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;final&lt;/span&gt;&lt;span style="color: black;"&gt; SessionFactory sessionFactory;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt;&lt;span style="color: black;"&gt; {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;span style="color: black;"&gt; {&lt;br /&gt;            sessionFactory &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; Configuration().configure()&lt;br /&gt;                    .buildSessionFactory();&lt;br /&gt;        } &lt;/span&gt;&lt;span style="color: blue;"&gt;catch&lt;/span&gt;&lt;span style="color: black;"&gt; (Throwable ex) {&lt;br /&gt;            System.err.println(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Initial SessionFactory creation failed.&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;+&lt;/span&gt;&lt;span style="color: black;"&gt; ex);&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;throw&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; ExceptionInInitializerError(ex);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt;&lt;span style="color: black;"&gt; SessionFactory getSessionFactory() {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; sessionFactory;&lt;br /&gt;    }&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('48707309-f898-49f4-97c6-4039a75567c1');&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The next step is to create an ExecutionClass.java. The implementation of this class is given as below:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="iframeDiv0d368eb8-3379-4ff3-80aa-4892b8abb1a9" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframe0d368eb8-3379-4ff3-80aa-4892b8abb1a9" src="http://www.blogtrog.com/code.aspx?id=0d368eb8-3379-4ff3-80aa-4892b8abb1a9" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 500px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDiv0d368eb8-3379-4ff3-80aa-4892b8abb1a9" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: blue;"&gt;package&lt;/span&gt;&lt;span style="color: black;"&gt; com.iqjava.employee;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.hibernate.HibernateException;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.hibernate.Session;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.hibernate.Transaction;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; java.util.List;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; java.util.Iterator;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; com.iqjava.util.HibernateUtil;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt; ExecutionClass {&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;span style="color: black;"&gt; main(String[] args) {&lt;br /&gt;        &lt;br /&gt;        ExecutionClass obj &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; ExecutionClass();&lt;br /&gt;        Long empId1 &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; obj.saveEmployee(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;John&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        Long empId2 &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; obj.saveEmployee(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Paul&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        Long empId3 &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; obj.saveEmployee(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Bill&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        obj.listEmployee();&lt;br /&gt;        System.out.println(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Updating emp3....&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        obj.updateEmployee(empId3, &lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Michael&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        System.out.println(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Deleting emp2....&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        obj.deleteEmployee(empId2);&lt;br /&gt;        System.out.println(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;List employees....&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        obj.listEmployee();&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; Long saveEmployee(String employeeName)&lt;br /&gt;    {&lt;br /&gt;        Session session &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; HibernateUtil.getSessionFactory().openSession();&lt;br /&gt;        Transaction transaction &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;null&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;br /&gt;        Long empId &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;null&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;span style="color: black;"&gt; {&lt;br /&gt;            transaction &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; session.beginTransaction();&lt;br /&gt;            Employee emp &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; Employee();&lt;br /&gt;            emp.setEmployeeName(employeeName);&lt;br /&gt;            empId &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; (Long) session.save(emp);&lt;br /&gt;            transaction.commit();&lt;br /&gt;        } &lt;/span&gt;&lt;span style="color: blue;"&gt;catch&lt;/span&gt;&lt;span style="color: black;"&gt; (HibernateException e) {&lt;br /&gt;            transaction.rollback();&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        } &lt;/span&gt;&lt;span style="color: blue;"&gt;finally&lt;/span&gt;&lt;span style="color: black;"&gt; {&lt;br /&gt;            session.close();&lt;br /&gt;        }&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; empId;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;span style="color: black;"&gt; listEmployee()&lt;br /&gt;    {&lt;br /&gt;        Session session &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; HibernateUtil.getSessionFactory().openSession();&lt;br /&gt;        Transaction transaction &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;null&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;span style="color: black;"&gt; {&lt;br /&gt;            transaction &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; session.beginTransaction();&lt;br /&gt;            List emps &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; session.createQuery(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;from Employee&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;).list();&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;&lt;span style="color: black;"&gt; (Iterator iterator &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; emps.iterator(); iterator.hasNext();)&lt;br /&gt;            {&lt;br /&gt;                Employee emp &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; (Employee) iterator.next();&lt;br /&gt;                System.out.println(emp.getEmployeeName());&lt;br /&gt;            }&lt;br /&gt;            transaction.commit();&lt;br /&gt;        } &lt;/span&gt;&lt;span style="color: blue;"&gt;catch&lt;/span&gt;&lt;span style="color: black;"&gt; (HibernateException e) {&lt;br /&gt;            transaction.rollback();&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        } &lt;/span&gt;&lt;span style="color: blue;"&gt;finally&lt;/span&gt;&lt;span style="color: black;"&gt; {&lt;br /&gt;            session.close();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;span style="color: black;"&gt; updateEmployee(Long empId, String employeeName)&lt;br /&gt;    {&lt;br /&gt;        Session session &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; HibernateUtil.getSessionFactory().openSession();&lt;br /&gt;        Transaction transaction &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;null&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;span style="color: black;"&gt; {&lt;br /&gt;            transaction &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; session.beginTransaction();&lt;br /&gt;            Employee emp &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; (Employee) session.get(Employee.&lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt;, empId);&lt;br /&gt;            emp.setEmployeeName(employeeName);&lt;br /&gt;            transaction.commit();&lt;br /&gt;        } &lt;/span&gt;&lt;span style="color: blue;"&gt;catch&lt;/span&gt;&lt;span style="color: black;"&gt; (HibernateException e) {&lt;br /&gt;            transaction.rollback();&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        } &lt;/span&gt;&lt;span style="color: blue;"&gt;finally&lt;/span&gt;&lt;span style="color: black;"&gt; {&lt;br /&gt;            session.close();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;span style="color: black;"&gt; deleteEmployee(Long empId)&lt;br /&gt;    {&lt;br /&gt;        Session session &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; HibernateUtil.getSessionFactory().openSession();&lt;br /&gt;        Transaction transaction &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;null&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;span style="color: black;"&gt; {&lt;br /&gt;            transaction &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; session.beginTransaction();&lt;br /&gt;            Employee emp &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; (Employee) session.get(Employee.&lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt;, empId);&lt;br /&gt;            session.delete(emp);&lt;br /&gt;            transaction.commit();&lt;br /&gt;        } &lt;/span&gt;&lt;span style="color: blue;"&gt;catch&lt;/span&gt;&lt;span style="color: black;"&gt; (HibernateException e) {&lt;br /&gt;            transaction.rollback();&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        } &lt;/span&gt;&lt;span style="color: blue;"&gt;finally&lt;/span&gt;&lt;span style="color: black;"&gt; {&lt;br /&gt;            session.close();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('0d368eb8-3379-4ff3-80aa-4892b8abb1a9');&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;The code details of the above are self explanatory.The project structure in Eclipse is depicted as shown below:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_o-aO_ImO6Ec/SvGCzmdrjGI/AAAAAAAABR4/tWKlIoIhR4c/s1600-h/prjStruct.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_o-aO_ImO6Ec/SvGCzmdrjGI/AAAAAAAABR4/tWKlIoIhR4c/s320/prjStruct.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Before executing the ExecutionClass.java., please ensure you have started the HSQLDB server as depicted in image shown below&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_o-aO_ImO6Ec/SvGFy8twYYI/AAAAAAAABSA/oUPIg9hOTfQ/s1600-h/serverStart.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_o-aO_ImO6Ec/SvGFy8twYYI/AAAAAAAABSA/oUPIg9hOTfQ/s320/serverStart.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: Arial; font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size: small;"&gt;Once the code in&amp;nbsp;ExecutionClass.java is executed then console of Eclipse IDE shows following output:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div id="iframeDiv775f88d2-ed2e-4745-993a-e4286785d5ef" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframe775f88d2-ed2e-4745-993a-e4286785d5ef" src="http://www.blogtrog.com/code.aspx?id=775f88d2-ed2e-4745-993a-e4286785d5ef" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 500px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDiv775f88d2-ed2e-4745-993a-e4286785d5ef" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="color: black;"&gt;31&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;Environment - Hibernate &lt;/span&gt;&lt;span style="color: black;"&gt;3.3&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;2&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;GA&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;31&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;Environment - hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;properties &lt;/span&gt;&lt;span style="color: blue;"&gt;not&lt;/span&gt;&lt;span style="color: black;"&gt; found&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;47&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;Environment - Bytecode provider name : javassist&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;47&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;Environment - using JDK &lt;/span&gt;&lt;span style="color: black;"&gt;1.4&lt;/span&gt;&lt;span style="color: black;"&gt; java&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;sql&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;Timestamp handling&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;219&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;Configuration - configuring from resource: &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;xml&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;219&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;Configuration - Configuration resource: &lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;xml&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;437&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;Configuration - Reading mappings from resource : com&lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;iqjava&lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;employee&lt;/span&gt;&lt;span style="color: black;"&gt;/&lt;/span&gt;&lt;span style="color: black;"&gt;employee&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hbm&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;xml&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;594&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;HbmBinder - Mapping class: com&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;iqjava&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;employee&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;Employee -&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt; EMP&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;625&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;Configuration - Configured SessionFactory: null&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;750&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;connection&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;DriverManagerConnectionProvider - Using Hibernate built-in connection pool &lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: blue;"&gt;not&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;&lt;span style="color: black;"&gt; production &lt;/span&gt;&lt;span style="color: blue;"&gt;use&lt;/span&gt;&lt;span style="color: black;"&gt;!&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;750&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;connection&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;DriverManagerConnectionProvider - Hibernate connection pool size: &lt;/span&gt;&lt;span style="color: black;"&gt;1&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;750&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;connection&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;DriverManagerConnectionProvider - autocommit &lt;/span&gt;&lt;span style="color: blue;"&gt;mode&lt;/span&gt;&lt;span style="color: black;"&gt;: false&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;781&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;connection&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;DriverManagerConnectionProvider - using driver: org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hsqldb&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;jdbcDriver at URL: jdbc&lt;/span&gt;&lt;span style="color: maroon;"&gt;:hsqldb:hsql&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: black;"&gt;//&lt;/span&gt;&lt;span style="color: black;"&gt;localhost&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;781&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;connection&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;DriverManagerConnectionProvider - connection properties: {user&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;sa&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: black;"&gt; password&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;****}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1140&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - RDBMS: HSQL Database Engine&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: black;"&gt; version: &lt;/span&gt;&lt;span style="color: black;"&gt;1.9&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;0&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1140&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - JDBC driver: HSQL Database Engine Driver&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: black;"&gt; version: &lt;/span&gt;&lt;span style="color: black;"&gt;1.9&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;0&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1203&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;dialect&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;Dialect - Using dialect: org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;dialect&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;HSQLDialect&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1219&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;transaction&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;TransactionFactoryFactory - Using default transaction strategy &lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;direct JDBC transactions&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1219&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;transaction&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;TransactionManagerLookupFactory - No TransactionManagerLookup configured &lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;in JTA environment&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;use&lt;/span&gt;&lt;span style="color: black;"&gt; of read-write or transactional second-level &lt;/span&gt;&lt;span style="color: blue;"&gt;cache&lt;/span&gt;&lt;span style="color: black;"&gt; is &lt;/span&gt;&lt;span style="color: blue;"&gt;not&lt;/span&gt;&lt;span style="color: black;"&gt; recommended&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1219&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - Automatic flush during beforeCompletion&lt;/span&gt;&lt;span style="color: black;"&gt;()&lt;/span&gt;&lt;span style="color: black;"&gt;: disabled&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1219&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - Automatic session close at &lt;/span&gt;&lt;span style="color: blue;"&gt;end&lt;/span&gt;&lt;span style="color: black;"&gt; of transaction: disabled&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1219&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - JDBC batch size: &lt;/span&gt;&lt;span style="color: black;"&gt;15&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1219&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - JDBC batch updates &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;&lt;span style="color: black;"&gt; versioned data: disabled&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1219&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - Scrollable result sets: enabled&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1219&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - JDBC3 getGeneratedKeys&lt;/span&gt;&lt;span style="color: black;"&gt;()&lt;/span&gt;&lt;span style="color: black;"&gt;: enabled&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1219&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - Connection release &lt;/span&gt;&lt;span style="color: blue;"&gt;mode&lt;/span&gt;&lt;span style="color: black;"&gt;: auto&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1219&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - Default batch fetch size: &lt;/span&gt;&lt;span style="color: black;"&gt;1&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1219&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - Generate SQL with comments: disabled&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1219&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - Order SQL updates by primary key: disabled&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1219&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - Order SQL inserts &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;&lt;span style="color: black;"&gt; batching: disabled&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1219&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - Query translator: org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hql&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;ast&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;ASTQueryTranslatorFactory&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1234&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hql&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;ast&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1234&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - Query language substitutions: {}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1234&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - JPA-QL strict compliance: disabled&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1234&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - Second-level &lt;/span&gt;&lt;span style="color: blue;"&gt;cache&lt;/span&gt;&lt;span style="color: black;"&gt;: enabled&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1234&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - Query &lt;/span&gt;&lt;span style="color: blue;"&gt;cache&lt;/span&gt;&lt;span style="color: black;"&gt;: disabled&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1234&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - &lt;/span&gt;&lt;span style="color: blue;"&gt;Cache&lt;/span&gt;&lt;span style="color: black;"&gt; region factory : org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: blue;"&gt;cache&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;impl&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;NoCachingRegionFactory&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1234&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - Optimize &lt;/span&gt;&lt;span style="color: blue;"&gt;cache&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;&lt;span style="color: black;"&gt; minimal puts: disabled&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1234&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - Structured second-level &lt;/span&gt;&lt;span style="color: blue;"&gt;cache&lt;/span&gt;&lt;span style="color: black;"&gt; entries: disabled&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1250&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - Echoing all SQL to stdout&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1250&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - Statistics: disabled&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1250&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - Deleted entity synthetic identifier rollback: disabled&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1250&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - Default entity-&lt;/span&gt;&lt;span style="color: blue;"&gt;mode&lt;/span&gt;&lt;span style="color: black;"&gt;: pojo&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1250&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cfg&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SettingsFactory - Named query checking : enabled&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1359&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;impl&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SessionFactoryImpl - building session factory&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1797&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;impl&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SessionFactoryObjectFactory - &lt;/span&gt;&lt;span style="color: blue;"&gt;Not&lt;/span&gt;&lt;span style="color: black;"&gt; binding factory to JNDI&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: black;"&gt; no JNDI name configured&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1812&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;tool&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hbm2ddl&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SchemaExport - Running hbm2ddl schema export&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1812&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;tool&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hbm2ddl&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SchemaExport - exporting generated schema to database&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1812&lt;/span&gt;&lt;span style="color: black;"&gt; [main] INFO org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hibernate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;tool&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;hbm2ddl&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;SchemaExport - schema export complete&lt;br /&gt;Hibernate: insert into EMP &lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;EMP_ID&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: black;"&gt; EMP_NAME&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt; values &lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;null&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: black;"&gt; ?&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;Hibernate: insert into EMP &lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;EMP_ID&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: black;"&gt; EMP_NAME&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt; values &lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;null&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: black;"&gt; ?&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;Hibernate: insert into EMP &lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;EMP_ID&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: black;"&gt; EMP_NAME&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt; values &lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;null&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: black;"&gt; ?&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;Hibernate: &lt;/span&gt;&lt;span style="color: blue;"&gt;select&lt;/span&gt;&lt;span style="color: black;"&gt; employee0_&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;EMP_ID as EMP1_0_&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: black;"&gt; employee0_&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;EMP_NAME as EMP2_0_ from EMP employee0_&lt;br /&gt;John&lt;br /&gt;Paul&lt;br /&gt;Bill&lt;br /&gt;Updating emp3&lt;/span&gt;&lt;span style="color: black;"&gt;....&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;Hibernate: &lt;/span&gt;&lt;span style="color: blue;"&gt;select&lt;/span&gt;&lt;span style="color: black;"&gt; employee0_&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;EMP_ID as EMP1_0_0_&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: black;"&gt; employee0_&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;EMP_NAME as EMP2_0_0_ from EMP employee0_ where employee0_&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;EMP_ID&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;?&lt;br /&gt;Hibernate: update EMP &lt;/span&gt;&lt;span style="color: blue;"&gt;set&lt;/span&gt;&lt;span style="color: black;"&gt; EMP_NAME&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;? where EMP_ID&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;?&lt;br /&gt;Deleting emp2&lt;/span&gt;&lt;span style="color: black;"&gt;....&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;Hibernate: &lt;/span&gt;&lt;span style="color: blue;"&gt;select&lt;/span&gt;&lt;span style="color: black;"&gt; employee0_&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;EMP_ID as EMP1_0_0_&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: black;"&gt; employee0_&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;EMP_NAME as EMP2_0_0_ from EMP employee0_ where employee0_&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;EMP_ID&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;?&lt;br /&gt;Hibernate: delete from EMP where EMP_ID&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;?&lt;br /&gt;List employees&lt;/span&gt;&lt;span style="color: black;"&gt;....&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;Hibernate: &lt;/span&gt;&lt;span style="color: blue;"&gt;select&lt;/span&gt;&lt;span style="color: black;"&gt; employee0_&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;EMP_ID as EMP1_0_&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: black;"&gt; employee0_&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;EMP_NAME as EMP2_0_ from EMP employee0_&lt;br /&gt;John&lt;br /&gt;Michael&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('775f88d2-ed2e-4745-993a-e4286785d5ef');&lt;/script&gt;&lt;br /&gt;Check if the database schema is created and the data is inserted into the EMP table or not. Simply open a new command prompt, go to the hsqldb installed directory and type the following command.&lt;br /&gt;java -cp ./lib/hsqldb.jar org.hsqldb.util.DatabaseManager&lt;br /&gt;The dialog box as shown below pops up&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_o-aO_ImO6Ec/SvGjNWFd9QI/AAAAAAAABSQ/kA-balWvDxY/s1600-h/dbView.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_o-aO_ImO6Ec/SvGjNWFd9QI/AAAAAAAABSQ/kA-balWvDxY/s320/dbView.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;and here select Type as "HSQL Database Engine Server" and click Ok.You see the HSQL Database Manager window as shown below, type the SQL as shown and press execute button. The result shown depicts data existing in the database.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_o-aO_ImO6Ec/SvGSGD3kY0I/AAAAAAAABSI/be622Aa4Dr8/s1600-h/dbOP.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_o-aO_ImO6Ec/SvGSGD3kY0I/AAAAAAAABSI/be622Aa4Dr8/s320/dbOP.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;One can exit from the database by typing 'shutdown' and hitting Execute button.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-3942234584192617979?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/3942234584192617979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/3942234584192617979'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/11/how-to-persist-java-objects-using.html' title='How to persist the java objects using Hibernate ORM framework?'/><author><name>Deepun</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><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_o-aO_ImO6Ec/SvAbua1akEI/AAAAAAAABQw/hJVgQuvuV0s/s72-c/OpenPerspective.JPG' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7300550709382233175.post-6023273191282587925</id><published>2009-10-08T04:41:00.000-07:00</published><updated>2009-10-08T04:42:53.239-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ANT'/><title type='text'>How is ANT Property Task used?</title><content type='html'>In order to to set the Ant properties, the &amp;lt;property&amp;gt; task is used. Once property value is set, it cannot be changed. It means they are immutable.In order to set a property to a specific value, the name and value pair is used.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Example&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;property name=&amp;quot;project.name&amp;quot; value=&amp;quot;IQJava&amp;quot;/&amp;gt;&lt;br /&gt;&lt;br /&gt;If you want to set a property to a location then name/location assignment is used.&lt;br /&gt;To use the properties surround them with ${}.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Example&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;property location=&amp;quot;destination&amp;quot; name=&amp;quot;dest.dir&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;property name=&amp;quot;war.dir&amp;quot; location=&amp;quot;${dest.dir}/${project.name}&amp;quot;/&amp;gt;&lt;br /&gt;&lt;br /&gt;A build.xml as shown in following code box displays how effectively property tasks can be used within a build.xml:&lt;br /&gt;&lt;div id='iframeDivc9334be3-78fb-4be9-830d-1b99b93d4197' style='display:none;margin:0px;'&gt;&lt;iframe id='iframec9334be3-78fb-4be9-830d-1b99b93d4197' src='http://www.blogtrog.com/code.aspx?id=c9334be3-78fb-4be9-830d-1b99b93d4197' style='width: 500px; height: 200px; border: 1px solid #e0e0e0;margin:0px;' frameborder='0'&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div id='noIframeDivc9334be3-78fb-4be9-830d-1b99b93d4197' style='display:block;margin:0px;'&gt;&lt;pre&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;project &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;basedir&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;.&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; default&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;all&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;property &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;gensrc.dir&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;gen_src&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;property &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;release.dir&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;release&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;property &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;src.dir&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;../src&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;property &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;lib.dir&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;../externals/lib&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;     &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;property &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;class.dir&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;classes&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;property &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;class.dir.lib&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;${class.dir}/lib&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;property &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;class.dir.src&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;${class.dir}/src&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;import &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;file&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;one-jar-ant-task.xml&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;lt;!--&lt;/span&gt;&lt;span style="color: #008000;"&gt; Deletes the directories and files....&lt;/span&gt;&lt;span style="color: #008000;"&gt;--&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;target &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;clean&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;delete &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;dir&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;${gensrc.dir}&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;delete &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;dir&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;${class.dir}&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;delete&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;fileset &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;dir&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;${lib.dir}&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;                &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;include &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;**/xyz.jar&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;fileset&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;fileset &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;dir&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;${release.dir}&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;                &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;include &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;**/abc.jar&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;fileset&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;delete&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;    &lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;target&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;lt;!--&lt;/span&gt;&lt;span style="color: #008000;"&gt; Prepare the Directories needed for code generation &lt;/span&gt;&lt;span style="color: #008000;"&gt;--&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;target &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;prepare&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;mkdir &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;dir&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;${class.dir}&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;mkdir &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;dir&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;${gensrc.dir}&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;mkdir &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;dir&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;${class.dir.lib}&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;mkdir &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;dir&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;${class.dir.src}&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;target&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;lt;!--&lt;/span&gt;&lt;span style="color: #008000;"&gt; Compile the source code available in src folder &lt;/span&gt;&lt;span style="color: #008000;"&gt;--&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;target &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;compilesrc&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;javac &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;srcdir&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;${src.dir}&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; destdir&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;${class.dir.src}&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; target&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;1.4&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; source&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;1.4&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt;&lt;br /&gt;            debug&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;off&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; deprecation&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;on&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; optimize&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;off&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; encoding&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;iso-8859-1&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;classpath &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;                 &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;fileset &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;dir&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;${lib.dir}&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; includes&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;**/*.jar&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;classpath&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;javac&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;copy &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;todir&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;${class.dir.src}&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;fileset &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;dir&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;${src.dir}&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; includes&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;*.properties&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;copy&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;target&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #008000;"&gt;&amp;lt;!--&lt;/span&gt;&lt;span style="color: #008000;"&gt; Generate the lib jar file &lt;/span&gt;&lt;span style="color: #008000;"&gt;--&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;target &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;lib&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;jar &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;manifest&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;manifest.mf&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; destfile&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;${lib.dir}/xyz.jar&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; includes&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;**/*.class&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; basedir&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;${class.dir.lib}&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;target&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;project&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language='javascript' src='http://www.blogtrog.com/scripts/bt_code.js' type='text/javascript'&gt;&lt;/script&gt;&lt;script language='javascript' type='text/javascript'&gt;bt_code_init('c9334be3-78fb-4be9-830d-1b99b93d4197');&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-6023273191282587925?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/6023273191282587925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/6023273191282587925'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/10/how-is-ant-property-task-used.html' title='How is ANT Property Task used?'/><author><name>Deepun</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></entry><entry><id>tag:blogger.com,1999:blog-7300550709382233175.post-3258296887035331553</id><published>2009-10-08T03:21:00.000-07:00</published><updated>2009-10-08T03:23:47.985-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ANT'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse IDE'/><title type='text'>How to integrate ANT tool with Eclipse IDE?</title><content type='html'>ANT Eclipse IDE(latest edition of Eclipse IDE is &lt;a href="http://www.eclipse.org/galileo/"&gt;Galileo&lt;/a&gt;) integration is a very simple process as summarized in following steps:&lt;br /&gt;&lt;br /&gt;1. As a first step, create a Java Project in Eclipse IDE.&lt;br /&gt;&lt;br /&gt;2. Associate a build.xml with this project and ensure you put this XML at the same location as shown in package structure in Eclipse IDE :&lt;br /&gt;(Click images to enlarge)&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_o-aO_ImO6Ec/Ss25hYRf_ZI/AAAAAAAABPQ/2dDIrk694N4/s1600-h/ANTEcIDE.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_o-aO_ImO6Ec/Ss25hYRf_ZI/AAAAAAAABPQ/2dDIrk694N4/s320/ANTEcIDE.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The code of build.xml is as given below:&lt;br /&gt;&lt;div id='iframeDiv8f704ff2-7a9b-48ce-afc6-283665fd7b10' style='display:none;margin:0px;'&gt;&lt;iframe id='iframe8f704ff2-7a9b-48ce-afc6-283665fd7b10' src='http://www.blogtrog.com/code.aspx?id=8f704ff2-7a9b-48ce-afc6-283665fd7b10' style='width: 500px; height: 200px; border: 1px solid #e0e0e0;margin:0px;' frameborder='0'&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div id='noIframeDiv8f704ff2-7a9b-48ce-afc6-283665fd7b10' style='display:block;margin:0px;'&gt;&lt;pre&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #FF00FF;"&gt;xml version=&amp;quot;1.0&amp;quot; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;?&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;project &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;IQJava&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; default&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;execute&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;target &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;init&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; depends&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;clean&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;mkdir &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;dir&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;build/classes&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;target&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;target &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;compile&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; depends&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;init&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;javac &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;srcdir&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;src&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; destdir&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;build/classes&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;target&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;target &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;execute&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; depends&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;compile&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;java &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;classname&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;com.iqjava.ant.AntExample&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; classpath&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;build/classes&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;target&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;target &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;clean&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;delete &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;dir&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=&amp;quot;build&amp;quot;&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;target&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;project&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language='javascript' src='http://www.blogtrog.com/scripts/bt_code.js' type='text/javascript'&gt;&lt;/script&gt;&lt;script language='javascript' type='text/javascript'&gt;bt_code_init('8f704ff2-7a9b-48ce-afc6-283665fd7b10');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;3. Run this build XML&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_o-aO_ImO6Ec/Ss28akPRVzI/AAAAAAAABPY/XKozEjsOjok/s1600-h/ant2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_o-aO_ImO6Ec/Ss28akPRVzI/AAAAAAAABPY/XKozEjsOjok/s320/ant2.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;4. The output of this execution will look like as given below:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_o-aO_ImO6Ec/Ss28spyUTLI/AAAAAAAABPg/Sn6FjWw1jUE/s1600-h/output.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_o-aO_ImO6Ec/Ss28spyUTLI/AAAAAAAABPg/Sn6FjWw1jUE/s320/output.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-3258296887035331553?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/3258296887035331553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/3258296887035331553'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/10/how-to-integrate-ant-tool-with-eclipse.html' title='How to integrate ANT tool with Eclipse IDE?'/><author><name>Deepun</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><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_o-aO_ImO6Ec/Ss25hYRf_ZI/AAAAAAAABPQ/2dDIrk694N4/s72-c/ANTEcIDE.JPG' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7300550709382233175.post-5195990000325986209</id><published>2009-10-07T09:38:00.000-07:00</published><updated>2009-10-08T02:33:43.979-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ANT'/><title type='text'>What is ANT and how can one configure it?</title><content type='html'>ANT is a Java based build tool and helps in automating whole of build process of a Java project.&lt;br /&gt;ANT uses an XML build file and by default it looks for a build file named build.xml from the directory it has been executed.&lt;br /&gt;&lt;br /&gt;A build.xml contains several targets e.g. creating or deleting directory structure, post compilation creation of jar or ear files, extracting/unzipping jar/ear files etc.One target can depend upon one or more targets and it can contain one or more tasks.&lt;br /&gt;&lt;br /&gt;One can download Apace Ant 1.7.1 from &lt;a href="http://ant.apache.org/bindownload.cgi"&gt;here&lt;/a&gt;.Once that is done, extract it any of your local drive. Set the system variables as follows: &lt;br /&gt;&lt;br /&gt;ANT_HOME =D:\apache-ant-1.7.1 (Here I have extracted the ANT ZIP at D drive)&lt;br /&gt;PATH = %ANT_HOME%\bin&lt;br /&gt;&lt;br /&gt;To ensure proper installation of ANT, go to command prompt and execute the command "ant - version", you will see the installed ant version.&lt;br /&gt;&lt;br /&gt;The execution of ANT file is done from the directory where build.xml resides and simply typing ant command on console and hit enter will start the execution of build file.&lt;br /&gt;&lt;br /&gt;The build.xml looks like as given below:&lt;br /&gt;&lt;span style="font-family: monospace; white-space: pre;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: magenta;"&gt;xml version="1.0" &lt;/span&gt;&lt;span style="color: blue;"&gt;?&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div id="noIframeDivec12f391-f064-4afe-a647-e4a41db3319a" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;project &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="IQJava"&lt;/span&gt;&lt;span style="color: red;"&gt; default&lt;/span&gt;&lt;span style="color: blue;"&gt;="compress"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;target &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="compile"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;javac &lt;/span&gt;&lt;span style="color: red;"&gt;srcdir&lt;/span&gt;&lt;span style="color: blue;"&gt;="com/iqjava/log4j"&lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;echo&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt; Compilation Complete! &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;echo&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;target&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;    &lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;target &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="compress"&lt;/span&gt;&lt;span style="color: red;"&gt; depends&lt;/span&gt;&lt;span style="color: blue;"&gt;="compile"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;jar &lt;/span&gt;&lt;span style="color: red;"&gt;destfile&lt;/span&gt;&lt;span style="color: blue;"&gt;="IQJava.jar"&lt;/span&gt;&lt;span style="color: red;"&gt; basedir&lt;/span&gt;&lt;span style="color: blue;"&gt;="."&lt;/span&gt;&lt;span style="color: red;"&gt; includes&lt;/span&gt;&lt;span style="color: blue;"&gt;="*.class"&lt;/span&gt;&lt;span style="color: red;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;echo&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt; Building .jar file Complete! &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;echo&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;target&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;project&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('ec12f391-f064-4afe-a647-e4a41db3319a');&lt;/script&gt;In the build.xml,&amp;lt;project&amp;gt; element is the root element, name attribute of this represents the name of the project. &lt;br /&gt;&lt;br /&gt;&amp;lt;target&amp;gt; element can exist multiple times within project element and each one of them represents a single stage. In the above build.xml, we have compile target element which contains two tasks, one - &amp;lt;echo&amp;gt; and the other &amp;lt;javac&amp;gt; which builds java files.&lt;br /&gt;&lt;br /&gt;The other target element 'compress' is dependent upon compile target element. It creates a jar file which includes all the .class files in current directory.&lt;br /&gt;&lt;br /&gt;The echo tasks just display messages on console.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-5195990000325986209?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/5195990000325986209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/5195990000325986209'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/10/what-is-ant-and-how-can-one-configure.html' title='What is ANT and how can one configure it?'/><author><name>Deepun</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></entry><entry><id>tag:blogger.com,1999:blog-7300550709382233175.post-7382838239199505196</id><published>2009-10-05T08:29:00.001-07:00</published><updated>2009-10-05T09:45:51.015-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='log4j'/><title type='text'>How do you configure log4j with XML?</title><content type='html'>This configuration of log4j with XML consists of following files:&lt;br /&gt;&lt;br /&gt;a.XMLLog4jExample.java&lt;br /&gt;b.log4j.xml&lt;br /&gt;&lt;br /&gt;&lt;b&gt;XMLLog4jExample.java&lt;/b&gt;&lt;br /&gt;&lt;div id='iframeDiv488435cf-35a9-4475-a72b-3cb7cfc262b5' style='display:none;margin:0px;'&gt;&lt;iframe id='iframe488435cf-35a9-4475-a72b-3cb7cfc262b5' src='http://www.blogtrog.com/code.aspx?id=488435cf-35a9-4475-a72b-3cb7cfc262b5' style='width: 500px; height: 200px; border: 1px solid #e0e0e0;margin:0px;' frameborder='0'&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div id='noIframeDiv488435cf-35a9-4475-a72b-3cb7cfc262b5' style='display:block;margin:0px;'&gt;&lt;pre&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #0000FF;"&gt;package&lt;/span&gt;&lt;span style="color: #000000;"&gt; com.iqjava.log4j;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;import&lt;/span&gt;&lt;span style="color: #000000;"&gt; org.apache.log4j.Logger;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;import&lt;/span&gt;&lt;span style="color: #000000;"&gt; org.apache.log4j.xml.DOMConfigurator;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;class&lt;/span&gt;&lt;span style="color: #000000;"&gt; XMLLog4jExample {&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;static&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;final&lt;/span&gt;&lt;span style="color: #000000;"&gt; Logger logger &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; Logger.getLogger(XMLLog4jExample.&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;class&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;static&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;void&lt;/span&gt;&lt;span style="color: #000000;"&gt; main(String[] args) {&lt;br /&gt;        DOMConfigurator.configure(&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;log4j.xml&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;        logger.debug(&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;This is a debug message&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;        logger.info(&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;This is an info message&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;        logger.warn(&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;This is a warn message&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;        logger.error(&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;This is an error message&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;        logger.fatal(&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;This is a fatal message&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language='javascript' src='http://www.blogtrog.com/scripts/bt_code.js' type='text/javascript'&gt;&lt;/script&gt;&lt;script language='javascript' type='text/javascript'&gt;bt_code_init('488435cf-35a9-4475-a72b-3cb7cfc262b5');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;log4j.xml looks like:&lt;/b&gt;&lt;br /&gt;&lt;span style="color: #333333; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif; font-size: small;"&gt;&lt;span style="font-size: 13px; white-space: pre-wrap;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333333; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif; font-size: small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333333; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif; font-size: small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333333; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif; font-size: small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333333; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif; font-size: small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333333; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif; font-size: small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #333333; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif; font-size: small;"&gt;&lt;div id="iframeDive27a80b5-a617-45ef-85a9-95546e15943e" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframee27a80b5-a617-45ef-85a9-95546e15943e" src="http://www.blogtrog.com/code.aspx?id=e27a80b5-a617-45ef-85a9-95546e15943e" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 500px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDive27a80b5-a617-45ef-85a9-95546e15943e" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: blue;"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: magenta;"&gt;xml version="1.0" encoding="UTF-8" &lt;/span&gt;&lt;span style="color: blue;"&gt;?&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;!&lt;/span&gt;&lt;span style="color: magenta;"&gt;DOCTYPE log4j:configuration SYSTEM "log4j.dtd"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;log4j:configuration &lt;/span&gt;&lt;span style="color: red;"&gt;xmlns:log4j&lt;/span&gt;&lt;span style="color: blue;"&gt;='http://jakarta.apache.org/log4j/'&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;appender &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="CA"&lt;/span&gt;&lt;span style="color: red;"&gt; class&lt;/span&gt;&lt;span style="color: blue;"&gt;="org.apache.log4j.ConsoleAppender"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;layout &lt;/span&gt;&lt;span style="color: red;"&gt;class&lt;/span&gt;&lt;span style="color: blue;"&gt;="org.apache.log4j.PatternLayout"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;param &lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;="ConversionPattern"&lt;/span&gt;&lt;span style="color: red;"&gt; value&lt;/span&gt;&lt;span style="color: blue;"&gt;="%-4r [%t] %-5p %c %x - %m%n"&lt;/span&gt;&lt;span style="color: red;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;layout&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;appender&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;root&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;level &lt;/span&gt;&lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;="debug"&lt;/span&gt;&lt;span style="color: red;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;appender-ref &lt;/span&gt;&lt;span style="color: red;"&gt;ref&lt;/span&gt;&lt;span style="color: blue;"&gt;="CA"&lt;/span&gt;&lt;span style="color: red;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;root&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;log4j:configuration&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/span&gt;&lt;span style="color: #333333; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif; font-size: small;"&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('e27a80b5-a617-45ef-85a9-95546e15943e');&lt;/script&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Here goes the output of the program:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id='iframeDivfc077387-2a13-4291-936e-cc9055d0f37c' style='display:none;margin:0px;'&gt;&lt;iframe id='iframefc077387-2a13-4291-936e-cc9055d0f37c' src='http://www.blogtrog.com/code.aspx?id=fc077387-2a13-4291-936e-cc9055d0f37c' style='width: 500px; height: 200px; border: 1px solid #e0e0e0;margin:0px;' frameborder='0'&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div id='noIframeDivfc077387-2a13-4291-936e-cc9055d0f37c' style='display:block;margin:0px;'&gt;&lt;pre&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #000000;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #800000;"&gt;main&lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000;"&gt; DEBUG com.iqjava.log4j.XMLLog4jExample  - This is a debug message&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #800000;"&gt;main&lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000;"&gt; INFO  com.iqjava.log4j.XMLLog4jExample  - This is an info message&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #800000;"&gt;main&lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000;"&gt; WARN  com.iqjava.log4j.XMLLog4jExample  - This is a warn message&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #800000;"&gt;main&lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000;"&gt; ERROR com.iqjava.log4j.XMLLog4jExample  - This is an error message&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #800000;"&gt;main&lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000;"&gt; FATAL com.iqjava.log4j.XMLLog4jExample  - This is a fatal message&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language='javascript' src='http://www.blogtrog.com/scripts/bt_code.js' type='text/javascript'&gt;&lt;/script&gt;&lt;script language='javascript' type='text/javascript'&gt;bt_code_init('fc077387-2a13-4291-936e-cc9055d0f37c');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Eclipse project structure is depicted as in diagram given below:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_o-aO_ImO6Ec/SsofjSehCQI/AAAAAAAABPI/gqvg9xo-RVM/s1600-h/log4jSnap.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_o-aO_ImO6Ec/SsofjSehCQI/AAAAAAAABPI/gqvg9xo-RVM/s320/log4jSnap.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-7382838239199505196?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/7382838239199505196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/7382838239199505196'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/10/how-do-you-configure-log4j-with-xml.html' title='How do you configure log4j with XML?'/><author><name>Deepun</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><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_o-aO_ImO6Ec/SsofjSehCQI/AAAAAAAABPI/gqvg9xo-RVM/s72-c/log4jSnap.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7300550709382233175.post-7818977099529781494</id><published>2009-10-02T09:35:00.000-07:00</published><updated>2009-10-02T09:35:30.484-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='log4j'/><title type='text'>How to log different modules in different log files?</title><content type='html'>Logging messages from different modules in different log files are commonly expected in a project.One can create as many loggers specific to different modules/packages inside the log4j properties file.&lt;br /&gt;&lt;br /&gt;As for instance, we want to log workflow related log messages into a file named workflow.log while services related logs into a file named services.log.&lt;br /&gt;&lt;br /&gt;The log4j.properties file will describe two seperate FileAppenders and each of them is associated with individual package.The log4j.properties file as shown below depicts two FileAppenders:&lt;br /&gt;&lt;br /&gt;&lt;div id="iframeDivea5537fe-91eb-48ec-8a85-471729c0ca96" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframeea5537fe-91eb-48ec-8a85-471729c0ca96" src="http://www.blogtrog.com/code.aspx?id=ea5537fe-91eb-48ec-8a85-471729c0ca96" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 500px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDivea5537fe-91eb-48ec-8a85-471729c0ca96" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: black;"&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;rootLogger&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;DEBUG&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;#&lt;/span&gt;&lt;span style="color: black;"&gt; WorkflowFileAppender - logs messages in the workflow&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;log file&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;appender&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;WorkflowFileAppender&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;apache&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;FileAppender&lt;br /&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;appender&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;WorkflowFileAppender&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;File&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;workflow&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;log&lt;br /&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;appender&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;WorkflowFileAppender&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;layout&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;apache&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;PatternLayout&lt;br /&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;appender&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;WorkflowFileAppender&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;layout&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;ConversionPattern&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;%-4r [%t] %-5p %c %x - %m%n&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;#&lt;/span&gt;&lt;span style="color: black;"&gt; ServicesFileAppender - logs messages in the services&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;log file&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;appender&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;ServicesFileAppender&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;apache&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;FileAppender&lt;br /&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;appender&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;ServicesFileAppender&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;File&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;services&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;log&lt;br /&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;appender&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;ServicesFileAppender&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;layout&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;apache&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;PatternLayout&lt;br /&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;appender&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;ServicesFileAppender&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;layout&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;ConversionPattern&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;%-4r [%t] %-5p %c %x - %m%n&lt;br /&gt;&lt;br /&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;logger&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;com&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;iqjava&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;workflow&lt;/span&gt;&lt;span style="color: black;"&gt;=,&lt;/span&gt;&lt;span style="color: black;"&gt;WorkflowFileAppender &lt;br /&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;logger&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;com&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;iqjava&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;services&lt;/span&gt;&lt;span style="color: black;"&gt;=,&lt;/span&gt;&lt;span style="color: black;"&gt;ServicesFileAppender &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('ea5537fe-91eb-48ec-8a85-471729c0ca96');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Here the root logger is set as 'DEBUG' which is just for information purpose, and not necessary.We have not set any logger level with individual file appenders. They both have been left blank so that &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;rootLogger&lt;/span&gt; level would be inherited.We can surely change that if we want.&lt;br /&gt;&lt;br /&gt;The code snippet contains two java files:&lt;br /&gt;&lt;br /&gt;1. WorkflowExample.java&lt;br /&gt;&lt;br /&gt;&lt;div id="iframeDiva52e3970-09cb-4a3b-9353-780f10132029" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframea52e3970-09cb-4a3b-9353-780f10132029" src="http://www.blogtrog.com/code.aspx?id=a52e3970-09cb-4a3b-9353-780f10132029" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 500px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDiva52e3970-09cb-4a3b-9353-780f10132029" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: blue;"&gt;package&lt;/span&gt;&lt;span style="color: black;"&gt; com.iqjava.workflow;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.apache.log4j.Logger;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.apache.log4j.PropertyConfigurator;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt; WorkflowExample {&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt;&lt;span style="color: black;"&gt; Logger logger &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; Logger.getLogger(WorkflowExample.&lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;span style="color: black;"&gt; main(String[] args) {&lt;br /&gt;&lt;br /&gt;        PropertyConfigurator.configure(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;log4j.properties&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        logger.debug(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Here goes the debug message&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        logger.error(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Here goes the error message&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        logger.fatal(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Here goes the fatal message&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        logger.info(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Here goes the info message&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        logger.warn(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Here goes the warn message&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('a52e3970-09cb-4a3b-9353-780f10132029');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;2.ServicesExample.java&lt;br /&gt;&lt;br /&gt;&lt;div id="iframeDivb9ae5aae-eae3-461e-aa8c-e50ad5f3923f" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframeb9ae5aae-eae3-461e-aa8c-e50ad5f3923f" src="http://www.blogtrog.com/code.aspx?id=b9ae5aae-eae3-461e-aa8c-e50ad5f3923f" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 500px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDivb9ae5aae-eae3-461e-aa8c-e50ad5f3923f" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: blue;"&gt;package&lt;/span&gt;&lt;span style="color: black;"&gt; com.iqjava.services;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.apache.log4j.Logger;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.apache.log4j.PropertyConfigurator;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt; ServicesExample {&lt;br /&gt;    &lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt;&lt;span style="color: black;"&gt; Logger logger &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; Logger.getLogger(ServicesExample.&lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;span style="color: black;"&gt; main(String[] args) {&lt;br /&gt;&lt;br /&gt;        PropertyConfigurator.configure(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;log4j.properties&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        logger.debug(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Here goes the debug message&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        logger.error(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Here goes the error message&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        logger.fatal(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Here goes the fatal message&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        logger.info(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Here goes the info message&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        logger.warn(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Here goes the warn message&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('b9ae5aae-eae3-461e-aa8c-e50ad5f3923f');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;If the individual java appenders are executed then output of workflow.log and services.log will look like as given below:&lt;br /&gt;&lt;br /&gt;3.workflow.log&lt;br /&gt;&lt;div id="iframeDiv8fe96f2d-a393-47d9-8641-c96279fb2650" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframe8fe96f2d-a393-47d9-8641-c96279fb2650" src="http://www.blogtrog.com/code.aspx?id=8fe96f2d-a393-47d9-8641-c96279fb2650" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 500px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDiv8fe96f2d-a393-47d9-8641-c96279fb2650" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: black;"&gt;0&lt;/span&gt;&lt;span style="color: black;"&gt;    [main] &lt;/span&gt;&lt;span style="color: blue;"&gt;DEBUG&lt;/span&gt;&lt;span style="color: black;"&gt; com&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;iqjava&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;workflow&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;WorkflowExample  - Here goes the &lt;/span&gt;&lt;span style="color: blue;"&gt;debug&lt;/span&gt;&lt;span style="color: black;"&gt; message&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;33&lt;/span&gt;&lt;span style="color: black;"&gt;   [main] ERROR com&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;iqjava&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;workflow&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;WorkflowExample  - Here goes the error message&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;33&lt;/span&gt;&lt;span style="color: black;"&gt;   [main] FATAL com&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;iqjava&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;workflow&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;WorkflowExample  - Here goes the fatal message&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;33&lt;/span&gt;&lt;span style="color: black;"&gt;   [main] INFO  com&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;iqjava&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;workflow&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;WorkflowExample  - Here goes the info message&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;34&lt;/span&gt;&lt;span style="color: black;"&gt;   [main] WARN  com&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;iqjava&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;workflow&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;WorkflowExample  - Here goes the warn message&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('8fe96f2d-a393-47d9-8641-c96279fb2650');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;4.services.log&lt;br /&gt;&lt;div id="iframeDiv7aef6139-5e1a-4ca5-b890-5cd43fc29f74" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframe7aef6139-5e1a-4ca5-b890-5cd43fc29f74" src="http://www.blogtrog.com/code.aspx?id=7aef6139-5e1a-4ca5-b890-5cd43fc29f74" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 500px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDiv7aef6139-5e1a-4ca5-b890-5cd43fc29f74" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: black;"&gt;0&lt;/span&gt;&lt;span style="color: black;"&gt;    [main] &lt;/span&gt;&lt;span style="color: blue;"&gt;DEBUG&lt;/span&gt;&lt;span style="color: black;"&gt; com&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;iqjava&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;services&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;ServicesExample  - Here goes the &lt;/span&gt;&lt;span style="color: blue;"&gt;debug&lt;/span&gt;&lt;span style="color: black;"&gt; message&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1&lt;/span&gt;&lt;span style="color: black;"&gt;    [main] ERROR com&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;iqjava&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;services&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;ServicesExample  - Here goes the error message&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;1&lt;/span&gt;&lt;span style="color: black;"&gt;    [main] FATAL com&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;iqjava&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;services&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;ServicesExample  - Here goes the fatal message&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;2&lt;/span&gt;&lt;span style="color: black;"&gt;    [main] INFO  com&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;iqjava&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;services&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;ServicesExample  - Here goes the info message&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;2&lt;/span&gt;&lt;span style="color: black;"&gt;    [main] WARN  com&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;iqjava&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;services&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;ServicesExample  - Here goes the warn message&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('7aef6139-5e1a-4ca5-b890-5cd43fc29f74');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;If you want to change the logger level for these file appenders, you can always do that in log4j.properties file.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-7818977099529781494?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/7818977099529781494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/7818977099529781494'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/10/how-to-log-different-modules-in.html' title='How to log different modules in different log files?'/><author><name>Deepun</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></entry><entry><id>tag:blogger.com,1999:blog-7300550709382233175.post-4942019629928583523</id><published>2009-09-27T05:37:00.000-07:00</published><updated>2009-09-27T05:43:25.942-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Code Snippet'/><category scheme='http://www.blogger.com/atom/ns#' term='log4j'/><title type='text'>Log4j Configuration With properties file</title><content type='html'>Log4j configuration can be done either using an XML or a properties file externally. This makes your code independent of logging related steps to be followed in your code, so no ongoing source code modifications.&lt;br /&gt;&lt;br /&gt;All you require to achieve that are logger, appender and layout. The logger object is used to do logging, appender decides where you want to append logging messages, to a console or to a file and finally layout decides on format, the way you want logging messages to be logged.&lt;br /&gt;&lt;br /&gt;In the previous &lt;a href="http://www.interviewjava.com/2009/09/what-is-log4j-and-how-can-it-be.html"&gt;post&lt;/a&gt;, where BasicConfigurator.configure() is used, the default appender ConsoleAppender and layout PatternLayout are in use.&lt;br /&gt;&lt;br /&gt;First of all the contents of log4j.properties file looks like:&lt;br /&gt;&lt;br /&gt;&lt;div id="iframeDivbaacf5f7-c7ad-4d18-8078-90e485492e34" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframebaacf5f7-c7ad-4d18-8078-90e485492e34" src="http://www.blogtrog.com/code.aspx?id=baacf5f7-c7ad-4d18-8078-90e485492e34" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 500px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDivbaacf5f7-c7ad-4d18-8078-90e485492e34" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: black;"&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;rootLogger&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;ERROR&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: black;"&gt; CA&lt;br /&gt;&lt;br /&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;appender&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;CA&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;apache&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;ConsoleAppender&lt;br /&gt;&lt;br /&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;appender&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;CA&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;layout&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;org&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;apache&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;PatternLayout&lt;br /&gt;log4j&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;appender&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;CA&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;layout&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;ConversionPattern&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;%-1r [%t] %-5p %c %x - %m%n&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('baacf5f7-c7ad-4d18-8078-90e485492e34');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;And now the ExampleLog4j.java file: &lt;br /&gt;&lt;br /&gt;&lt;div id="iframeDivf99c7984-ab90-4b3e-ac81-407f1a59adb1" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframef99c7984-ab90-4b3e-ac81-407f1a59adb1" src="http://www.blogtrog.com/code.aspx?id=f99c7984-ab90-4b3e-ac81-407f1a59adb1" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 500px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDivf99c7984-ab90-4b3e-ac81-407f1a59adb1" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: blue;"&gt;package&lt;/span&gt;&lt;span style="color: black;"&gt; com.iqjava.log4j;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.apache.log4j.Logger;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.apache.log4j.PropertyConfigurator;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt; ExampleLog4j {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;final&lt;/span&gt;&lt;span style="color: black;"&gt; Logger logger &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; Logger.getLogger(ExampleLog4j.&lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;    &lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;span style="color: black;"&gt; main(String[] args) {&lt;br /&gt;        &lt;br /&gt;        PropertyConfigurator.configure(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;log4j.properties&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        logger.debug(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Here goes the debug message&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        logger.error(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Here goes the error message&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        logger.fatal(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Here goes the fatal message&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        logger.info(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Here goes the info message&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        logger.warn(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Here goes the warn message&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('f99c7984-ab90-4b3e-ac81-407f1a59adb1');&lt;/script&gt; &lt;br /&gt;&lt;br /&gt;To make things simpler for you, here is a snapshot from my &lt;a href="http://www.eclipse.org/galileo/"&gt;Eclipse Galileo&lt;/a&gt; project:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_o-aO_ImO6Ec/Sr9b_EER8fI/AAAAAAAABO4/K-VTXdwJLTU/s1600-h/logejex.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_o-aO_ImO6Ec/Sr9b_EER8fI/AAAAAAAABO4/K-VTXdwJLTU/s320/logejex.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;The log4j levels follow the following order.&lt;br /&gt;DEBUG&lt;br /&gt;INFO&lt;br /&gt;WARN&lt;br /&gt;ERROR&lt;br /&gt;FATAL&lt;br /&gt;&lt;br /&gt;As the code level mentioned in .properties file is ERROR, it displays ERROR and FATAL messages only in result displayed of the code. If the code level would have been DEBUG then, all the messages would have been displayed on the console.&lt;br /&gt;&lt;br /&gt;The result of the code looks like as given below:&lt;br /&gt;&lt;br /&gt;&lt;div id='iframeDiv417ee805-1961-40c8-9658-e99156e83198' style='display:none;margin:0px;'&gt;&lt;iframe id='iframe417ee805-1961-40c8-9658-e99156e83198' src='http://www.blogtrog.com/code.aspx?id=417ee805-1961-40c8-9658-e99156e83198' style='width: 500px; height: 100px; border: 1px solid #e0e0e0;margin:0px;' frameborder='0'&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div id='noIframeDiv417ee805-1961-40c8-9658-e99156e83198' style='display:block;margin:0px;'&gt;&lt;pre&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #000000;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #800000;"&gt;main&lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000;"&gt; ERROR com.iqjava.log4j.ExampleLog4j  - Here goes the error message&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #800000;"&gt;main&lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000;"&gt; FATAL com.iqjava.log4j.ExampleLog4j  - Here goes the fatal message&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language='javascript' src='http://www.blogtrog.com/scripts/bt_code.js' type='text/javascript'&gt;&lt;/script&gt;&lt;script language='javascript' type='text/javascript'&gt;bt_code_init('417ee805-1961-40c8-9658-e99156e83198');&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-4942019629928583523?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/4942019629928583523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/4942019629928583523'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/log4j-configuration-with-properties.html' title='Log4j Configuration With properties file'/><author><name>Deepun</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><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_o-aO_ImO6Ec/Sr9b_EER8fI/AAAAAAAABO4/K-VTXdwJLTU/s72-c/logejex.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-7300550709382233175.post-1538232004799133424</id><published>2009-09-27T02:34:00.000-07:00</published><updated>2009-09-27T02:38:46.176-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='log4j'/><title type='text'>What is Log4j and how can it be configured?</title><content type='html'>Log4j is a Java based open source logging service by &lt;a href="http://logging.apache.org/"&gt;Apache &lt;/a&gt;which is available with no cost to the public.The latest edition at the time of writing this post is log4j 2.0 for logging services designed for Java 5 and later.&lt;br /&gt;&lt;br /&gt;The insertion of logging comments help in better management of debugging of code specially if the application is distributed and enterprise in nature. The proper usage of logger levels namely DEBUG, INFO, WARN, ERROR and FATAL can help developers analyzing proper functioning of the code.&lt;br /&gt;&lt;br /&gt;A simple log4j configuration is explained with a code sample given below, here important is that log4j runtime jar(log4j-1.2.15.jar) is included in the classpath of your application in order to execute the following code:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="iframeDiv11743984-e322-4383-ae1c-a268def1b3b2" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframe11743984-e322-4383-ae1c-a268def1b3b2" src="http://www.blogtrog.com/code.aspx?id=11743984-e322-4383-ae1c-a268def1b3b2" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 500px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDiv11743984-e322-4383-ae1c-a268def1b3b2" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: blue;"&gt;package&lt;/span&gt;&lt;span style="color: black;"&gt; com.iqjava.log4j;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.apache.log4j.BasicConfigurator;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.apache.log4j.Logger;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt; ExampleLog4j {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;final&lt;/span&gt;&lt;span style="color: black;"&gt; Logger logger &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; Logger.getLogger(ExampleLog4j.&lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;    &lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;span style="color: black;"&gt; main(String[] args) {&lt;br /&gt;        BasicConfigurator.configure();&lt;br /&gt;        logger.debug(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Here goes the debug message&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        logger.error(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Here goes the error message&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        logger.fatal(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Here goes the fatal message&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        logger.info(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Here goes the info message&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        logger.warn(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Here goes the warn message&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('11743984-e322-4383-ae1c-a268def1b3b2');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;The output of the above code looks as given below:&lt;br /&gt;&lt;div id='iframeDivb6afce93-466a-4300-b208-b9b912ac2878' style='display:none;margin:0px;'&gt;&lt;iframe id='iframeb6afce93-466a-4300-b208-b9b912ac2878' src='http://www.blogtrog.com/code.aspx?id=b6afce93-466a-4300-b208-b9b912ac2878' style='width: 500px; height: 200px; border: 1px solid #e0e0e0;margin:0px;' frameborder='0'&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div id='noIframeDivb6afce93-466a-4300-b208-b9b912ac2878' style='display:block;margin:0px;'&gt;&lt;pre&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #000000;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #800000;"&gt;main&lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000;"&gt; DEBUG com.iqjava.log4j.ExampleLog4j  - Here goes the debug message&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #800000;"&gt;main&lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000;"&gt; ERROR com.iqjava.log4j.ExampleLog4j  - Here goes the error message&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #800000;"&gt;main&lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000;"&gt; FATAL com.iqjava.log4j.ExampleLog4j  - Here goes the fatal message&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #800000;"&gt;main&lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000;"&gt; INFO com.iqjava.log4j.ExampleLog4j  - Here goes the info message&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #800000;"&gt;main&lt;/span&gt;&lt;span style="color: #800000; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000;"&gt; WARN com.iqjava.log4j.ExampleLog4j  - Here goes the warn message&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language='javascript' src='http://www.blogtrog.com/scripts/bt_code.js' type='text/javascript'&gt;&lt;/script&gt;&lt;script language='javascript' type='text/javascript'&gt;bt_code_init('b6afce93-466a-4300-b208-b9b912ac2878');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;The numbers in the beginning of the output represents time elapsed from the beginning of the execution of the code in milliseconds, thread name, logger level and then log message.&lt;br /&gt;&lt;br /&gt;The other logging configuration using log4j is with properties or XML file.Watch out for the next post, it will be related to that.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-1538232004799133424?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/1538232004799133424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/1538232004799133424'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/what-is-log4j-and-how-can-it-be.html' title='What is Log4j and how can it be configured?'/><author><name>Deepun</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></entry><entry><id>tag:blogger.com,1999:blog-7300550709382233175.post-1022243416634253642</id><published>2009-09-23T07:34:00.000-07:00</published><updated>2009-09-23T09:18:22.178-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Code Snippet'/><category scheme='http://www.blogger.com/atom/ns#' term='Velocity Framework'/><title type='text'>Velocity With XML</title><content type='html'>In this post, a code snippet describing a basic integration of XML with Velocity framework. Please ensure all runtime jar files associated with Velocity and Xerces XML parser are in your build path.&lt;br /&gt;&lt;br /&gt;The following files are part of this code snippet;&lt;br /&gt;&lt;br /&gt;1.XMLVelocityExample.java&lt;br /&gt;2.xml.vm&lt;br /&gt;3.book.xml&lt;br /&gt;&lt;br /&gt;Here goes the Java code i.e. XMLVelocityExample.java:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #333333; font-family: 'Trebuchet MS'; font-size: 13px; white-space: pre-wrap;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div id="iframeDiv6df6d5f5-1fff-4e27-8964-5bdcebb87366" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframe6df6d5f5-1fff-4e27-8964-5bdcebb87366" src="http://www.blogtrog.com/code.aspx?id=6df6d5f5-1fff-4e27-8964-5bdcebb87366" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 500px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDiv6df6d5f5-1fff-4e27-8964-5bdcebb87366" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.apache.velocity.Template;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.apache.velocity.VelocityContext;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.apache.velocity.app.Velocity;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.jdom.Document;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.jdom.input.SAXBuilder;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; java.io.BufferedWriter;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; java.io.OutputStreamWriter;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; java.io.Writer;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt; XMLVelocityExample {&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; XMLVelocityExample(String templateFile) {&lt;br /&gt;        Writer writer &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;null&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;br /&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;span style="color: black;"&gt; {&lt;br /&gt;            Velocity.init();&lt;br /&gt;&lt;br /&gt;            SAXBuilder builder;&lt;br /&gt;            Document root &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;null&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;br /&gt;&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;span style="color: black;"&gt; {&lt;br /&gt;                builder &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; SAXBuilder(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;org.apache.xerces.parsers.SAXParser&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;                root &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; builder.build(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;book.xml&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;            } &lt;/span&gt;&lt;span style="color: blue;"&gt;catch&lt;/span&gt;&lt;span style="color: black;"&gt; (Exception exception) {&lt;br /&gt;                exception.printStackTrace();&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            VelocityContext context &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; VelocityContext();&lt;br /&gt;            context.put(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;root&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;, root);&lt;br /&gt;&lt;br /&gt;            Template template &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; Velocity.getTemplate(templateFile);&lt;br /&gt;&lt;br /&gt;            writer &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; BufferedWriter(&lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; OutputStreamWriter(System.out));&lt;br /&gt;            template.merge(context, writer);&lt;br /&gt;        } &lt;/span&gt;&lt;span style="color: blue;"&gt;catch&lt;/span&gt;&lt;span style="color: black;"&gt; (Exception ex) {&lt;br /&gt;            ex.printStackTrace();&lt;br /&gt;        } &lt;/span&gt;&lt;span style="color: blue;"&gt;finally&lt;/span&gt;&lt;span style="color: black;"&gt; {&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt;&lt;span style="color: black;"&gt; (writer &lt;/span&gt;&lt;span style="color: black;"&gt;!=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;null&lt;/span&gt;&lt;span style="color: black;"&gt;) {&lt;br /&gt;                &lt;/span&gt;&lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;span style="color: black;"&gt; {&lt;br /&gt;                    writer.flush();&lt;br /&gt;                    writer.close();&lt;br /&gt;                } &lt;/span&gt;&lt;span style="color: blue;"&gt;catch&lt;/span&gt;&lt;span style="color: black;"&gt; (Exception ex) {&lt;br /&gt;                    ex.printStackTrace();&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;span style="color: black;"&gt; main(String[] args) {&lt;br /&gt;        XMLVelocityExample test &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; XMLVelocityExample(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;xml.vm&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('6df6d5f5-1fff-4e27-8964-5bdcebb87366');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;xml.vm looks like:&lt;br /&gt;&lt;br /&gt;&lt;div id='iframeDiv4711f914-69df-47d1-85d4-feee1448e9e7' style='display:none;margin:0px;'&gt;&lt;iframe id='iframe4711f914-69df-47d1-85d4-feee1448e9e7' src='http://www.blogtrog.com/code.aspx?id=4711f914-69df-47d1-85d4-feee1448e9e7' style='width: 500px; height: 200px; border: 1px solid #e0e0e0;margin:0px;' frameborder='0'&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div id='noIframeDiv4711f914-69df-47d1-85d4-feee1448e9e7' style='display:block;margin:0px;'&gt;&lt;pre&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #000000;"&gt;#macro ( recursive $xml $indent )     &lt;br /&gt;#if( $xml.getChildren().size() &amp;gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt; )&lt;br /&gt;$indent &amp;lt;$xml.getName()&amp;gt; &lt;br /&gt;#foreach ($child in $xml.getChildren() ) &lt;br /&gt;#recursive( $child &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;$indent  &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt; )&lt;br /&gt;#end&lt;br /&gt;$indent &amp;lt;/$xml.getName()&amp;gt;&lt;br /&gt;#else&lt;br /&gt;$indent &amp;lt;$xml.getName()&amp;gt;&lt;br /&gt;$indent    $xml.getTextTrim()&lt;br /&gt;$indent &amp;lt;/$xml.getName()&amp;gt;&lt;br /&gt;#end&lt;br /&gt;#end&lt;br /&gt;&lt;br /&gt;#set($i &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;)&lt;br /&gt;&lt;br /&gt;Here goes document tree with a recursive Velocity macro :&lt;br /&gt;&lt;br /&gt;#recursive( $root.getRootElement() $i )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now accessing data directly :&lt;br /&gt;&lt;br /&gt;email : $root.getRootElement().getChild(&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;properties&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;).getChild(&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;author&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;).getChild(&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;email&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;).getText()&lt;br /&gt;last name :  $root.getRootElement().getChild(&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;properties&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;).getChild(&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;author&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;).getChild(&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;name&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;).getChild(&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;fullname&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;).getText()&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language='javascript' src='http://www.blogtrog.com/scripts/bt_code.js' type='text/javascript'&gt;&lt;/script&gt;&lt;script language='javascript' type='text/javascript'&gt;bt_code_init('4711f914-69df-47d1-85d4-feee1448e9e7');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;book.xml file looks like:&lt;br /&gt;&lt;br /&gt;&lt;div id='iframeDivce64c821-53f2-4924-9fb4-5a10689ea083' style='display:none;margin:0px;'&gt;&lt;iframe id='iframece64c821-53f2-4924-9fb4-5a10689ea083' src='http://www.blogtrog.com/code.aspx?id=ce64c821-53f2-4924-9fb4-5a10689ea083' style='width: 500px; height: 200px; border: 1px solid #e0e0e0;margin:0px;' frameborder='0'&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div id='noIframeDivce64c821-53f2-4924-9fb4-5a10689ea083' style='display:block;margin:0px;'&gt;&lt;pre&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #FF00FF;"&gt;xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;?&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;document&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;properties&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;author&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;email&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;sunnyg@sunnyg.com&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;email&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;lastname&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        Gavaskar&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;lastname&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;first&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        Sunil&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;first&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;fullname&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Sunil Gavaskar&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;fullname&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;        &lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;author&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;title&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;       Sunny Days&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;title&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;properties&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;body&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    Sunny within a body.&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;body&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;document&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language='javascript' src='http://www.blogtrog.com/scripts/bt_code.js' type='text/javascript'&gt;&lt;/script&gt;&lt;script language='javascript' type='text/javascript'&gt;bt_code_init('ce64c821-53f2-4924-9fb4-5a10689ea083');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;This is how output looks like:&lt;br /&gt;&lt;div id='iframeDivd1611719-930d-4651-8f61-9a448bc9fe0d' style='display:none;margin:0px;'&gt;&lt;iframe id='iframed1611719-930d-4651-8f61-9a448bc9fe0d' src='http://www.blogtrog.com/code.aspx?id=d1611719-930d-4651-8f61-9a448bc9fe0d' style='width: 500px; height: 200px; border: 1px solid #e0e0e0;margin:0px;' frameborder='0'&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div id='noIframeDivd1611719-930d-4651-8f61-9a448bc9fe0d' style='display:block;margin:0px;'&gt;&lt;pre&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #000000;"&gt;Here goes document tree with a recursive Velocity macro :&lt;br /&gt;&lt;br /&gt;  &amp;lt;document&amp;gt; &lt;br /&gt;    &amp;lt;properties&amp;gt; &lt;br /&gt;      &amp;lt;author&amp;gt; &lt;br /&gt;        &amp;lt;email&amp;gt;&lt;br /&gt;           sunnyg@sunnyg.com&lt;br /&gt;        &amp;lt;/email&amp;gt;&lt;br /&gt;        &amp;lt;name&amp;gt; &lt;br /&gt;          &amp;lt;lastname&amp;gt;&lt;br /&gt;             Gavaskar&lt;br /&gt;          &amp;lt;/lastname&amp;gt;&lt;br /&gt;          &amp;lt;first&amp;gt;&lt;br /&gt;             Sunil&lt;br /&gt;          &amp;lt;/first&amp;gt;&lt;br /&gt;          &amp;lt;fullname&amp;gt;&lt;br /&gt;             Sunil Gavaskar&lt;br /&gt;          &amp;lt;/fullname&amp;gt;&lt;br /&gt;        &amp;lt;/name&amp;gt;&lt;br /&gt;      &amp;lt;/author&amp;gt;&lt;br /&gt;      &amp;lt;title&amp;gt;&lt;br /&gt;         Sunny Days&lt;br /&gt;      &amp;lt;/title&amp;gt;&lt;br /&gt;    &amp;lt;/properties&amp;gt;&lt;br /&gt;    &amp;lt;body&amp;gt;&lt;br /&gt;       Sunny within a body.&lt;br /&gt;    &amp;lt;/body&amp;gt;&lt;br /&gt;  &amp;lt;/document&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now accessing data directly :&lt;br /&gt;&lt;br /&gt;email : sunnyg@sunnyg.com&lt;br /&gt;last name :  Sunil Gavaskar&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language='javascript' src='http://www.blogtrog.com/scripts/bt_code.js' type='text/javascript'&gt;&lt;/script&gt;&lt;script language='javascript' type='text/javascript'&gt;bt_code_init('d1611719-930d-4651-8f61-9a448bc9fe0d');&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-1022243416634253642?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/1022243416634253642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=1022243416634253642' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/1022243416634253642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/1022243416634253642'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/velocity-with-xml.html' title='Velocity With XML'/><author><name>Deepun</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-7300550709382233175.post-6961806339990257130</id><published>2009-09-17T06:50:00.000-07:00</published><updated>2009-09-17T23:18:15.955-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Code Snippet'/><category scheme='http://www.blogger.com/atom/ns#' term='Velocity Framework'/><title type='text'>EMailing Through Velocity Framework</title><content type='html'>Velocity Framework helps in creating a pre-formatted template based email response mechanism. The code snippet in this post elaborates how one can use this feature from Velocity framework.&lt;br /&gt;&lt;br /&gt;While running this application, ensure you have all required Velocity framework related library classes/jars in you project build path.&lt;br /&gt;&lt;br /&gt;Here the code is distributed in following java files:&lt;br /&gt;&lt;br /&gt;1.EMailer.java&lt;br /&gt;2.EMailClient.java&lt;br /&gt;3.Customer.java&lt;br /&gt;4.Order.java&lt;br /&gt;&lt;br /&gt;Template file:&lt;br /&gt;5.email.vm&lt;br /&gt;&lt;br /&gt;Here goes:&lt;br /&gt;&lt;br /&gt;1. EMailer.java&lt;br /&gt;&lt;div id="iframeDivd9c2e275-0ec2-4548-8aef-aa449dc3c703" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframed9c2e275-0ec2-4548-8aef-aa449dc3c703" src="http://www.blogtrog.com/code.aspx?id=d9c2e275-0ec2-4548-8aef-aa449dc3c703" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 600px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDivd9c2e275-0ec2-4548-8aef-aa449dc3c703" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; java.io.StringWriter;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; java.util.HashMap;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; java.util.Properties;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.apache.velocity.Template;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.apache.velocity.VelocityContext;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.apache.velocity.app.VelocityEngine;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt; Emailer&lt;br /&gt;{&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: green;"&gt;/**&lt;/span&gt;&lt;span style="color: green;"&gt;&lt;br /&gt;     * Field description&lt;br /&gt;     *&lt;br /&gt;     * &lt;/span&gt;&lt;span style="color: grey;"&gt;@since&lt;/span&gt;&lt;span style="color: green;"&gt; 1.0&lt;br /&gt;     &lt;/span&gt;&lt;span style="color: green;"&gt;*/&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;    VelocityEngine engine &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; VelocityEngine();&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: green;"&gt;/**&lt;/span&gt;&lt;span style="color: green;"&gt;&lt;br /&gt;     * Constructor description.&lt;br /&gt;     *&lt;br /&gt;     * &lt;/span&gt;&lt;span style="color: grey;"&gt;@throws&lt;/span&gt;&lt;span style="color: green;"&gt; Exception Description&lt;br /&gt;     &lt;/span&gt;&lt;span style="color: green;"&gt;*/&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; Emailer() &lt;/span&gt;&lt;span style="color: blue;"&gt;throws&lt;/span&gt;&lt;span style="color: black;"&gt; Exception&lt;br /&gt;    {&lt;br /&gt;        configure(engine);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: green;"&gt;/**&lt;/span&gt;&lt;span style="color: green;"&gt;&lt;br /&gt;     * "Sends" (actually writes to System.out for demonstration  purposes) a&lt;br /&gt;     * receipt e-mail for the specified order.&lt;br /&gt;     *&lt;br /&gt;     * &lt;/span&gt;&lt;span style="color: grey;"&gt;@param&lt;/span&gt;&lt;span style="color: green;"&gt; order Description&lt;br /&gt;     &lt;/span&gt;&lt;span style="color: green;"&gt;*/&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;span style="color: black;"&gt; sendReceipt(Order order) &lt;/span&gt;&lt;span style="color: blue;"&gt;throws&lt;/span&gt;&lt;span style="color: black;"&gt; Exception&lt;br /&gt;    {&lt;br /&gt;        Template template &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; engine.getTemplate(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;email.vm&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        VelocityContext context &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; createContext();&lt;br /&gt;        context.put(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;order&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;, order);&lt;br /&gt;&lt;br /&gt;        StringWriter writer &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; StringWriter();&lt;br /&gt;        template.merge(context, writer);&lt;br /&gt;        writer.close();&lt;br /&gt;        System.out.println(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;To: &lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;+&lt;/span&gt;&lt;span style="color: black;"&gt; order.getCustomer().getEmail());&lt;br /&gt;        System.out.println(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Subject: &lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;+&lt;/span&gt;&lt;span style="color: black;"&gt; context.get(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;subject&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;));&lt;br /&gt;        System.out.println(writer.getBuffer());&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: green;"&gt;/**&lt;/span&gt;&lt;span style="color: green;"&gt;&lt;br /&gt;     * Configures the engine to use classpath to find templates&lt;br /&gt;     *&lt;br /&gt;     * &lt;/span&gt;&lt;span style="color: grey;"&gt;@param&lt;/span&gt;&lt;span style="color: green;"&gt; engine Description&lt;br /&gt;     &lt;/span&gt;&lt;span style="color: green;"&gt;*/&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;span style="color: black;"&gt; configure(VelocityEngine engine) &lt;/span&gt;&lt;span style="color: blue;"&gt;throws&lt;/span&gt;&lt;span style="color: black;"&gt; Exception&lt;br /&gt;    {&lt;br /&gt;        Properties props &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; Properties();&lt;br /&gt;        props.setProperty(VelocityEngine.RESOURCE_LOADER, &lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;classpath&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;        props.setProperty(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;classpath.&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;+&lt;/span&gt;&lt;span style="color: black;"&gt; VelocityEngine.RESOURCE_LOADER &lt;/span&gt;&lt;span style="color: black;"&gt;+&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;                          &lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;.class&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;br /&gt;                          ClasspathResourceLoader.&lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt;.getName());&lt;br /&gt;        engine.init(props);&lt;br /&gt;    }&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: green;"&gt;/**&lt;/span&gt;&lt;span style="color: green;"&gt;&lt;br /&gt;      * Creates a Velocity context and adds a formatter tool&lt;br /&gt;      * and store information.&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: green;"&gt;*/&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;     &lt;/span&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt;&lt;span style="color: black;"&gt; VelocityContext createContext() {&lt;br /&gt;       VelocityContext context &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; VelocityContext();&lt;br /&gt;       context.put(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;formatter&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;, &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; Formatter());&lt;br /&gt;&lt;br /&gt;       HashMap store &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; HashMap();&lt;br /&gt;       store.put(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;name&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;, &lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Amazon.com Bookstore&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;       store.put(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;url&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;, &lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;http://amazon.comm&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;&lt;br /&gt;       context.put(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;store&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;, store);&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; context;&lt;br /&gt;     }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('d9c2e275-0ec2-4548-8aef-aa449dc3c703');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2.EMailClient.java&lt;br /&gt;&lt;br /&gt;&lt;div id="iframeDiv267437a7-75ad-414d-bde4-be61c1f1fc53" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframe267437a7-75ad-414d-bde4-be61c1f1fc53" src="http://www.blogtrog.com/code.aspx?id=267437a7-75ad-414d-bde4-be61c1f1fc53" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 600px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDiv267437a7-75ad-414d-bde4-be61c1f1fc53" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; java.util.ArrayList;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt; EmailClient {&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: green;"&gt;/**&lt;/span&gt;&lt;span style="color: green;"&gt;&lt;br /&gt;     * Example usage of Emailer functionality&lt;br /&gt;     *&lt;br /&gt;     * &lt;/span&gt;&lt;span style="color: grey;"&gt;@param&lt;/span&gt;&lt;span style="color: green;"&gt; args Description&lt;br /&gt;     &lt;/span&gt;&lt;span style="color: green;"&gt;*/&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;span style="color: black;"&gt; main(String[] args) &lt;/span&gt;&lt;span style="color: blue;"&gt;throws&lt;/span&gt;&lt;span style="color: black;"&gt; Exception {&lt;br /&gt;        Emailer emailer &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; Emailer();&lt;br /&gt;&lt;br /&gt;        ArrayList lineItems &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; ArrayList();&lt;br /&gt;        lineItems.add(&lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; Item(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Thinking in Java&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;, &lt;/span&gt;&lt;span style="color: black;"&gt;24.05f&lt;/span&gt;&lt;span style="color: black;"&gt;));&lt;br /&gt;        lineItems.add(&lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; Item(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Core Java Volume I&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;, &lt;/span&gt;&lt;span style="color: black;"&gt;34.30f&lt;/span&gt;&lt;span style="color: black;"&gt;));&lt;br /&gt;&lt;br /&gt;        Customer customer &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; Customer(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;John&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;, &lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Brown&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;, &lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;jb@gmail.com&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;&lt;br /&gt;        emailer.sendReceipt(&lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; Order(customer, lineItems));&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('267437a7-75ad-414d-bde4-be61c1f1fc53');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;3.Customer.java&lt;br /&gt;&lt;br /&gt;&lt;div id="iframeDivf38f7aea-81ce-4a75-a4d9-15240962aaee" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframef38f7aea-81ce-4a75-a4d9-15240962aaee" src="http://www.blogtrog.com/code.aspx?id=f38f7aea-81ce-4a75-a4d9-15240962aaee" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 600px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDivf38f7aea-81ce-4a75-a4d9-15240962aaee" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt; Customer&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt;&lt;span style="color: black;"&gt; String firstName;&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt;&lt;span style="color: black;"&gt; String lastName;&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt;&lt;span style="color: black;"&gt; String email;&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: green;"&gt;/**&lt;/span&gt;&lt;span style="color: green;"&gt;&lt;br /&gt;     * Constructor &lt;br /&gt;     &lt;/span&gt;&lt;span style="color: green;"&gt;*/&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; Customer(String firstName, String lastName, String email)&lt;br /&gt;    {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;&lt;span style="color: black;"&gt;.firstName &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; firstName;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;&lt;span style="color: black;"&gt;.lastName &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; lastName;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;&lt;span style="color: black;"&gt;.email &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; email;&lt;br /&gt;    }&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; String getFirstName()&lt;br /&gt;    {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; firstName;&lt;br /&gt;    }&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; String getLastName()&lt;br /&gt;    {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; lastName;&lt;br /&gt;    }&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; String getEmail()&lt;br /&gt;    {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; email;&lt;br /&gt;    }&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; String getId()&lt;br /&gt;    {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;""&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;+&lt;/span&gt;&lt;span style="color: black;"&gt; firstName.charAt(&lt;/span&gt;&lt;span style="color: black;"&gt;0&lt;/span&gt;&lt;span style="color: black;"&gt;) &lt;/span&gt;&lt;span style="color: black;"&gt;+&lt;/span&gt;&lt;span style="color: black;"&gt; lastName.charAt(&lt;/span&gt;&lt;span style="color: black;"&gt;0&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('f38f7aea-81ce-4a75-a4d9-15240962aaee');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;4. Order.java&lt;br /&gt;&lt;div id="iframeDiv247c71ba-df7b-4280-8878-b9295c31fc40" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframe247c71ba-df7b-4280-8878-b9295c31fc40" src="http://www.blogtrog.com/code.aspx?id=247c71ba-df7b-4280-8878-b9295c31fc40" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 600px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDiv247c71ba-df7b-4280-8878-b9295c31fc40" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; java.util.Date;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; java.util.Iterator;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;import&lt;/span&gt;&lt;span style="color: black;"&gt; java.util.List;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span style="color: black;"&gt; Order&lt;br /&gt;{&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt;&lt;span style="color: black;"&gt; Customer customer;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt;&lt;span style="color: black;"&gt; List lineItems;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt;&lt;span style="color: black;"&gt; String orderNumber;&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; Order(Customer customer, List lineItems)&lt;br /&gt;    {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;&lt;span style="color: black;"&gt;.customer &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; customer;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;&lt;span style="color: black;"&gt;.lineItems &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; lineItems;&lt;br /&gt;&lt;br /&gt;        orderNumber &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; customer.getId() &lt;/span&gt;&lt;span style="color: black;"&gt;+&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;-&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;+&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt; Date().getTime();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; Customer getCustomer()&lt;br /&gt;    {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; customer;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; List getLineItems()&lt;br /&gt;    {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; lineItems;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; String getOrderNumber()&lt;br /&gt;    {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; orderNumber;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;float&lt;/span&gt;&lt;span style="color: black;"&gt; total()&lt;br /&gt;    {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;float&lt;/span&gt;&lt;span style="color: black;"&gt; total &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;0&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;br /&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;&lt;span style="color: black;"&gt; (Iterator iterator &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; lineItems.iterator(); iterator.hasNext();)&lt;br /&gt;        {&lt;br /&gt;            Item item &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; (Item)iterator.next();&lt;br /&gt;            total &lt;/span&gt;&lt;span style="color: black;"&gt;+=&lt;/span&gt;&lt;span style="color: black;"&gt; item.getCost();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; total;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('247c71ba-df7b-4280-8878-b9295c31fc40');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;5. email.vm file&lt;br /&gt;&lt;br /&gt;&lt;div id="iframeDivc41f14fa-9cf8-4141-902c-bf19cd755fef" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframec41f14fa-9cf8-4141-902c-bf19cd755fef" src="http://www.blogtrog.com/code.aspx?id=c41f14fa-9cf8-4141-902c-bf19cd755fef" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 600px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDivc41f14fa-9cf8-4141-902c-bf19cd755fef" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;#&lt;/span&gt;&lt;span style="color: blue;"&gt;set&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;($&lt;/span&gt;&lt;span style="color: black;"&gt;customer &lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;$&lt;/span&gt;&lt;span style="color: black;"&gt;{order&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;customer}&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;#&lt;/span&gt;&lt;span style="color: black;"&gt;macro&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;currency &lt;/span&gt;&lt;span style="color: black;"&gt;$&lt;/span&gt;&lt;span style="color: black;"&gt;amount&lt;/span&gt;&lt;span style="color: black;"&gt;)$&lt;/span&gt;&lt;span style="color: black;"&gt;{formatter&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;currency&lt;/span&gt;&lt;span style="color: black;"&gt;($&lt;/span&gt;&lt;span style="color: black;"&gt;amount&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;span style="color: black;"&gt;#&lt;/span&gt;&lt;span style="color: blue;"&gt;end&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;#&lt;/span&gt;&lt;span style="color: black;"&gt;macro&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;pad &lt;/span&gt;&lt;span style="color: black;"&gt;$&lt;/span&gt;&lt;span style="color: black;"&gt;string&lt;/span&gt;&lt;span style="color: black;"&gt;)$&lt;/span&gt;&lt;span style="color: black;"&gt;{formatter&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;pad&lt;/span&gt;&lt;span style="color: black;"&gt;($&lt;/span&gt;&lt;span style="color: black;"&gt;string&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;30&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;span style="color: black;"&gt;#&lt;/span&gt;&lt;span style="color: blue;"&gt;end&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;#&lt;/span&gt;&lt;span style="color: black;"&gt;macro&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;description &lt;/span&gt;&lt;span style="color: black;"&gt;$&lt;/span&gt;&lt;span style="color: black;"&gt;item&lt;/span&gt;&lt;span style="color: black;"&gt;)#&lt;/span&gt;&lt;span style="color: black;"&gt;pad&lt;/span&gt;&lt;span style="color: black;"&gt;($&lt;/span&gt;&lt;span style="color: black;"&gt;item&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;description&lt;/span&gt;&lt;span style="color: black;"&gt;)#&lt;/span&gt;&lt;span style="color: blue;"&gt;end&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;$&lt;/span&gt;&lt;span style="color: black;"&gt;{customer&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;firstName}&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;br /&gt; Thank you &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;&lt;span style="color: black;"&gt; your purchase&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt; Your order number is &lt;/span&gt;&lt;span style="color: black;"&gt;$&lt;/span&gt;&lt;span style="color: black;"&gt;{order&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;orderNumber}&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;#&lt;/span&gt;&lt;span style="color: black;"&gt;pad&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Description&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt; Cost&lt;br /&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;#&lt;/span&gt;&lt;span style="color: black;"&gt;foreach &lt;/span&gt;&lt;span style="color: black;"&gt;($&lt;/span&gt;&lt;span style="color: black;"&gt;item in &lt;/span&gt;&lt;span style="color: black;"&gt;$&lt;/span&gt;&lt;span style="color: black;"&gt;{order&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;lineItems}&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;#&lt;/span&gt;&lt;span style="color: black;"&gt;description&lt;/span&gt;&lt;span style="color: black;"&gt;($&lt;/span&gt;&lt;span style="color: black;"&gt;item&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;#&lt;/span&gt;&lt;span style="color: black;"&gt;currency&lt;/span&gt;&lt;span style="color: black;"&gt;($&lt;/span&gt;&lt;span style="color: black;"&gt;{item&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;cost}&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;#&lt;/span&gt;&lt;span style="color: blue;"&gt;end&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;#&lt;/span&gt;&lt;span style="color: black;"&gt;pad&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;Total&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;#&lt;/span&gt;&lt;span style="color: black;"&gt;currency&lt;/span&gt;&lt;span style="color: black;"&gt;($&lt;/span&gt;&lt;span style="color: black;"&gt;order&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;total&lt;/span&gt;&lt;span style="color: black;"&gt;())&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; Visit us again at &lt;/span&gt;&lt;span style="color: black;"&gt;$&lt;/span&gt;&lt;span style="color: black;"&gt;{store&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;url}!&lt;br /&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;#&lt;/span&gt;&lt;span style="color: blue;"&gt;set&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: black;"&gt;($&lt;/span&gt;&lt;span style="color: black;"&gt;subject&lt;/span&gt;&lt;span style="color: black;"&gt;=&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;${store.name} receipt&lt;/span&gt;&lt;span style="color: black;"&gt;"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('c41f14fa-9cf8-4141-902c-bf19cd755fef');&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;This is how the result looks like:&lt;br /&gt;&lt;br /&gt;&lt;div id="iframeDiv72bbaae8-ace5-4036-b63c-61b42e4cde58" style="display: none; margin: 0px;"&gt;&lt;iframe frameborder="0" id="iframe72bbaae8-ace5-4036-b63c-61b42e4cde58" src="http://www.blogtrog.com/code.aspx?id=72bbaae8-ace5-4036-b63c-61b42e4cde58" style="border: 1px solid #e0e0e0; height: 200px; margin: 0px; width: 600px;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="noIframeDiv72bbaae8-ace5-4036-b63c-61b42e4cde58" style="display: block; margin: 0px;"&gt;&lt;pre&gt;&lt;div&gt;&lt;span style="color: maroon;"&gt;To: jb@gmail.com&lt;br /&gt;Subject: Amazon.com Bookstore receipt&lt;br /&gt;   &lt;br /&gt; John,&lt;br /&gt;&lt;br /&gt; Thank you for your purchase.&lt;br /&gt; Your order number is JB-1253195547000.&lt;br /&gt;&lt;br /&gt; Description                    Cost&lt;br /&gt;  Thinking in Java               $24.05&lt;br /&gt;  Core Java Volume I             $34.30&lt;br /&gt; &lt;br /&gt; Total                          $58.35&lt;br /&gt;&lt;br /&gt; Visit us again at http://amazon.comm!&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;script language="javascript" src="http://www.blogtrog.com/scripts/bt_code.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script language="javascript" type="text/javascript"&gt;bt_code_init('72bbaae8-ace5-4036-b63c-61b42e4cde58');&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-6961806339990257130?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/6961806339990257130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=6961806339990257130' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/6961806339990257130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/6961806339990257130'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/emailing-through-velocity-framework.html' title='EMailing Through Velocity Framework'/><author><name>Deepun</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-7300550709382233175.post-6469483843855887201</id><published>2009-09-08T03:14:00.000-07:00</published><updated>2009-09-08T03:15:18.547-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>Objects and Java Building Object-Oriented, Multi-Threaded Applications with Java by Bill Venners</title><content type='html'>A book which is in HTML format and slight draw back is that you have to be online to go through the contents of the book or you just store all HTML pages of this book.If that does not bog you much, a fascinating book by Bill Venners who has also written &lt;a href="http://www.amazon.com/Inside-Java-Virtual-Machine-Venners/dp/0071350934" target="_blank"&gt;'Inside Java Virtual Machine'.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;No PDF is available.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.artima.com/objectsandjava/webuscript/index.html"&gt;Read online...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-6469483843855887201?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/6469483843855887201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=6469483843855887201' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/6469483843855887201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/6469483843855887201'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/objects-and-java-building-object.html' title='Objects and Java Building Object-Oriented, Multi-Threaded Applications with Java by Bill Venners'/><author><name>Deepun</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-7300550709382233175.post-5473590006050213183</id><published>2009-09-08T03:13:00.000-07:00</published><updated>2009-09-08T03:14:28.535-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>Sams Teach Yourself Java 2 in 24 Hours</title><content type='html'>Sams Teach Yourself Java in 24 Hours is a step-by-step tutorial that teaches someone with no previous programming experience how to create simple Java programs and applets.&lt;br /&gt;&lt;br /&gt;No PDF is available.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.samspublishing.com/library/library.asp?b=STY_Java2_24hours&amp;amp;rl=1"&gt;Read online...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-5473590006050213183?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/5473590006050213183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=5473590006050213183' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/5473590006050213183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/5473590006050213183'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/sams-teach-yourself-java-2-in-24-hours.html' title='Sams Teach Yourself Java 2 in 24 Hours'/><author><name>Deepun</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-7300550709382233175.post-9109526241026708391</id><published>2009-09-08T03:12:00.002-07:00</published><updated>2009-09-08T03:13:41.664-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>Thinking In Java by Bruce Eckel,Ist,IInd and IIIrd Editions</title><content type='html'>Thinking in Java is a printed version of Bruce Eckel's online materials that provides a useful perspective on mastering Java for those with previous programming experience. The author's take on the essence of Java as a new programming language and the thorough introduction to Java's features make this a worthwhile tutorial.&lt;br /&gt;&lt;br /&gt;Thinking in Java begins in a beautiful way to keep an interest of its readers like a suspense thriller...:-), with the author's reflections on why Java is new and better. The author outlines his thoughts on why Java will make you a better programmer, without all the complexity. The book is better when he presents actual language features.&lt;br /&gt;&lt;br /&gt;PDF is available.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.mindviewinc.com/"&gt;Download...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-9109526241026708391?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/9109526241026708391/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=9109526241026708391' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/9109526241026708391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/9109526241026708391'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/thinking-in-java-by-bruce-eckelistiind.html' title='Thinking In Java by Bruce Eckel,Ist,IInd and IIIrd Editions'/><author><name>Deepun</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-7300550709382233175.post-6624385388314443992</id><published>2009-09-08T03:12:00.001-07:00</published><updated>2009-09-08T03:12:44.588-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>The Java Tutorial IIIrd Edition</title><content type='html'>Whether you're taking a class or learning on the job, The Java Tutorial, Third Edition, is a hands-on guide that lets you quickly become proficient with the Java programming language. Written by members of the Java Software team at Sun Microsystems, the book uses an interactive approach to help you learn the Java platform by example.&lt;br /&gt;Since it's first online release in 1995, the material in The Java Tutorial has been updated continuously to reflect reader feedback and new releases of the Java platform. This third edition has been thoroughly updated to cover v1.3 of the Java Platform, Standard Edition, as well as preceding versions as early as JDK 1.1.&lt;br /&gt;&lt;br /&gt;No PDF is available.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/docs/books/javatutorial/third-edition.html"&gt;Read online...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-6624385388314443992?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/6624385388314443992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=6624385388314443992' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/6624385388314443992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/6624385388314443992'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/java-tutorial-iiird-edition.html' title='The Java Tutorial IIIrd Edition'/><author><name>Deepun</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-7300550709382233175.post-6316002883402657959</id><published>2009-09-08T03:10:00.000-07:00</published><updated>2009-09-08T03:11:59.057-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>The Java Tutorial Continued</title><content type='html'>The Java Tutorial Continued provides accurate, up-to-date coverage of features added to the original core Java platform. Written by the experts, The Java Tutorial Continued employs a hands-on, self-paced, example-driven approach. This book concentrates on JDK 1.2 APIs but also contains the information you need to use the JDK 1.1 versions of the APIs.&lt;br /&gt;&lt;br /&gt;The tutorial books, including this book and The Java Tutorial, are the definitive programmers' guides to the core JDK. This book covers a broad spectrum of JDK features, including:&lt;br /&gt;&lt;br /&gt;-The Java Collections Framework&lt;br /&gt;-Internationalization&lt;br /&gt;-2D Graphics and Sound&lt;br /&gt;-JavaBeans(tm)&lt;br /&gt;-IDL (Interface Definition Language), which adds CORBA capabilities to the Java platform&lt;br /&gt;-Database connectivity through the JDBC(tm)&lt;br /&gt;-RMI (Remote Method Invocation)&lt;br /&gt;-Security&lt;br /&gt;-JNI (Java Native Interface)&lt;br /&gt;-Reflection&lt;br /&gt;-Other topics such as JAR, the Standard Extension Mechanism, and Servlets&lt;br /&gt;&lt;br /&gt;No PDF is available.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/docs/books/javatutorial/continued.html"&gt;Read online...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-6316002883402657959?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/6316002883402657959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=6316002883402657959' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/6316002883402657959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/6316002883402657959'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/java-tutorial-continued.html' title='The Java Tutorial Continued'/><author><name>Deepun</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-7300550709382233175.post-8464603197759124022</id><published>2009-09-08T03:09:00.000-07:00</published><updated>2009-09-08T03:10:44.502-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>Introduction To Programming Using Java</title><content type='html'>A free, on-line textbook on introductory programming, which uses Java as the language of instruction. This book is directed mainly towards beginning programmers, although it might also be useful for experienced programmers who want to learn something about Java. It is certainly not meant to provide complete coverage of the Java language.&lt;br /&gt;&lt;br /&gt;The fifth edition covers Java 5.0. You will find many Java applets on the web pages that make up this book, and many of those applets require Java 5.0 or higher to function. Earlier editions, which covered earlier versions of Java, are still available; see the preface for links.&lt;br /&gt;&lt;br /&gt;PDF version of this book is available.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://math.hws.edu/javanotes/"&gt;Download...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-8464603197759124022?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/8464603197759124022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=8464603197759124022' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/8464603197759124022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/8464603197759124022'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/introduction-to-programming-using-java.html' title='Introduction To Programming Using Java'/><author><name>Deepun</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-7300550709382233175.post-3900063264554050041</id><published>2009-09-08T03:06:00.000-07:00</published><updated>2009-09-08T03:09:12.655-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>A Java GUI Programmer's Primer</title><content type='html'>This book contains an introduction to the systematic development of Graphical User Interfaces (GUIs) using the Java environment. It does not attempt to introduce the Java language and it is assumed that the reader has some familiarity with Object Oriented Development (OOD) and its practical expression in Java.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.scism.sbu.ac.uk/jfl/jibook/"&gt;Read online...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-3900063264554050041?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/3900063264554050041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=3900063264554050041' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/3900063264554050041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/3900063264554050041'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/java-gui-programmers-primer.html' title='A Java GUI Programmer&apos;s Primer'/><author><name>Deepun</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-7300550709382233175.post-2051891342036696901</id><published>2009-09-08T03:05:00.000-07:00</published><updated>2009-09-08T03:06:03.043-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>The Java Swing Tutorial</title><content type='html'>The Java(tm) Tutorial, is a guide to using the new Swing components, which are provided by the Java Foundation Classes (JFC). Developed and co-written by the lead writer on the Swing team, this book covers everything you need to know to write GUIs that use Swing components. The JFC Swing Tutorial uses a task-oriented, example-driven approach to introduce you to fundamental concepts and applications.&lt;br /&gt;Designed to be read either cover-to-cover or as a quick reference, this book explains how to use each Swing component, perform layout, do basic drawing, and convert 1.1 AWT programs to Swing. This book covers Swing 1.1.1, which is available both as an extension to JDK(tm) 1.1 and as a core part of the Java(R) 2 Platform.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/docs/books/javatutorial/jfc.html"&gt;Read Online...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-2051891342036696901?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/2051891342036696901/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=2051891342036696901' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/2051891342036696901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/2051891342036696901'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/java-swing-tutorial.html' title='The Java Swing Tutorial'/><author><name>Deepun</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-7300550709382233175.post-4514335960367274343</id><published>2009-09-08T02:36:00.000-07:00</published><updated>2009-09-08T03:05:08.661-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>Java Look And Feel Design Guidelines</title><content type='html'>&lt;a name="46997"&gt;&lt;/a&gt;Java Look and Feel Design Guidelines, second edition, provides essential information for anyone involved in creating cross-platform GUI (graphical user interface) applications and applets in the JavaTM programming language. In particular, this book offers design guidelines for software that uses the Swing classes together with the Java look and feel.&lt;br /&gt;&lt;a name="46502"&gt;&lt;/a&gt;This revised and expanded edition contains a collection of toolbar graphics, lists of terms localized for European and Asian languages, and an appendix on look and feel switching. New and revised guidelines are provided throughout, and new sections discuss smooth interaction, the use of badges in button graphics, and revised standards for window titles.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/products/jlf/index.html"&gt;Read Online...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-4514335960367274343?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/4514335960367274343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=4514335960367274343' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/4514335960367274343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/4514335960367274343'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/java-look-and-feel-design-guidelines.html' title='Java Look And Feel Design Guidelines'/><author><name>Deepun</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-7300550709382233175.post-9137315501674774065</id><published>2009-09-08T02:35:00.002-07:00</published><updated>2009-09-08T02:36:55.617-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>Inside the Java Virtual Machine by Bill Venners</title><content type='html'>Inside the Java Virtual Machine explains Java's architecture and internals, and several Java APIs closely tied to the virtual machine, to Java programmers. Reading this book will help you gain a deeper understanding of Java technology, and in the process, help you become more effective at Java programming.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.artima.com/insidejvm/blurb.html"&gt;Read online...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-9137315501674774065?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/9137315501674774065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=9137315501674774065' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/9137315501674774065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/9137315501674774065'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/inside-java-virtual-machine-by-bill.html' title='Inside the Java Virtual Machine by Bill Venners'/><author><name>Deepun</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-7300550709382233175.post-2095713203842313727</id><published>2009-09-08T02:35:00.001-07:00</published><updated>2009-09-08T02:35:53.188-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>The Java Virtual Machine Specification</title><content type='html'>In The Java Virtual Machine Specification, Second Edition, Sun's designers of the Java virtual machine provide comprehensive coverage of the Java virtual machine class file format and instruction set. In addition, the book contains directions for compiling the virtual machine with numerous practical examples to clarify how it operates in practice. The book also demonstrates the Java virtual machine's powerful verification techniques.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/docs/books/jvms/index.html"&gt;Read online...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-2095713203842313727?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/2095713203842313727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=2095713203842313727' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/2095713203842313727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/2095713203842313727'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/java-virtual-machine-specification.html' title='The Java Virtual Machine Specification'/><author><name>Deepun</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-7300550709382233175.post-923481321806880744</id><published>2009-09-08T02:34:00.001-07:00</published><updated>2009-09-08T02:34:59.485-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>Object-Oriented Software Composition</title><content type='html'>Object-Oriented Software Composition adopts the viewpoint that object-oriented technology is essentially about composing flexible software applications from software components. Although object-oriented languages, tools and methods have come a long way since the birth of object-oriented programming, the technology is not yet mature. This book presents the results of a series of research projects related to object-oriented software composition that were carried out within the Object Systems Group at the University of Geneva, or by partners in collaborative research projects, during a period of about ten years.&lt;br /&gt;&lt;br /&gt;This book is available in PDF format to download...&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.iam.unibe.ch/~scg/Archive/OOSC/index.html"&gt;Download...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-923481321806880744?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/923481321806880744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=923481321806880744' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/923481321806880744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/923481321806880744'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/object-oriented-software-composition.html' title='Object-Oriented Software Composition'/><author><name>Deepun</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-7300550709382233175.post-7649874909675252437</id><published>2009-09-08T02:31:00.000-07:00</published><updated>2009-09-08T02:34:01.104-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>Processing XML with Java</title><content type='html'>A book by Elliotte Rusty Harold, is a complete tutorial about writing Java programs that read and write XML documents. This is the most comprehensive and up-to-date book about integrating XML with Java (and vice versa) you can buy. It contains over 1000 pages of detailed information on SAX, DOM, JDOM, JAXP, TrAX, XPath, XSLT, SOAP, and lots of other juicy acronyms. This book is written for Java programmers who want to learn how to read and write XML documents from their code.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ibiblio.org/xml/books/xmljava/"&gt;Read Online...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-7649874909675252437?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/7649874909675252437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=7649874909675252437' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/7649874909675252437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/7649874909675252437'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/processing-xml-with-java.html' title='Processing XML with Java'/><author><name>Deepun</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-7300550709382233175.post-6024560740457305016</id><published>2009-09-08T02:29:00.002-07:00</published><updated>2009-09-08T02:30:42.302-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>Enterprise JavaBeans™</title><content type='html'>A book by Richard Monson-Haefel on Enterprise Java Beans from O'Reilly publishers.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.unix.org.ua/orelly/java-ent/ebeans/index.htm"&gt;Read online...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-6024560740457305016?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/6024560740457305016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=6024560740457305016' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/6024560740457305016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/6024560740457305016'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/enterprise-javabeans.html' title='Enterprise JavaBeans™'/><author><name>Deepun</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-7300550709382233175.post-5245964767661600370</id><published>2009-09-08T02:29:00.001-07:00</published><updated>2009-09-08T02:29:39.297-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>EJB Design Patterns</title><content type='html'>EJB Design Patterns goes beyond high-level design pattern descriptions into critical EJB-specific implementation issues, illustrated with source code implementations. The book contains a catalog of twenty advanced EJB patterns and provides strategies for mapping application requirements to patterns-driven design, J2EE development best practices, and a collection of EJB tips and strategies, and other topics such as Build-System best practices using Ant, JUnit testing strategies, using Java Data Objects (JDO) as an alternative to entity beans, and more.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.theserverside.com/books/wiley/EJBDesignPatterns/downloads/ejbdesignpatterns.pdf"&gt;Download...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-5245964767661600370?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/5245964767661600370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=5245964767661600370' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/5245964767661600370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/5245964767661600370'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/ejb-design-patterns.html' title='EJB Design Patterns'/><author><name>Deepun</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-7300550709382233175.post-3234595860743798082</id><published>2009-09-08T02:26:00.000-07:00</published><updated>2009-09-08T02:28:38.898-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>Mastering Enterprise JavaBeans Third Edition</title><content type='html'>Mastering EJB is updated for EJB2.1 and also features new chapters on security and Web services integration. The book is about EJB concepts, methodology and development. This book also contains a number of advanced EJB topics, giving you a practical and real world understanding of the subject. By reading this book, you will acquire a deep understanding of EJB.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.theserverside.com/tt/books/wiley/masteringEJB/downloads/MasteringEJB3rdEd.pdf?app=true"&gt;Download...&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;One of the best selling book Mastering EJB is now in its fourth edition and has been updated for EJB 3.0. This edition features chapters on session beans and message-driven beans, EJB-Java EE integration and advanced persistence concepts. In-depth coverage of the Java Persistence API and using POJO entities with EJB is also included. By reading this book, you will acquire a deep understanding of EJB 3.0.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.theserverside.com/tt/books/wiley/masteringEJB3/downloads/MasteringEJB4thEd.pdf?app=true"&gt;Download...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-3234595860743798082?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/3234595860743798082/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=3234595860743798082' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/3234595860743798082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/3234595860743798082'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/mastering-enterprise-javabeans-third.html' title='Mastering Enterprise JavaBeans Third Edition'/><author><name>Deepun</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-7300550709382233175.post-8320641514476153354</id><published>2009-09-08T02:25:00.000-07:00</published><updated>2009-09-08T02:26:14.197-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>Designing Web Services with the J2EE 1.4 Platform: JAX-RPC, SOAP, and XML Technologies</title><content type='html'>Since Web services is a major extension of the Web computing model, developers need to understand the Web computing model technology itself as well as how to effectively implement a Web service with the J2EE technologies. Java BluePrints provides an effective way to combine both into one easy-to-follow, step-by-step examination of the architecture and implementation of the Java Adventure Builder Reference application.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/blueprints/guidelines/designing_webservices/html/"&gt;Read Online...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-8320641514476153354?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/8320641514476153354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=8320641514476153354' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/8320641514476153354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/8320641514476153354'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/designing-web-services-with-j2ee-14.html' title='Designing Web Services with the J2EE 1.4 Platform: JAX-RPC, SOAP, and XML Technologies'/><author><name>Deepun</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-7300550709382233175.post-320442269843339351</id><published>2009-09-08T02:24:00.000-07:00</published><updated>2009-09-08T02:25:10.629-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>Java Web Services Tutorial</title><content type='html'>Java™ Web Services Tutorial is a guide to developing Web applications with the Java Web Services Developer Pack (Java WSDP). The Java WSDP is an all-in-one download containing key technologies to simplify building of Web services using the Java 2 Platform.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/webservices/docs/1.6/tutorial/doc/JavaWSTutorial.pdf"&gt;Download PDF...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-320442269843339351?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/320442269843339351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=320442269843339351' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/320442269843339351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/320442269843339351'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/java-web-services-tutorial.html' title='Java Web Services Tutorial'/><author><name>Deepun</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-7300550709382233175.post-590132642705770065</id><published>2009-09-08T02:23:00.000-07:00</published><updated>2009-09-08T02:24:02.989-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>Jakarta-Struts Live</title><content type='html'>This book is offered by TheServerSide.com and SourceBeat Publications in collaboration.It talks about Jakarta Struts technology with lucid examples in detail.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.theserverside.com/tt/books/sourcebeat/JakartaStrutsLive/downloads/JakartaStrutsLive.zip"&gt;Download...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-590132642705770065?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/590132642705770065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=590132642705770065' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/590132642705770065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/590132642705770065'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/jakarta-struts-live.html' title='Jakarta-Struts Live'/><author><name>Deepun</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-7300550709382233175.post-8630081524276980405</id><published>2009-09-08T02:00:00.000-07:00</published><updated>2009-09-08T02:01:23.979-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>EBook: Java Testing and Design</title><content type='html'>This book,from Unit Testing to Automated Web Tests, teaches you a fast and efficient method to build production-worthy, scalable, and well performing Web-enabled applications. The techniques, methodology, and tools presented in this book will enable developers, QA technicians, and IT managers to work together to achieve unprecedented productivity in development and test automation.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.theserverside.com/tt/books/prenticeHall/JavaTestingAndDesign/index.tss"&gt;Download...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-8630081524276980405?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/8630081524276980405/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=8630081524276980405' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/8630081524276980405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/8630081524276980405'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/ebook-java-testing-and-design.html' title='EBook: Java Testing and Design'/><author><name>Deepun</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-7300550709382233175.post-8677807141201916677</id><published>2009-09-07T09:35:00.000-07:00</published><updated>2009-12-07T18:19:48.525-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>EBooks On Java, JavaEE Technologies</title><content type='html'>&lt;a href="http://www.interviewjava.com/2009/09/jakarta-struts-live.html"&gt;Jakarta-Struts Live&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/09/java-web-services-tutorial.html"&gt;Java Web Services Tutorial&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/09/designing-web-services-with-j2ee-14.html"&gt;Designing Web Services with the J2EE 1.4 Platform: JAX-RPC, SOAP, and XML Technologies&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/09/mastering-enterprise-javabeans-third.html"&gt;Mastering Enterprise JavaBeans Third Edition&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/09/ejb-design-patterns.html"&gt;EJB Design Patterns&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/09/enterprise-javabeans.html"&gt;Enterprise JavaBeans™&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.mindviewinc.com/"&gt;Thinking In Patterns by Bruce Eckel&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/09/processing-xml-with-java.html"&gt;Processing XML With Java&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/09/object-oriented-software-composition.html"&gt;Object-Oriented Software Composition&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/09/java-virtual-machine-specification.html"&gt;The Java Virtual Machine Specification&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/09/inside-java-virtual-machine-by-bill.html"&gt;Inside the Java Virtual Machine by Bill Venners&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.murach.com/books/jsps/download.htm"&gt;Murach Java Sevlets And JSP&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.unix.org.ua/orelly/java-ent/servlet/index.htm"&gt;Java Servlet Programming by O'Reilly&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://pdf.coreservlets.com/"&gt;Core Servlets and JavaServer Pages by Marty Hall, I Edition&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://pdf.moreservlets.com/"&gt;More Servlets and JavaServer Pages&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.theserverside.com/tt/books/addisonwesley/ServletsJSP/downloads/FalknerJones.zip"&gt;Servlets and JavaServer Pages: The J2EE Technology Web Tier &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/09/java-look-and-feel-design-guidelines.html"&gt;Java Look And Feel Design Guidelines&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/09/java-swing-tutorial.html"&gt;The Java Swing Tutorial&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.unix.org.ua/orelly/java-ent/jfc/index.htm"&gt;Java Foundation Classes in a Nutshell: A Deskop Quick Reference&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/09/java-gui-programmers-primer.html"&gt;A Java GUI Programmer's Primer&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.unix.org.ua/orelly/java/awt/index.htm"&gt;Java AWT Reference&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/09/introduction-to-programming-using-java.html" target="_blank"&gt;Introduction To Programming Using Java&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/09/java-tutorial-continued.html" target="_blank"&gt;Java Tutorial Continued &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/09/java-tutorial-iiird-edition.html" target="_blank"&gt;The Java Tutorial IIIrd Edition&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/09/thinking-in-java-by-bruce-eckelistiind.html" target="_blank"&gt;Thinking In Java by Bruce Eckel,Ist,IInd and IIIrd Editions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/09/sams-teach-yourself-java-2-in-24-hours.html" target="_blank"&gt;Sams Teach Yourself Java 2 in 24 Hours&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/09/objects-and-java-building-object.html" target="_blank"&gt;Objects and Java Building Object-Oriented, Multi-Threaded Applications with Java by Bill Venners&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.unix.org.ua/orelly/java-ent/jnut/index.htm" target="_blank"&gt;Java™ in a Nutshell: A Deskop Quick Reference.&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.unix.org.ua/orelly/java/exp/index.htm" target="_blank"&gt;Exploring Java&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.unix.org.ua/orelly/java/fclass/index.htm" target="_blank"&gt;Java Fundamental Classes Reference&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.interviewjava.com/2009/09/ebook-java-testing-and-design.html"&gt;Java Testing and Design&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-8677807141201916677?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/8677807141201916677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=8677807141201916677' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/8677807141201916677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/8677807141201916677'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/ebooks-on-java-javaee-technologies.html' title='EBooks On Java, JavaEE Technologies'/><author><name>Deepun</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-7300550709382233175.post-6539870220773826894</id><published>2009-09-07T09:31:00.002-07:00</published><updated>2009-09-07T09:33:03.148-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EBooks'/><title type='text'>Miscellaneous EBooks</title><content type='html'>&lt;a href="http://chortle.ccsu.edu/java5/cs151java.html" target="_blank"&gt;Introduction to Computer Science using Java&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/docs/books/jls/index.html" target="_blank"&gt;The Java Language Specification&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www2.blogger.com/" target="_blank"&gt;Advanced Programming for the Java 2 Platform&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.brpreiss.com/books/opus5/index.html" target="_blank"&gt;Data Structures and Algorithms with Object-Oriented Design Patterns in Java&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.catb.org/~esr/faqs/hacker-howto.html" target="_blank"&gt;How To Become A Hacker by Eric Steven Raymond&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.redbooks.ibm.com/redbooks.nsf/Redbooks?SearchView&amp;Query=Java&amp;amp;SearchMax=4999" target="_blank"&gt;Java Resources on IBM Redbook&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.redbooks.ibm.com/redbooks/SG245754.html" target="_blank"&gt;Design and Implement Servlets, JSPs, and EJBs for IBM WebSphere Application Server&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://javaa.com/" target="_blank"&gt;1000 Java Tips!&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.oreilly.com/openbook/" target="_blank"&gt;O'Reilly Open Books&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.securingjava.com/toc.html" target="_blank"&gt;Securing Java&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.greenteapress.com/thinkapjava/" target="_blank"&gt;How to Think Like a Computer Scientist Java Version&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.roxie.org/books/bleeding/tableofcontents.html" target="_blank"&gt;Bleeding at the Keyboard :A Guide to Modern Programming with Java&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.scism.sbu.ac.uk/jfl/jflcontents.html" target="_blank"&gt;Java an Object First Approach&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.unix.org.ua/orelly/java-ent/security/index.htm" target="_blank"&gt;Java™ Security.&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.unix.org.ua/orelly/java-ent/dist/index.htm" target="_blank"&gt;Java™ Distributed Computing&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-6539870220773826894?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/6539870220773826894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=6539870220773826894' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/6539870220773826894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/6539870220773826894'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/09/miscellaneous-ebooks.html' title='Miscellaneous EBooks'/><author><name>Deepun</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-7300550709382233175.post-8350506254634828013</id><published>2009-08-30T00:56:00.000-07:00</published><updated>2009-08-31T07:03:12.053-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Collection APIs'/><category scheme='http://www.blogger.com/atom/ns#' term='Core Java'/><title type='text'>Collection APIs Related Interview Questions</title><content type='html'>You may like to read following posts before going through the list of questions mentioned on Collections APIs in this post:&lt;ol&gt;&lt;li&gt;&lt;a href="http://www.interviewjava.com/2007/05/questions-on-javautil-and-javaio.html"&gt;Questions on java.util.* and java.io.* package&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.interviewjava.com/search/label/Core%20Java%20Questions%20With%20Short%20Answers" style="text-decoration: none;"&gt;Core Java Questions With Short Answers&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;Q. How will you synchronize a collection?&lt;br /&gt;A. The code sample given below elaborates on synchronization of various collection objects:&lt;br /&gt;&lt;pre class="programlisting"&gt;import java.util.ArrayList;&lt;br /&gt;import java.util.Collection;&lt;br /&gt;import java.util.Collections;&lt;br /&gt;import java.util.HashMap;&lt;br /&gt;import java.util.HashSet;&lt;br /&gt;import java.util.List;&lt;br /&gt;import java.util.Map;&lt;br /&gt;import java.util.Set;&lt;br /&gt;import java.util.SortedMap;&lt;br /&gt;import java.util.SortedSet;&lt;br /&gt;import java.util.TreeMap;&lt;br /&gt;import java.util.TreeSet;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class CollectionSynchronization {&lt;br /&gt;public static void main(String[] args) {&lt;br /&gt;Collection collection = Collections.synchronizedCollection(new ArrayList());&lt;br /&gt;List list = Collections.synchronizedList(new ArrayList());&lt;br /&gt;Set set = Collections.synchronizedSet(new HashSet());&lt;br /&gt;Map map = Collections.synchronizedMap(new HashMap());&lt;br /&gt;SortedMap sortedMap = Collections.synchronizedSortedMap(new TreeMap());&lt;br /&gt;SortedSet sortedSet = Collections.synchronizedSortedSet(new TreeSet());&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;Q. Why is it advisable to override hashCode() method as well, when equals() method is overridden?&lt;br /&gt;A. When equals() method is overridden, then each object must have same hashcode for pair of objects which have equals() method overridden.If the .hashCode() method of your custom class doesn't work the same way your .equals() method works, the results of your code will be erroneous.&lt;br /&gt;&lt;br /&gt;Q. If a collection object has duplicate values then how will you convert into a collection having unique values?&lt;br /&gt;A.  Here goes the listing:&lt;br /&gt;&lt;pre class="programlisting"&gt;import java.util.ArrayList;&lt;br /&gt;import java.util.Iterator;&lt;br /&gt;import java.util.Set;&lt;br /&gt;import java.util.TreeSet;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class CollectionExample {&lt;br /&gt;public static void main(String[] args) {&lt;br /&gt; ArrayList&lt;string&gt; list = new ArrayList&lt;string&gt;();&lt;br /&gt; list.add("Apple");&lt;br /&gt; list.add("Apple");&lt;br /&gt; list.add("Apple");&lt;br /&gt; list.add("Mango");&lt;br /&gt; list.add("Guvava");&lt;br /&gt; list.add("Pineapple");&lt;br /&gt; Set&lt;string&gt; set = new TreeSet&lt;string&gt;(list);&lt;br /&gt; Iterator&lt;string&gt; iterator = set.iterator();&lt;br /&gt;   while (iterator.hasNext()) {&lt;br /&gt;  String str= (String)iterator.next();&lt;br /&gt;  System.out.println(""+str);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;&lt;br /&gt;Apple&lt;br /&gt;Guvava&lt;br /&gt;Mango&lt;br /&gt;Pineapple&lt;br /&gt;&lt;/string&gt;&lt;/string&gt;&lt;/string&gt;&lt;/string&gt;&lt;/string&gt;&lt;/pre&gt;Q. How will you address the scenario given below to decide on collection object to work with:&lt;br /&gt;- Multiple keys with multiple values&lt;br /&gt;- Multiple keys with single value&lt;br /&gt;- Single key with multiple values&lt;br /&gt;- Single key with single value&lt;br /&gt;A. In the given scenario, HashMap will be the best choice. As long as the keys are unique, one can enter multiple values in an ArrayList and associate this with a key inside HashMap and retrieve those multiple values from unique key.&lt;br /&gt;&lt;br /&gt;Q.How to get a TreeSet from a TreeMap?&lt;br /&gt;A.The possibility of creating a TreeSet from the keyset of TreeMap.Check the example given as below:&lt;br /&gt;&lt;pre class="programlisting"&gt;import java.util.Iterator;&lt;br /&gt;import java.util.Set;&lt;br /&gt;import java.util.TreeMap;&lt;br /&gt;import java.util.TreeSet;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class CollectionExample {&lt;br /&gt;public static void main(String[] args) {&lt;br /&gt;    TreeMap&lt;string, string=""&gt; treeMap = new TreeMap&lt;string, string=""&gt;();&lt;br /&gt;    treeMap.put("1", "Apple");&lt;br /&gt;    treeMap.put("2", "Mango");&lt;br /&gt;    treeMap.put("3", "Guvava");&lt;br /&gt;    treeMap.put("4", "Banana");&lt;br /&gt;    treeMap.put("5", "Grapes");&lt;br /&gt;&lt;br /&gt;    Set&lt;string&gt; set = new TreeSet&lt;string&gt;(treeMap.keySet());&lt;br /&gt;    Iterator&lt;string&gt; iterator = set.iterator();&lt;br /&gt;&lt;br /&gt;    while (iterator.hasNext()) {&lt;br /&gt;        String str = (String) iterator.next();&lt;br /&gt;        System.out.println("" + str);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;&lt;/string&gt;&lt;/string&gt;&lt;/string&gt;&lt;/string,&gt;&lt;/string,&gt;&lt;/pre&gt;Q.How a TreeSet different from HashSet?&lt;br /&gt;A.One line answer is : TreeSet contains-&gt; Unique and Ordered/Sorted values(as per natural order or based on Comparator implemented logic).It is backed by TreeMap.&lt;br /&gt;&lt;br /&gt;While HashSet contains-&gt; Unique values but not Ordered/Sorted&lt;br /&gt;&lt;br /&gt;The example given below will explain the same:&lt;br /&gt;&lt;pre class="programlisting"&gt;import java.util.HashSet;&lt;br /&gt;import java.util.Iterator;&lt;br /&gt;import java.util.Set;&lt;br /&gt;import java.util.TreeMap;&lt;br /&gt;import java.util.TreeSet;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class CollectionExample {&lt;br /&gt;  public static void main(String[] args) {&lt;br /&gt;      Set&lt;integer&gt; hashSet = new HashSet&lt;integer&gt;();&lt;br /&gt;      Set&lt;integer&gt; treeSet = new TreeSet&lt;integer&gt;();&lt;br /&gt;&lt;br /&gt;      addElements(hashSet);&lt;br /&gt;      addElements(treeSet);&lt;br /&gt;&lt;br /&gt;      System.out.println("HashSet:"+hashSet);&lt;br /&gt;      System.out.println("TreeSet"+treeSet);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  private static void addElements(Set&lt;integer&gt; aTreeSet) {&lt;br /&gt;      aTreeSet.add(Integer.valueOf(6));&lt;br /&gt;      aTreeSet.add(Integer.valueOf(2));&lt;br /&gt;      aTreeSet.add(Integer.valueOf(2));&lt;br /&gt;      aTreeSet.add(Integer.valueOf(4));&lt;br /&gt;      aTreeSet.add(Integer.valueOf(7));&lt;br /&gt;      aTreeSet.add(Integer.valueOf(7));&lt;br /&gt;      aTreeSet.add(Integer.valueOf(1));&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The Output is:&lt;br /&gt;&lt;br /&gt;HashSet:[2, 4, 6, 1, 7]&lt;br /&gt;TreeSet[1, 2, 4, 6, 7]&lt;br /&gt;&lt;/integer&gt;&lt;/integer&gt;&lt;/integer&gt;&lt;/integer&gt;&lt;/integer&gt;&lt;/pre&gt;Q.A practical problem, I want to choose a collection object which allows me to put only unique values inside it and in the same order as it is coming out of a database, here data from the database can contain duplicate values.What collection object will you choose?&lt;br /&gt;A.Choose:&lt;br /&gt;&lt;pre class="programlisting"&gt;&lt;br /&gt;LinkedHashSet&lt;string&gt; uniqueData = new LinkedHashSet&lt;string&gt;(dataFromDB);&lt;br /&gt;&lt;/string&gt;&lt;/string&gt;&lt;/pre&gt;Q. What is the initial capacity of Vector?&lt;br /&gt;A. 10. Try out the code given below:&lt;br /&gt;&lt;pre class="programlisting"&gt;&lt;br /&gt;import java.util.Set;&lt;br /&gt;import java.util.Vector;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class CollectionExample {&lt;br /&gt;   public static void main(String[] args) {&lt;br /&gt;       Vector vector = new Vector();&lt;br /&gt;       int capacity = vector.capacity();&lt;br /&gt;       System.out.println("Capacity:" + capacity);&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The Output is:&lt;br /&gt;&lt;br /&gt;Capacity:10&lt;br /&gt;&lt;/pre&gt;An article on &lt;a href="http://www.javaworld.com/javaworld/jw-11-1998/jw-11-collections.html?page=2"&gt;JavaWorld on Collections' API&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-8350506254634828013?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/8350506254634828013/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=8350506254634828013' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/8350506254634828013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/8350506254634828013'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/08/collection-apis-related-interview.html' title='Collection APIs Related Interview Questions'/><author><name>Deepun</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>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7300550709382233175.post-5706110701123718769</id><published>2009-08-29T09:40:00.000-07:00</published><updated>2009-08-30T00:13:53.733-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Version Control Software Systems'/><title type='text'>Various Popular Configuration Management Tools Used In Enterprise  Level IT projects.</title><content type='html'>&lt;b&gt;SVN(Subversion)&lt;/b&gt;&lt;br /&gt;Subversion is a stable,open source, free to use and extensible version control system.Subversion was originally designed to be a better CVS, so it has most of CVS's features.SVN project was initiated by CollabNet in the year 2000.SVN is easily integrated with existing IDEs like Eclipse,JDeveloper,NetBeans,Visual Studio.SVN more details can be captured on their official website, check this out &lt;a href="http://subversion.tigris.org/"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;IBM Rational Synergy&lt;/b&gt;&lt;br /&gt;As IBM has taken over Telelogic and erstwhile CM Synergy is now IBM Synergy.The &lt;a href="http://www.telelogic.com/products/synergy/"&gt;IBM® Rational® Synergy&lt;/a&gt; environment is a task-based software development and delivery solution that brings together global, distributed development teams on a unified change, configuration and release management platform.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Visual Source Safe&lt;/b&gt; is source control software from Microsoft.It was initially developed by a company called One Tree Software. During that time MS had relatively unstable Source code version tool named Delta and they eventually acquired One Tree Software and went on to modify the 16-bit version of SourceSafe 3.1.The result was version 4.0 of&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=8a1a68d8-db11-417c-91ad-02aab484776b&amp;amp;displaylang=en"&gt;Visual SourceSafe (VSS)&lt;/a&gt;, which was a 32-bit edition of the product and was released sometime around 1995.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;IBM Rational Clearcase &lt;/b&gt;&lt;br /&gt;An SCM tool which helps in controlling and tracking source code changes. &lt;a href="http://www-01.ibm.com/software/awdtools/clearcase/index.html"&gt;Clearcase&lt;/a&gt; can support big projects configuration needs where team size can go upto thousands of developers.It comes in two flavors: UCM and base Clearcase. UCM is an out of box configuration management solution while base Clearcase provides a basic infrastructure upon which UCM is built. It can run over various platforms like Windows, AIX, zOS, Solaris etc.&lt;br /&gt;&lt;br /&gt;There are more versioning tools available which are open source like &lt;a href="http://aegis.sourceforge.net/"&gt;Aegis&lt;/a&gt;,&lt;a href="http://www.nongnu.org/arx/"&gt;ArX&lt;/a&gt;,&lt;a href="http://bazaar-vcs.org/"&gt;Bazaar&lt;/a&gt; etc.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I have listed most of the confoguration management tools that I actively used in this post, which you may like to explore.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-5706110701123718769?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/5706110701123718769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=5706110701123718769' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/5706110701123718769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/5706110701123718769'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/08/various-popular-configuration.html' title='Various Popular Configuration Management Tools Used In Enterprise  Level IT projects.'/><author><name>Deepun</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-7300550709382233175.post-5500003616292951429</id><published>2009-07-04T04:53:00.000-07:00</published><updated>2009-08-31T06:56:00.986-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Core Java'/><title type='text'>Short Questions On Java</title><content type='html'>Q.If I am extracting data from database which is have redundancy and not sorted, which collection object will you choose in order to make this data unique and sorted?&lt;br /&gt;A. TreeSet&lt;br /&gt;&lt;b&gt;An Example&lt;/b&gt;&lt;br /&gt;&lt;pre class="programlisting"&gt;import java.util.*;&lt;br /&gt;&lt;br /&gt;public class TreeSetExample {&lt;br /&gt;&lt;br /&gt;public static void main(final String[] args) {&lt;br /&gt;TreeSet treeset = new TreeSet();&lt;br /&gt;treeset.add("Lincoln");&lt;br /&gt;treeset.add("Clinton");&lt;br /&gt;treeset.add("Obama");&lt;br /&gt;treeset.add("Obama");&lt;br /&gt;treeset.add("Regan");&lt;br /&gt;treeset.add("Washington");&lt;br /&gt;treeset.add("Bush");&lt;br /&gt;System.out.println("TreeSet with Prez:");&lt;br /&gt;Iterator iterator = treeset.iterator();&lt;br /&gt;while (iterator.hasNext()) {&lt;br /&gt;Object object = iterator.next();&lt;br /&gt;System.out.println(object);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The Out put of the program is:&lt;br /&gt;&lt;br /&gt;TreeSet with Prez:&lt;br /&gt;Bush&lt;br /&gt;Clinton&lt;br /&gt;Lincoln&lt;br /&gt;Obama&lt;br /&gt;Regan&lt;br /&gt;Washington&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Q. Is GC a high priority thread?&lt;br /&gt;A. No, it is low priority thread.&lt;br /&gt;&lt;br /&gt;Q.Does Java supports multi-dimensional arrays?&lt;br /&gt;A.No, Java supports nested arrays only.&lt;br /&gt;&lt;br /&gt;Q. What will a following division return?&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;float value= &lt;span class="Apple-style-span"  style="font-family:'trebuchet ms';"&gt;200.00/0.0. &lt;/span&gt;&lt;br /&gt;A. NAN(Not a Number) instead of Exception&lt;br /&gt;&lt;br /&gt;Q. Can local vairables be declared as static ?&lt;br /&gt;A. No, local variables cannot be static. Only member variables be declared as static.&lt;br /&gt;&lt;br /&gt;Q.What are the special cases in which serialization cannot happen?&lt;br /&gt;A. There are following scenarios in which serialization cannot happen:&lt;br /&gt;&lt;br /&gt;a. Variables are transient.&lt;br /&gt;b. Variables are static.&lt;br /&gt;c. Base class variables are serialized if class itself is serializable.&lt;br /&gt;&lt;br /&gt;Q.When a class or interface can be unloaded ?&lt;br /&gt;A. A class or interface can be unloaded if and only if the classloader is unreachable. Though in case of system classes, they may never be unloaded as bootstrap class loader is always reachable.&lt;br /&gt;&lt;br /&gt;Q.What are the different states that an object can be in during its life cycle?&lt;br /&gt;A.An object goes through most of the following states during its life cycle, from creation to the point when all the resources associated with it are released for reuse:&lt;br /&gt;&lt;br /&gt;-Created-In use (strongly reachable)&lt;div&gt;-Invisible&lt;/div&gt;&lt;div&gt;-Unreachable&lt;/div&gt;&lt;div&gt;-Collected&lt;/div&gt;&lt;div&gt;-Finalized&lt;/div&gt;&lt;div&gt;-Deallocated&lt;br /&gt;&lt;br /&gt;Q.Where do we use enums and how are they different from public,static,final constants?&lt;br /&gt;A. If there are constants which are unlikely to change in future then they can be defined using enum. Take four directions EAST,WEST,NORTH,SOUTH for example which will never change and is best suited while defined in enum.&lt;br /&gt;Moreover public static final constants are not typesafe. While enums can be used for switch case scenarios, are serializable.&lt;br /&gt;&lt;pre class="programlisting"&gt;&lt;br /&gt;public enum Direction  {     EAST, WEST, NORTH, SOUTH  }&lt;/pre&gt; The detailed answer can be found &lt;a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/enums.html"&gt;here&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-5500003616292951429?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/5500003616292951429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=5500003616292951429' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/5500003616292951429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/5500003616292951429'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/07/short-questions-on-java.html' title='Short Questions On Java'/><author><name>Deepun</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-7300550709382233175.post-7740381994061277346</id><published>2009-05-26T06:19:00.000-07:00</published><updated>2009-08-16T09:38:54.822-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java 5'/><title type='text'>Interview Questions on Java 5 - Part II</title><content type='html'>&lt;b&gt;&lt;i&gt;- What are Generic types and how it helps developers?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;Generic types are now part of J2SE 5.0. At the first instance one will see them in action is the Collections API. The Collections API provides common functionality like LinkedLists, ArrayLists and HashMaps that can be used by more than one Java type. The next example uses the 1.4.2 libraries and the default javac compile mode.&lt;br /&gt;&lt;pre class="programlisting"&gt;&lt;br /&gt;ArrayList list = new ArrayList();&lt;br /&gt;list.add(0, new Long(10));&lt;br /&gt;int total = ((Integer)list.get(0)).intValue();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The cast to Integer on the last line is an example of the typecasting issues that generic types aim to prevent. The issue is that the 1.4.2 Collection API uses the Object class to store the Collection objects, which means that it cannot pick up type mismatches at compile time. The first notification of a problem is a ClassCastException at runtime.&lt;br /&gt;&lt;br /&gt;The same example with the generified Collections library is written as follows:&lt;br /&gt;&lt;pre class="programlisting"&gt;&lt;br /&gt;ArrayList list =  new ArrayList();&lt;br /&gt;list.add(0, new Integer(42));&lt;br /&gt;int total = list.get(0).intValue();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The user of a generified API has to simply declare the type used at compile type using the &lt;&gt; notation. No casts are needed and in this example trying to add a String object to an Integer typed collection would be caught at compile time.&lt;br /&gt;&lt;br /&gt;Hence Generic types enable an API designer to provide common functionality that can be used with multiple data types and which also can be checked for type safety at compile time.&lt;br /&gt;&lt;b&gt;&lt;i&gt;- What are Annotations and how are they used?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Annotations have no direct impact on the execution of the code.They provide additional data about the program which is not part of the program itself.&lt;br /&gt;&lt;br /&gt;Annotations are used for:&lt;br /&gt;&lt;br /&gt;-Preferred over comments as documentation of a program is made quite flexible.&lt;br /&gt;-Program's declarations of classes, fields, methods, and other program elements.&lt;br /&gt;-Can be used by the compiler to detect errors or suppress warnings.&lt;br /&gt;-Compiler-time and deployment-time processing where annotation information can be processed to generate code, XML files, and so forth.&lt;br /&gt;—Some annotations are available to be examined at runtime.&lt;br /&gt;&lt;br /&gt;The annotation appears first, often (by convention) on its own line, and may include elements with named or unnamed values:&lt;br /&gt;&lt;pre class="programlisting"&gt;&lt;br /&gt;@Author(&lt;br /&gt;  name = "Victor Hugo",&lt;br /&gt;  date = "9/20/2009"&lt;br /&gt;)&lt;br /&gt;class SampleClass() { }&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;@SuppressWarnings(value = "unchecked")&lt;br /&gt;void sampleMethod() { }&lt;br /&gt;If there is just one element named "value," then the name may be omitted, as in:&lt;br /&gt;@SuppressWarnings("unchecked")&lt;br /&gt;void sampleMethod() { }&lt;br /&gt;Also, if an annotation has no elements, the parentheses may be omitted, as in:&lt;br /&gt;@Override&lt;br /&gt;void mySuperMethod() { }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;- What is Enhanced for-loop  feature?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;It is a popular feature introduced with in Java SE 5.0. &lt;br /&gt;There is always a backward compatibility with old style of for looping. The changed was of for-loop in Java 5 look something like the following:&lt;br /&gt;&lt;br /&gt;&lt;pre class="programlisting"&gt;&lt;br /&gt;The newer form:&lt;br /&gt;for (String name : nameArray) {&lt;br /&gt;    System.out.println("Name: " + name);&lt;br /&gt;}&lt;br /&gt; &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;- What is static import feature in Java 5?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;- Enables imported static members to be referred as if class declares them within to be used. So no more need of qualifying static class name to access the methods defined in the class. Here is an example as given below:&lt;br /&gt;&lt;br /&gt;&lt;pre class="programlisting"&gt;&lt;br /&gt;import static java.lang.Math.*;&lt;br /&gt;&lt;br /&gt;public class SampleStaticImport &lt;br /&gt;{&lt;br /&gt;   public static void main( String args[] ) &lt;br /&gt;   {&lt;br /&gt;      System.out.println(sqrt(625.0 ) );&lt;br /&gt;      System.out.println(sin( 90.0 ) );&lt;br /&gt;   }  &lt;br /&gt;} &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;- What are Varargs?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The varargs functionality allows multiple arguments to be passed as parameters to methods. It requires the simple ... notation for the method that accepts the argument list and is used to implement the flexible number of arguments required for printf.They are most fondly used in core APIs including reflection, message formatting, and the new printf facility in Java 5. &lt;a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/varargs.html"&gt;Read an article here on varargs for more details&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-7740381994061277346?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/7740381994061277346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=7740381994061277346' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/7740381994061277346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/7740381994061277346'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/05/interview-questions-on-java-5-part-ii.html' title='Interview Questions on Java 5 - Part II'/><author><name>Deepun</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-7300550709382233175.post-8249164407948167995</id><published>2009-04-14T02:28:00.000-07:00</published><updated>2009-09-26T01:46:39.431-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java 5'/><title type='text'>Interview Questions on Java 5</title><content type='html'>&lt;b&gt;&lt;i&gt;- What are the new features in Java 5 as compared to its earlier versions?&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Java 2 Platform Standard Edition 5.0 was a major feature release. The following features were introduced in 5.0 since previous major release and that was 1.4.0.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;i&gt;&lt;b&gt;Summary:&lt;/b&gt;&lt;/i&gt;&lt;/u&gt;&lt;i&gt;&lt;/i&gt;&lt;br /&gt;- Performance Enhancements&lt;br /&gt;a.Garbage collection performance enhancements&lt;br /&gt;b.Introduction to StringBuilder&lt;br /&gt;c.Java 2D technology&lt;br /&gt;d.Image I/O - Performance and memory&lt;br /&gt;&lt;br /&gt;- Language Specific Features:&lt;br /&gt;a.Generics&lt;br /&gt;b.Enhanced for Loop&lt;br /&gt;c.Autoboxing/Unboxing&lt;br /&gt;d.Typesafe Enums&lt;br /&gt;e.Varargs&lt;br /&gt;f.Static Import&lt;br /&gt;g.Metadata (Annotations)&lt;br /&gt;&lt;br /&gt;The list is long which you can catch in detail at following URL:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html"&gt;Java 5 New Features&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;- What is Autoboxing/Unboxing and what are its advantages?&lt;/i&gt;&lt;/b&gt;&lt;i&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;The conversion from primitive types to wrapper types objects is automated. This facility eleminates pain of manual conversion from primitive to wrapper types.&lt;br /&gt;Boxing converts primitive values to objects of corresponding wrapper types.&lt;br /&gt;Unboxing converts objects of wrapper types to values of corresponding primitive types.&lt;br /&gt;&lt;br /&gt;Assignment Conversions on boolean and numeric types.&lt;br /&gt;boolean boolValue = true;&lt;br /&gt;byte b = 2;&lt;br /&gt;short s = 2;&lt;br /&gt;char c ='2';&lt;br /&gt;int i = 2;&lt;br /&gt;&lt;br /&gt;// Boxing&lt;br /&gt;Boolean boolReference = boolValue;&lt;br /&gt;Byte bReference = (byte) 4; &lt;br /&gt;Short sReference = (short) 4; &lt;br /&gt;// both byte and short type casting is to be done as int cannot be assigned to Byte and Short respectively&lt;br /&gt;Character cReference = '4';&lt;br /&gt;Integer iReference = 4;&lt;br /&gt;&lt;br /&gt;// Unboxing&lt;br /&gt;boolean boolValue1 = boolReference;&lt;br /&gt;byte b1 = bReference;&lt;br /&gt;short s1 = sReference;&lt;br /&gt;char c1 = cReference;&lt;br /&gt;int i1 = iReference;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The usage of autoboxing/unboxing can be found:&lt;br /&gt;- In the if statement, condition can be Boolean.&lt;br /&gt;- In the switch statement, the switch expression can be Character, Byte, Short or Integer.&lt;br /&gt;- In the while, do-while and for statements, the condition can be Boolean.&lt;br /&gt;&lt;br /&gt;More questions in my next post on Java 5.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-8249164407948167995?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/8249164407948167995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=8249164407948167995' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/8249164407948167995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/8249164407948167995'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/04/interview-questions-on-java-5.html' title='Interview Questions on Java 5'/><author><name>Deepun</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-7300550709382233175.post-2788575413063546269</id><published>2009-03-21T06:48:00.001-07:00</published><updated>2009-07-12T03:21:20.656-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='J2EE Connector Architecture'/><title type='text'>What are different System Contracts in JCA?</title><content type='html'>&lt;b&gt;System Contracts&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;An application server and an EIS collaborate to keep all system-level mechanisms, such as transactions, security, and connection management, transparent from the application components.&lt;br /&gt;&lt;br /&gt;The JCA Version 1.0 defines the following set of system-level contracts between an application server and EIS, which enables &lt;i&gt;outbound connectivity to an EIS&lt;/i&gt;:&lt;div&gt;&lt;br /&gt;A &lt;b&gt;Connection Management contract&lt;/b&gt; that lets an application server pool connections to an underlying EIS, and lets application components connect to an EIS. This leads to a scalable application environment that can support a large number of clients requiring access to EISs&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A &lt;b&gt;Transaction Management contract&lt;/b&gt; between the transaction manager and  transactional access to EIS resource managers. It lets an application server use a transaction manager to manage transactions across multiple resource managers.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A &lt;b&gt;Security contract&lt;/b&gt; that enables a secure access to an EIS. This contract provides support for a secure application environment, which reduces security threats to the EIS and protects valuable information resources managed by the EIS.&lt;div&gt;&lt;br /&gt;JCA Version 1.5 defines the following set of system-level contracts between an application server and EIS, which enables &lt;i&gt;inbound connectivity from an EIS&lt;/i&gt;:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;A&lt;b&gt; Transaction Inflow contract &lt;/b&gt;that allows a resource adapter to propagate an imported transaction to an application server. This contract also allows a resource adapter to flowin transaction completion and crash recovery calls initiated by an EIS, and ensures that the ACID properties of the imported transaction are preserved.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A &lt;b&gt;Message Inflow contract&lt;/b&gt; that allows a resource adapter to asynchronously deliver messages to message endpoints residing in the application server independent of the specific messaging style, messaging semantics and messaging infrastructure used to deliver messages. It provides pluggability for message providers (Java Message Service (JMS), Java API for XML Messaging (JAXM), and so on) to any J2EE technology-compatible application server via a resource adapter.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;JCA Version 1.5 also defines the following set of system-level contracts between an application server and EIS, which enables&lt;i&gt; resource adapter lifecycle management and thread management:&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A &lt;b&gt;Lifecycle Management contract &lt;/b&gt;that allows an application server to manage the lifecycle of a resource adapter. This contract provides a mechanism for the application server to bootstrap a resource adapter instance during its deployment or application server startup, and to notify the resource adapter instance during its undeployment or during an orderly shutdown of the application server.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A &lt;b&gt;Work Management contract&lt;/b&gt; that allows a resource adapter to do work (monitor network endpoints, call application components, etc.) by submitting Work instances to an application server for execution. &lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-2788575413063546269?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/2788575413063546269/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=2788575413063546269' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/2788575413063546269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/2788575413063546269'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/03/what-are-different-system-contracts-in.html' title='What are different System Contracts in JCA?'/><author><name>Deepun</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-7300550709382233175.post-2862072390218780015</id><published>2009-03-21T05:33:00.000-07:00</published><updated>2009-03-21T06:37:44.181-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='J2EE Connector Architecture'/><title type='text'>What is J2EE Connector Architectcure?</title><content type='html'>J2EE Connector Architecture(JCA) is a standard architecture that targets integration of new web based application with existing heterogeneous Enterprise Information Systems(EIS), enhancing Business to Business(B2B) transactions.While various application servers extend their containers and support connectivity to heterogeneous EISs and enterprise tools and Enterprise Application Integration (EAI) vendors provide tools and frameworks to simplify the EIS integration task.&lt;br /&gt;&lt;div&gt;Under JCA hood:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;- JCA enables application components deployed on the application server to access the underlying EIS systems.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;- JCA provides an EIS vendor specific standard resource adapter for its EIS. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;- The resource adapter plugs into an application server, providing connectivity between the EIS, the application server, and the enterprise application.(Look at the diagram given below)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;- An application server vendor has to extend its system to support the JCA which assures of seamless connectivity to multiple EISs. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;- One can have multiple resource adapters. They all are are pluggable into an application server and each  unique resource adapter corresponds to a particular type of EIS. An EIS vendor has to provide just one standard resource adapter which has the capability to plug in to any application server that supports the JCA.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_o-aO_ImO6Ec/ScTnJW9NZvI/AAAAAAAABGY/U95SN6hYYXw/s1600-h/JCA.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 352px;" src="http://1.bp.blogspot.com/_o-aO_ImO6Ec/ScTnJW9NZvI/AAAAAAAABGY/U95SN6hYYXw/s400/JCA.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5315627608171177714" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-2862072390218780015?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/2862072390218780015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=2862072390218780015' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/2862072390218780015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/2862072390218780015'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2009/03/what-is-j2ee-connector-architectcure.html' title='What is J2EE Connector Architectcure?'/><author><name>Deepun</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><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_o-aO_ImO6Ec/ScTnJW9NZvI/AAAAAAAABGY/U95SN6hYYXw/s72-c/JCA.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7300550709382233175.post-8664671983327648415</id><published>2008-10-11T01:10:00.000-07:00</published><updated>2008-10-11T01:18:15.191-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JMS'/><title type='text'>More JMS Questions</title><content type='html'>Question:What are different types of messaging?&lt;br /&gt;&lt;br /&gt;Answer: There are two kinds of Messaging:&lt;br /&gt;Synchronous Messaging: In Synchronous messaging, there is a client that waits for the server to respond to a message.&lt;br /&gt;Asynchronous Messaging: In Asynchronous messaging, there is a client that does not wait for a message from the server rather an event is used to trigger a message from a server.&lt;br /&gt;&lt;br /&gt;Question:What are the core JMS-related objects required for each JMS-enabled application?&lt;br /&gt;&lt;br /&gt;Answer:Every JMS-enabled client has to establish the following:&lt;br /&gt;• A connection object provided by the JMS server (the message broker)&lt;br /&gt;• Within a connection, one or more sessions, which provide a context for message sending and receiving&lt;br /&gt;• Within a session, either a queue or topic object representing the destination (the message staging area) within the message broker&lt;br /&gt;• Within a session, the appropriate sender or publisher or receiver or subscriber object (depending on whether the client is a message producer or consumer and uses a point-to-point or publish/subscribe strategy, respectively)&lt;br /&gt;• Within a session, a message object (to send or to receive)&lt;br /&gt;&lt;br /&gt;Question:Can two different JMS services talk to each other? For instance, if A and B are two different JMS providers, can Provider A send messages directly to Provider B? If not, then can a subscriber to Provider A act as a publisher to Provider B?&lt;br /&gt;&lt;br /&gt;Answer: As per JMS specification,one JMS provider cannot send messages directly to another provider. However, the specification does require that a JMS client must be able to accept a message created by a different JMS provider, so a message received by a subscriber to Provider A can then be published to Provider B. One caveat is that the publisher to Provider B is not required to handle a JMSReplyTo header that refers to a destination that is specific to Provider A.&lt;br /&gt; &lt;br /&gt;Question:Why doesn't the JMS API provide end-to-end synchronous message delivery and notification of delivery?&lt;br /&gt;&lt;br /&gt;Answer: Some messaging systems provide synchronous delivery to destinations as a mechanism for implementing reliable applications. Some systems provide clients with various forms of delivery notification so that the clients can detect dropped or ignored messages. This is not the model defined by the JMS API.&lt;br /&gt;&lt;br /&gt;JMS API messaging provides guaranteed delivery via the once-and-only-once delivery semantics of PERSISTENT messages. In addition, message consumers can ensure reliable processing of messages by using either CLIENT_ACKNOWLEDGE mode or transacted sessions. This achieves reliable delivery with minimum synchronization and is the enterprise messaging model most vendors and developers prefer.&lt;br /&gt;&lt;br /&gt;The JMS API does not define a schema of systems messages (such as delivery notifications). If an application requires acknowledgment of message receipt, it can define an application-level acknowledgment message.&lt;br /&gt;&lt;br /&gt;Question:How is a java object message delivered to a non-java Client?&lt;br /&gt;&lt;br /&gt;Answer: A non-java client cannot receive a message in the form of java object. As per specifications, the message sent should be received in the same format. It is the responsibility of the provider to handle the conversion of the data type and the message is transferred to the other end in its understandable format.&lt;br /&gt;&lt;br /&gt;Question:What is MDB and what makes it special?&lt;br /&gt;&lt;br /&gt;Answer: A Message Driven Bean(MDB) resembles a Stateless session bean where incoming and out going messages are handled and this ability to communicate asynchronously is the special feature about the Message driven bean.&lt;br /&gt;&lt;br /&gt;Question:Give an example of using the publish/subscribe model.&lt;br /&gt;&lt;br /&gt;Answer: JMS can be used to broadcast shutdown messages to clients connected to the Weblogic server on a module wise basis. If an application has six modules, each module behaves like a subscriber to a named topic on the server.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-8664671983327648415?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/8664671983327648415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=8664671983327648415' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/8664671983327648415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/8664671983327648415'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2008/10/more-jms-questions.html' title='More JMS Questions'/><author><name>Deepun</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-7300550709382233175.post-775911269653263737</id><published>2008-10-04T04:24:00.000-07:00</published><updated>2008-10-04T05:05:18.451-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Forum'/><title type='text'>Launch of Java,Java EE and Open Source Technology Discussion Forum</title><content type='html'>A new &lt;a href="http://interviewjava.motionsforum.com/your-first-forum-f1/" target="_new"&gt;forum&lt;/a&gt; has been created by me today where you all can give me a feedback on this blog and more.The name of this forum is "Java,Java EE and Open Source". Moreover once you all will register here,  this will open a new vista to share our thoughts,knowledge and ideas on Java,Java EE and Open source technologies and frameworks. I have created few topics, to start with, e.g. Open Source Technologies and Frameworks,Java EE Topics,Java Programming . You may create a topic as per your choice where you want to create some buzz and interact with like minded.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://interviewjava.motionsforum.com/your-first-forum-f1/" target="_new"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_o-aO_ImO6Ec/SOdZ-Hq1ZRI/AAAAAAAAAxM/ulDQtjlCLZs/s400/javaforum.jpg" alt="" id="BLOGGER_PHOTO_ID_5253266414096442642" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Let us create an active community using this forum to discuss general topics related to the Java programming language.&lt;br /&gt;&lt;br /&gt;Don't forget to provide me inputs where should I focus in order to improve my blog to serve better to my readers.&lt;br /&gt;&lt;br /&gt;I invite you to register on  this &lt;a href="http://www.blogger.com/=%22http://interviewjava.motionsforum.com/your-first-forum-f1/%22" target="_new"&gt;forum&lt;/a&gt; today.Please feel free to get in touch with me if in case you have any queries.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-775911269653263737?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/775911269653263737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=775911269653263737' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/775911269653263737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/775911269653263737'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2008/10/launch-of-javajava-ee-and-open-source.html' title='Launch of Java,Java EE and Open Source Technology Discussion Forum'/><author><name>Deepun</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><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_o-aO_ImO6Ec/SOdZ-Hq1ZRI/AAAAAAAAAxM/ulDQtjlCLZs/s72-c/javaforum.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7300550709382233175.post-1465127031139798773</id><published>2008-10-03T09:55:00.000-07:00</published><updated>2009-09-11T23:59:56.786-07:00</updated><title type='text'>The Power Of Java</title><content type='html'>Recently stumbled upon this ad campaign of Java technology from Sun on Metacafe. I found it simply impressive.Enjoy!!&lt;br /&gt;&lt;br /&gt;&lt;embed src="http://www.metacafe.com/fplayer/755236/java_introduction.swf" width="500" height="445" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-1465127031139798773?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/1465127031139798773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=1465127031139798773' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/1465127031139798773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/1465127031139798773'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2008/10/power-of-java.html' title='The Power Of Java'/><author><name>Deepun</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-7300550709382233175.post-360074487599846489</id><published>2008-09-28T07:43:00.001-07:00</published><updated>2008-09-28T07:43:02.973-07:00</updated><title type='text'>What are various myths surrounding Services Oriented Architecture?</title><content type='html'>Some myths that are surrounding Services Oriented Architecture are:&lt;p&gt;- Any software system which is using webservices is aligned to SOA.&lt;br&gt;- SOA is a downloadable software to solve any complex business problem.&lt;br&gt;- SOA is easy to implement.&lt;br&gt;- SOA will solve all your complex business problems forever and can be&lt;br&gt;seen as a panacea.&lt;br&gt;- SOA is nothing but integrating existing enterprise level&lt;br&gt;applications to paint a big business picture.&lt;br&gt;- SOA is expensive and time consuming.&lt;br&gt;- All constituent components of SOA are reusable.&lt;br&gt;- SOA is Enterprise Application Integration(EAI).&lt;br&gt;- SOA is not aligned to any standards.&lt;br&gt;- SOA roll out cannot happen without new infrastructure support.&lt;br&gt;- SOA based solution is not performance conscious.&lt;p&gt;In next few posts I will try to dig each of the above listed myths&lt;br&gt;centering SOA in detail.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-360074487599846489?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/360074487599846489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=360074487599846489' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/360074487599846489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/360074487599846489'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2008/09/what-are-various-myths-surrounding.html' title='What are various myths surrounding Services Oriented Architecture?'/><author><name>Deepun</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-7300550709382233175.post-3342325518358751109</id><published>2008-09-09T06:32:00.001-07:00</published><updated>2008-09-09T07:01:16.849-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Test Driven Development'/><title type='text'>What is Test Driven Development?</title><content type='html'>Test-Driven Development (TDD) is a software development technique :&lt;br /&gt;&lt;br /&gt;- where all test cases covering all functionalities and/or enhancements of a system are written first iteratively.&lt;br /&gt;- the production code must pass all tests implemented.&lt;br /&gt;- software is refactored to accommodate changes.&lt;br /&gt;&lt;br /&gt;TDD makes availability of tests before actual development. This approach ensures quality of deliverable resulting in least rework in code. If any change request or enhancement comes then already existing test case coverage ensures sanctity of all existing functionalities of software. TDD is emphasized as a method of designing software, not merely a method of testing.TDD is also linked with test-first programming concepts like Extreme Programming.TDD helps great deal to improve software quality from legacy code that was not developed in this way.&lt;br /&gt;&lt;br /&gt;TDD requires an automated unit test, defining requirements of the code, all positive and negative scenarios which your code has to undergo are written before the code itself. These tests contain assertions that are either true or false. When these tests are run then it gives rapid confirmation of correct behavior as the code evolves and is refactored. In Java world unit testing mechanism is introduced using &lt;a href="http://www.junit.org/"&gt;JUnits &lt;/a&gt;and mocking the expected result or behaviour using &lt;a href="http://www.jmock.org/"&gt;JMock &lt;/a&gt; framework.&lt;a href="http://www.jmock.org/"&gt;JMock &lt;/a&gt;is a library that supports TDD of Java code with mock objects.These mock objects help you design and test the interactions between actual objects in your programs.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-3342325518358751109?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/3342325518358751109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=3342325518358751109' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/3342325518358751109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/3342325518358751109'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2008/09/what-is-test-driven-development.html' title='What is Test Driven Development?'/><author><name>Deepun</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-7300550709382233175.post-5619854080037344453</id><published>2008-09-06T12:27:00.000-07:00</published><updated>2008-09-06T12:31:53.363-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Webhosting'/><title type='text'>What is webhosting and how it works?</title><content type='html'>&lt;a href="http://www.webhostingpal.com/"&gt;Web hosting&lt;/a&gt; service is a type of Internet hosting service.It allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. These web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation.&lt;br /&gt;&lt;br /&gt;A simple website may be representing a personal web space which may be consisted of few normal HTML pages, while more complex commercial organizations would need more then just showing web pages to its end users.It demands more comprehensive application development platforms like Java,PHP,Ruby on Rails,Cold Fusion and ASP.NET and many more web bases technologies and database support.&lt;a href="http://www.webhostingpal.com/"&gt;Web hosting&lt;/a&gt; will also provide interface to its end users to control and monitor a website's or portal's various factors like visitors details, most visited pages, webpages meeting revenue targets etc.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-5619854080037344453?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/5619854080037344453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=5619854080037344453' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/5619854080037344453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/5619854080037344453'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2008/09/what-is-webhosting-and-how-it-works.html' title='What is webhosting and how it works?'/><author><name>Deepun</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-7300550709382233175.post-808456677846523781</id><published>2008-08-08T08:52:00.000-07:00</published><updated>2008-08-08T10:13:21.860-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAXP'/><title type='text'>What is JAXP ?</title><content type='html'>JAXP represents set of APIs which are used to parse, transform,       validate and query XML documents.JAXP is used seamlessly in XML based applications' integration ,web publishing and e-commerce solutions. JAXP supports a number of different industry-wide standards to process XML documents.&lt;br /&gt;&lt;br /&gt;JAXP 1.3 is Production Quality in J2SE 5.0, and the latest JAXP 1.4 is Production Quality Development in Java SE 6. You can find more details of JAXP &lt;a href="https://jaxp.dev.java.net/"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;JAXP supports following standards:&lt;br /&gt;&lt;br /&gt;-JAXP 1.4 specification&lt;br /&gt;-SAX 2.0.2&lt;br /&gt;-StAX 1.0, JSR 173&lt;br /&gt;-XML 1.0, XML 1.1&lt;br /&gt;-XInclude 1.0&lt;br /&gt;-DOM Level 3 Core, DOM Level 3 Load and Save&lt;br /&gt;-W3C XML Schema 1.0&lt;br /&gt;-XSLT 1.0&lt;br /&gt;-XPath 1.0&lt;br /&gt;&lt;br /&gt;One can capture some sample codes of JAXP usage at Sun Developer's &lt;a href="http://developers.sun.com/sw/building/codesamples/dom/index.html"&gt;website&lt;/a&gt; and Sun Java  &lt;a href="http://java.sun.com/developer/codesamples/xml.html"&gt;website&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;More useful links on XML and related technologies can be found &lt;a href="http://java.sun.com/developer/technicalArticles/xml/index.html"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-808456677846523781?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/808456677846523781/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=808456677846523781' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/808456677846523781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/808456677846523781'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2008/08/what-is-jaxp.html' title='What is JAXP ?'/><author><name>Deepun</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-7300550709382233175.post-948718420170044667</id><published>2008-08-04T08:45:00.000-07:00</published><updated>2008-09-14T00:55:06.137-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Coding Standards'/><title type='text'>All Posts On Java Coding Standards</title><content type='html'>As most of my readers demanded, here is this post summarizes series of posts that I did on Java coding standards,best practices and guidelines. This is a quick reference for all readers who are looking for a consolidated information in a single post as the direct reference for same will be found on my main page.&lt;br /&gt;Here we go:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://interviewjava.blogspot.com/2008/05/java-coding-standards-layout.html"&gt;Layout&lt;/a&gt;(I)&lt;br /&gt;&lt;a href="http://interviewjava.blogspot.com/2008/06/java-coding-standardslayout.html"&gt;Layout&lt;/a&gt;(II)&lt;br /&gt;&lt;a href="http://interviewjava.blogspot.com/2008/05/java-coding-standardsdocumentation.html"&gt;Documentation&lt;/a&gt;&lt;br /&gt;&lt;a href="http://interviewjava.blogspot.com/2008/07/java-coding-standardsnaming-conventions.html"&gt;Naming Conventions&lt;/a&gt;&lt;br /&gt;&lt;a href="http://interviewjava.blogspot.com/2008/07/java-coding-standardsexception.html"&gt;Exception Handling,Logging and JUnits&lt;/a&gt;&lt;br /&gt;&lt;a href="http://interviewjava.blogspot.com/2008/08/java-coding-standards-best-practices.html"&gt;Best Practices&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-948718420170044667?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/948718420170044667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=948718420170044667' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/948718420170044667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/948718420170044667'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2008/08/all-posts-on-java-coding-standards.html' title='All Posts On Java Coding Standards'/><author><name>Deepun</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-7300550709382233175.post-6381228940043046587</id><published>2008-08-04T07:56:00.001-07:00</published><updated>2008-08-04T08:26:06.640-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Coding Standards'/><title type='text'>Java Coding Standards: Best Practices</title><content type='html'>&lt;div dir="ltr"&gt;This is my last post in series of Java coding standards posts. It focuses on best practices or dos and don'ts while coding. I am sure these good practices once observed while writing code will make your Java code consistent and in most cases bugs free. If you make these practices a habit, it ensures better code quality,less rework and robustness of one's application.&lt;br /&gt;&lt;br /&gt;Here goes the list:&lt;br /&gt;&lt;br /&gt;·Put each class in a separate file (except where a private class is used exclusively by one class only and also when using inner classes and anonymous classes).&lt;br /&gt;&lt;br /&gt;·Use relative path with respect to the location of the execution directory.&lt;br /&gt;&lt;br /&gt;·No Compiler warnings / Exceptions should be allowed in the final source code.&lt;br /&gt;&lt;br /&gt;·Declare all class variables in one place (at the top of the class).&lt;br /&gt;&lt;br /&gt;·Initialize the class/instance variables in default constructor or with declaration.&lt;br /&gt;&lt;br /&gt;· Initialize all local variables where they are declared.&lt;br /&gt;&lt;br /&gt;·Put declaration only at the beginning of the blocks.  Don't wait to declare the variables to until where they are first used (one exception is indexes to loops).&lt;br /&gt;&lt;br /&gt;·Avoid using an object to access a class (static) variable or method. Use a class name instead.&lt;br /&gt;&lt;br /&gt;·Numerical constants (literals) should not be coded directly, except for –1, 0 and 1, which can appear in a for loop as counter values.&lt;br /&gt;&lt;br /&gt;·Avoid assigning several variables to the same value in a single statement. It is hard to read.&lt;br /&gt;&lt;br /&gt;·Do not use embedded assignments in an attempt to improve run-time performance. It is the job of the compiler. Example:&lt;br /&gt;d = ( a = b + c) + f;   //Avoid&lt;br /&gt;  Should be written as&lt;br /&gt;  a  =  b + c;&lt;br /&gt;  d  =  a + f;&lt;br /&gt;&lt;br /&gt;· Generally prefer long to int, and double to float. But use int for compatibility with standard Java constructs and classes.&lt;br /&gt;&lt;br /&gt;·Minimize direct internal access to instance variables inside methods. Use protected access and update methods instead.&lt;br /&gt;&lt;br /&gt;·Prefer declaring arrays as Type[] arrayName rather than Type arrayName[].&lt;br /&gt;&lt;br /&gt;·Ensure that non-private statics have sensible values even if no instances are ever created. Use static initializers if necessary.&lt;br /&gt;&lt;br /&gt;·Define return types as void unless they return results that are not accessible otherwise&lt;br /&gt;&lt;br /&gt;·Avoid hard coding. If hard coding is inevitable due to functionality, give proper comments.&lt;br /&gt;&lt;br /&gt;· Constants specific to a class/module should be part of interfaces related to that domain. All constants must relate to some domain specific grouping. If at all possible the interfaces that define globals should be located with the classes which they would operate on.&lt;br /&gt;&lt;br /&gt;·Variables for local use should not be declared global.&lt;br /&gt;&lt;br /&gt;·Method Names, variable names, class names should be meaningful.&lt;br /&gt;  Give proper names for  methods, variables, class names focusing on&lt;br /&gt;  Maintainability, Readability.&lt;br /&gt;&lt;br /&gt;·Variables should be named in such a way that it conveys the actual usage of thevariable.&lt;br /&gt;&lt;br /&gt;·All get methods should return a value.&lt;br /&gt;&lt;br /&gt;·All set methods should accept values.&lt;br /&gt;&lt;br /&gt;·Vector, Array position specific code should not be present.&lt;br /&gt;&lt;br /&gt;·Similar methods/parts of code in different classes should be refactored.&lt;br /&gt;&lt;br /&gt;·Code inside a method should exactly serve the purpose.&lt;br /&gt;  For example, a method written for validation should not do any focus/tab  setting.&lt;br /&gt;&lt;br /&gt;·The method/variable should be declared as private if it isn't used outside the current class.&lt;br /&gt;&lt;br /&gt;·Avoid NullPointerException by checking the input parameters for null in a method and throwing an IllegalArgumentException with the appropriate message.&lt;br /&gt;&lt;br /&gt;·If the code in the constructor is too large, logical parts should be separated out into methods.&lt;br /&gt;&lt;br /&gt;·If a particular piece of logic is repeated in a class, make a private static method and move that logic in that. If the logic is shared across different classes, then it should be moved in some utility class.&lt;br /&gt;&lt;br /&gt;·Make use of appropriate data structure Collection – unordered objects, List – ordered objects, Set – unique objects, HashMap – unordered key- value pairs, LinkedHashMap – ordered key-value pairs.&lt;br /&gt;&lt;br /&gt;·Use inline comments for all complex calculations or business logics.&lt;br /&gt;&lt;br /&gt;·Check for unnecessary code like System.out.printlns in the code.&lt;br /&gt;&lt;br /&gt;·Avoid using Strings in double quoted form. Declare a local private static final constant variable for that.&lt;br /&gt;&lt;br /&gt;·Use a Iterator class for iterating a Collection, List or Set instead of using a for( ;  ; ) loop. This would make the code more consistent.&lt;br /&gt;&lt;br /&gt;·Implementation should be based on proper abstraction. Use Interfaces and abstract classes for hiding the implementation from the client code.&lt;br /&gt;&lt;br /&gt;·Try and identify the immutable attributes of your classes and make them final member variables assigned in the constructor. This can prevent some coding errors.&lt;br /&gt;&lt;br /&gt;·Always override hashCode method when you override equals. Failure to do so will result in violation of the general contract for Object.hashCode which will prevent your class from functioning properly with conjunction with all hash-based collections, including HashMap, HashSet and HashTable&lt;br /&gt;&lt;br /&gt;·Return zero-length arrays instead of nulls. Can prevent null pointer exceptions or complicated if (results == null) tests.&lt;br /&gt;&lt;br /&gt;·Try to avoid returning null from methods. Consider the NULL Object pattern as a replacement for returning Null. E.g create a static final constant class instance to represent an empty/null object. E.g Within the Employee interface public static final Employee NULL = new Employee(); So now the calling client code can test for if (Employee.NULL == result). Leads to clearer code and removes some potential for null pointer issues.&lt;br /&gt;&lt;br /&gt;·Refer to objects by their interfaces if appropriate interface exists.&lt;br /&gt;&lt;br /&gt;·Choose interfaces over abstract classes. If you know something is going to be a base class, your first choice should be to make it an interface, and only if you're forced to have method definitions or member variables should you change it to an abstract class. An interface talks about what the client wants to do, while a class tends to focus on (or allow) implementation details.&lt;br /&gt;&lt;br /&gt;·First make it work, then make it fast. This is true even if you are certain that a piece of code is really important and that it will be a principal bottleneck in your system. Don't do it. Get the system going first with as simple a design as possible. Then if it isn't going fast enough, profile it. You'll almost always discover that "your" bottleneck isn't the problem. Save your time for the really important stuff.&lt;br /&gt;&lt;br /&gt;·Watch for switch statements or chained if-else clauses. This is typically an indicator of type-check coding, which means that you are choosing what code to execute based on some kind of type information (the exact type may not be obvious at first). You can usually replace this kind of code with inheritance and polymorphism; a polymorphic method call will perform the type checking for you and allow for more reliable and easier extensibility. For Example-&lt;br /&gt;&lt;pre class="programlisting"&gt;&lt;br /&gt;&lt;br /&gt;interface IVehicle{&lt;br /&gt;void drive(Car car);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class Car {&lt;br /&gt;// These Car classes could as easily be interfaces, with no impact on the examples.&lt;br /&gt;// members&lt;br /&gt;}&lt;br /&gt;class HondaCar extends Car {&lt;br /&gt;// members&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class BMWCar extends Car {&lt;br /&gt;// members&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Good Practice&lt;br /&gt;&lt;br /&gt;class Car implements IVehicle {&lt;br /&gt;public void drive(HondaCar car){&lt;br /&gt;// handle standard drive&lt;br /&gt;}&lt;br /&gt;public void drive(BMWCar car){&lt;br /&gt;// handle BMW car&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Bad Practice&lt;br /&gt;&lt;br /&gt;class Car implements IVehicle {&lt;br /&gt;public void drive(Car car){&lt;br /&gt;&lt;br /&gt;if(car instanceOf HondaCar ) &lt;br /&gt;// perform HondaCar logic&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(car instanceOf BMWCar) &lt;br /&gt;// perform BMWCar logic&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;·From a design standpoint, look for and separate things that change from things that stay the same. That is, search for the elements in a system that you might want to change without forcing a redesign, then encapsulate those elements in classes.&lt;br /&gt;&lt;br /&gt;·Keep scopes as small as possible so the visibility and lifetime of your objects are as small as possible.&lt;br /&gt;&lt;br /&gt;·A class should only one reason to change. Attempt to keep your classes cohesive. E.g. to only do one thing and model one abstraction.&lt;br /&gt;&lt;br /&gt;·Try to understand the Open-Closed principle when designing classes. Classes should be open for extension, but closed for modification. Basically, if you need to open up your classes to add new requirements / functions this is likely to indicate that you have not modeled the domain / abstractions correctly. Interfaces, Abstract base classes are all tools you can use to correctly model and abstract the domain requirements.&lt;br /&gt;&lt;br /&gt;·Try to understand the Liskov substitution principle. Ok, nice name – good at the interviews. However, the underlying principle is sound. All subtypes must be substitutable for their base types. If you create subtypes you must ensure that if they are used in the same context as the base class that their behavior is predicable. E.g. in sub classing a type do not change its basic type behavior. Inherit because you are of that type not because you simply need some underlying common behavior.&lt;br /&gt;&lt;br /&gt;·If there are no formalized code reviews try to discuss your design concepts and code with other team members. Even if they have the same / less experience than you. Sometimes the act of talking something out load can highlight good and bad elements in your code.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-6381228940043046587?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/6381228940043046587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=6381228940043046587' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/6381228940043046587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/6381228940043046587'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2008/08/java-coding-standards-best-practices.html' title='Java Coding Standards: Best Practices'/><author><name>Deepun</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-7300550709382233175.post-7140822726758470862</id><published>2008-07-25T23:06:00.001-07:00</published><updated>2008-08-04T08:30:28.622-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Coding Standards'/><title type='text'>Java Coding Standards:Exception Handling,Logging,JUnits</title><content type='html'>At enterprise level writing robust code is essential and test driven development technique is helping one in achieving that. So while you code your business components then writing JUnits in parallel is an essential exercise. This helps in checking all positive and negative scenarios which your code can get exposed to. While putting erroneous conditions, your code will behave erroneously,throwing relevant exceptions at right levels with messages making correct sense where and what went wrong. Besides correct exception handling,ensuring right way of logging errors,debug information and general information is significant from testing your code correctly.This post will focus on exception handling,logging and JUnits related coding standards.&lt;br /&gt;&lt;br /&gt;In this post focus is writing/compiling standards required for Exception handling,logging and JUnits coding. I am sure these tips will give you some practical insight to achieve&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Exception Handling&lt;/span&gt;&lt;br /&gt;- Use runtime exception or extensions of this type. Checked exceptions should be avoided unless they make semantic sense for the interface/method. If not all clients of that component have to handle the checked exception even if there is nothing they can do without other than re throw it. These leads to a lot of messy try catch re throw code.&lt;br /&gt;- Log all exceptions at the boundaries of the application. Exceptions should not be logged at every level they are caught and re-thrown. This can cause a lot of noise in the log files. Exceptions should be caught and logged at the boundaries of the application. E.g Middletier/service delegate level, webservice component level etc. The fact that a sub component throws an exception may not be a critical situation for the calling component. As such exceptions should be "bubbled" up to the top most layer of the application and logged just before the application loses programmatic control e.g to the application server or some other invocation framework (webservices, messaging systems etc).&lt;br /&gt;-If rethrowing an exception ensure that the stack trace from the original exception is propagated to the new exception. E.g. converting from a checked to a runtime exception.&lt;br /&gt;&lt;pre class="programlisting"&gt;&lt;br /&gt;try {&lt;br /&gt;} catch (RealException realException){&lt;br /&gt;throw new RuntimeException(message,realException);&lt;br /&gt;}&lt;br /&gt; &lt;/pre&gt;      &lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Logging&lt;/span&gt;&lt;br /&gt;This section lists the practices, which should be followed while using Logging. Following these practices make bug fixing easy.&lt;br /&gt;&lt;br /&gt;- Logger variable should always be declared as private static variable. For  example&lt;br /&gt;private static final Logger logger = Logger.getLogger(Main.class);&lt;br /&gt;- Use the appropriate message level.&lt;br /&gt;* INFO – For logging successful completion of a process.&lt;br /&gt;* DEBUG – For logging the input and output parameters and understanding the behavior in detail.&lt;br /&gt;* ERROR – For logging the failure messages from exceptions.&lt;br /&gt;- Check whether the logging has been enabled for that severity. E.g&lt;br /&gt;&lt;br /&gt;if (logger.isDebugEnabled()){&lt;br /&gt;//log something;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;- All Exception should be logged in the catch block with ERROR as the message level.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;JUnit&lt;/span&gt;&lt;br /&gt;This section lists the practices, which should be followed for coding Junit test cases as well as execution of Junits.&lt;br /&gt;&lt;br /&gt;- All classes should have a reasonable Junit coverage. To the extent possible all public methods in the class should have one or more corresponding Junit methods. E.g. one positive test method and another negative test method corresponding to a public method.  This is just a thumb rule, the no of test methods could even be more. The only exceptions to this rule are getters and setters methods.&lt;br /&gt;- How easy a class is to test depends on how good the underlying design is. Difficult classes to test, which have too many dependencies that need to be resolved or have poor interfaces, may need to be refactored accordingly.&lt;br /&gt;- If the assertEquals () requires a comparison of two Objects, then make a customized assert&amp;lt;ObjectName&amp;gt;Equals() method which carries the assertEquals() on each property of the object with appropriate message.&lt;br /&gt;- When writing a negative test case use the following convention:&lt;br /&gt;&lt;pre class="programlisting"&gt;&lt;br /&gt;                try{&lt;br /&gt;                      class.method();&lt;br /&gt;                       fail(&amp;lt;appropriate message&amp;gt;);&lt;br /&gt;                       }&lt;br /&gt;                 catch(SpecificException ex){&lt;br /&gt;                      // Successful condition&lt;br /&gt;                    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;- For any bug reported during onsite or offshore system/unit testing, new unit test cases must be added Bottom line the test cases must be expanded to test the resolution to a given bug. So I would see at a minimum for each bug raised there should be a test case to replicate the conditions and validate the resolution.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-7140822726758470862?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/7140822726758470862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=7140822726758470862' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/7140822726758470862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/7140822726758470862'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2008/07/java-coding-standardsexception.html' title='Java Coding Standards:Exception Handling,Logging,JUnits'/><author><name>Deepun</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-7300550709382233175.post-4843758300933055445</id><published>2008-07-21T09:27:00.001-07:00</published><updated>2008-07-21T09:48:57.756-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Coding Standards'/><title type='text'>Java Coding Standards:Naming Conventions</title><content type='html'>While coding it is significant to stick to naming conventions of the language and Java is also no exception in that.The reason of this practice is to make your code look consistent and easy to comprehend.In most of the situations these conventions are set at organization level but some of them on a broader level are summarized under points given below:&lt;br /&gt;&lt;b&gt;Package&lt;/b&gt;&lt;br /&gt;-Capitals should not be used in the packages names.&lt;br /&gt;-Automated unit test cases using frameworks like JUnit should be placed in a parallel package hierarchy in a separate source folder. &lt;br /&gt;-Using the same package naming convention for them would cater to easy testability of complex protected methods&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Classes&lt;/b&gt;&lt;br /&gt;-Class name should be noun in mixed case, with the first letter upper case and the first letter of any subsequent words capitalized.&lt;br /&gt;-If your class implements as design pattern then a the pattern as a suffix to the class name e.g &amp;lt;ClassName&amp;gt;Singleton, &amp;lt;ClassName&amp;gt;Decorator, &amp;lt;ClassName&amp;gt;Factory, &amp;lt;ClassName&amp;gt;Builder,&amp;lt;ClassName&amp;gt;Strategy.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Methods&lt;/b&gt;&lt;br /&gt;-Method names should be verbs or verb phrases, with first letter in lower case and first letter of every subsequent word in uppercase. Underscore should not be used in method names. Some examples of conforming names are&lt;br /&gt;createUserGroup()&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Variables&lt;/b&gt;&lt;br /&gt;-Variables should have names that are nouns, noun phrases, or abbreviations for nouns. Names of fields that are not final should have the first letter in lower case and first letter of the subsequent words in uppercase.  Underscore should not be used in variable names. Some examples of conforming names are &lt;span style="font-style: italic;"&gt;logger, logManager&lt;/span&gt;&lt;br /&gt;-One –character local variable or parameter names should be avoided, except for temporary and looping variables, or where a variable holds an undistinguished value of a type.&lt;br /&gt;-Variables should not have the same name as one in a super class.&lt;br /&gt;-Collection classes, such as vectors and hashes should always be pluralized Member variables. E.g deviceNames, deviceNamesVector etc.&lt;br /&gt;-All member variables should be prefixed with f. E.g. &lt;span style="font-style:italic;"&gt;fMyMemberVariable&lt;/span&gt;. Use of the this.variable definition should be avoided for scope resolution between local and class level variables.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Constants&lt;/b&gt;&lt;br /&gt;-The names of constants in interface types and final variables of class types should be a sequence of one or more words, acronyms, or abbreviations, all uppercase, with words separated by underscore "_" characters.  All constants should public/private static final.&lt;br /&gt;-Some examples of conforming names are&lt;br /&gt;MIN_VALUE&lt;br /&gt;MAX_VALUE&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Exceptions&lt;/b&gt;&lt;br /&gt;-Exceptions should follow the same naming conventions as those for naming classes; they must additionally be suffixed by the word Exception. For example, if more than one Exceptionvariable is in scope exception variables should be suffixed by Ex. Normal IDE behavior is to create an initial Exception variable in a try catch block as simply (e). This is acceptable. If more than one variable is required then these should be distinguished using the naming model defined below.&lt;br /&gt;&lt;br /&gt;-The exception variables should be prefixed by some acronym. Commonly used ones are&lt;span style="font-style: italic;"&gt; locEx for LocalizedException&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;sqlEx for SQLException, ioEx for IOException.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;JUnits&lt;/b&gt;&lt;br /&gt;Test must be used in the name of the junit as suffix.&lt;br /&gt;Example:&lt;br /&gt;        Class name: UserLogon&lt;br /&gt;        Junit Test Class name:  UserLogonTest&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-4843758300933055445?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/4843758300933055445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=4843758300933055445' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/4843758300933055445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/4843758300933055445'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2008/07/java-coding-standardsnaming-conventions.html' title='Java Coding Standards:Naming Conventions'/><author><name>Deepun</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-7300550709382233175.post-2901885161192229045</id><published>2008-07-05T02:22:00.000-07:00</published><updated>2008-07-05T02:57:04.235-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse IDE'/><title type='text'>Learning Eclipse IDE</title><content type='html'>Recently stumbled upon some good tutorials on Eclipse IDE.I just thought of sharing with you all who are new to Eclipse and want to try their hands on it.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;An Eclipse-Java Tutorial for Total Beginners:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/aKml129HqbA&amp;hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/aKml129HqbA&amp;hl=en&amp;fs=1&amp;color1=0x3a3a3a&amp;color2=0x999999&amp;border=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;An Eclipse-Java Tutorial on Introducing Persistence:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="349"&gt;&lt;param name="movie" value="http://www.youtube.com/v/K80oYdp047k&amp;hl=en&amp;fs=1&amp;color1=0x3a3a3a&amp;color2=0x999999&amp;border=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/K80oYdp047k&amp;hl=en&amp;fs=1&amp;color1=0x3a3a3a&amp;color2=0x999999&amp;border=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="349"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;An Eclipse Tutorial on Using Debugger:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="349"&gt;&lt;param name="movie" value="http://www.youtube.com/v/WeSitNPAExg&amp;hl=en&amp;fs=1&amp;color1=0x3a3a3a&amp;color2=0x999999&amp;border=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/WeSitNPAExg&amp;hl=en&amp;fs=1&amp;color1=0x3a3a3a&amp;color2=0x999999&amp;border=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="349"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;There are more Java learning video tutorials from Eclipse tutorials portal which can be downloaded from the following URL:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sourceforge.net/project/showfiles.php?group_id=200662&amp;package_id=260599" target="_blank"&gt;Eclipse and Java Video Tutorials&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In case of any broken link please report to me so that I can make relevant changes.&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7300550709382233175-2901885161192229045?l=www.interviewjava.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.interviewjava.com/feeds/2901885161192229045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7300550709382233175&amp;postID=2901885161192229045' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/2901885161192229045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7300550709382233175/posts/default/2901885161192229045'/><link rel='alternate' type='text/html' href='http://www.interviewjava.com/2008/07/learning-eclipse-ide.html' title='Learning Eclipse IDE'/><author><name>Deepun</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-7300550709382233175.post-1538707108930456825</id><published>2008-06-29T09:02:00.000-07:00</published><updated>2009-09-12T00:01:00.197-07:00</updated><title type='text'>Good Bye Bill-Gates Open For a Rockstar</title><content type='html'>Hi folks, this post is deviated from the theme of this blog to honor Mr. Bill Gates who logged out from Microsoft on 28th June,2008. He made PCs a household success.What next Mr. Gates....giving Bono run for his money...phew...that is what I call a dreamer.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/3HA4lSUhlbw&amp;hl=en"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/3HA4lSUhlbw&amp;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-8148979630051682";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQzcLH7QEaCD_4BVTjvVryKLGsuIEB";
google_ad_channel = "";
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads
