<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:georss="http://www.georss.org/georss" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-7300550709382233175</atom:id><lastBuildDate>Sat, 14 Nov 2009 17:49:42 +0000</lastBuildDate><title>Interview Questions On Java,Java EE</title><description>World of tricky Core Java Q&amp;amp;A(Java SE),Java EE and Open source technologies like Struts,Hibernate,Spring,Velocity  etc</description><link>http://www.interviewjava.com/</link><managingEditor>noreply@blogger.com (Deepun)</managingEditor><generator>Blogger</generator><openSearch:totalResults>370</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><creativeCommons:license>http://creativecommons.org/licenses/by-nd/3.0/</creativeCommons:license><image><link>http://creativecommons.org/licenses/by-nd/3.0/</link><url>http://creativecommons.org/images/public/somerights20.gif</url><title>Some Rights Reserved</title></image><xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/iqjava" type="application/rss+xml" /><feedburner:emailServiceId>iqjava</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-8179073243054121444</guid><pubDate>Fri, 03 Apr 2015 15:38:00 +0000</pubDate><atom:updated>2009-09-26T01:48:27.662-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Core Java</category><title>Core Java Interview Questions</title><description>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;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;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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2wFtSUud2DJxkgh3YgP8uPBU_9s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2wFtSUud2DJxkgh3YgP8uPBU_9s/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2wFtSUud2DJxkgh3YgP8uPBU_9s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2wFtSUud2DJxkgh3YgP8uPBU_9s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=VY6rpANl8hI:qQ-zDF6H9n8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=VY6rpANl8hI:qQ-zDF6H9n8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=VY6rpANl8hI:qQ-zDF6H9n8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=VY6rpANl8hI:qQ-zDF6H9n8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=VY6rpANl8hI:qQ-zDF6H9n8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=VY6rpANl8hI:qQ-zDF6H9n8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=VY6rpANl8hI:qQ-zDF6H9n8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/VY6rpANl8hI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/VY6rpANl8hI/test.html</link><author>noreply@blogger.com (Deepun)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">15</thr:total><feedburner:origLink>http://www.interviewjava.com/2007/04/test.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-4747186188452860565</guid><pubDate>Thu, 02 Apr 2015 10:00:00 +0000</pubDate><atom:updated>2009-08-31T07:22:59.949-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">JEE</category><title>Java EE,Open Source,Advanced Technologies Interview Questions</title><description>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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QwC5xH2PkomnTRsYtyYeNoUrctk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QwC5xH2PkomnTRsYtyYeNoUrctk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QwC5xH2PkomnTRsYtyYeNoUrctk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QwC5xH2PkomnTRsYtyYeNoUrctk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=Fs0SnbDd3vM:10ikGqpPmQA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=Fs0SnbDd3vM:10ikGqpPmQA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=Fs0SnbDd3vM:10ikGqpPmQA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=Fs0SnbDd3vM:10ikGqpPmQA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=Fs0SnbDd3vM:10ikGqpPmQA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=Fs0SnbDd3vM:10ikGqpPmQA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=Fs0SnbDd3vM:10ikGqpPmQA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/Fs0SnbDd3vM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/Fs0SnbDd3vM/java-ee-interview-questions.html</link><author>noreply@blogger.com (Deepun)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">6</thr:total><feedburner:origLink>http://www.interviewjava.com/2007/05/java-ee-interview-questions.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-5261139969436436891</guid><pubDate>Mon, 02 Mar 2015 08:54:00 +0000</pubDate><atom:updated>2009-08-15T10:08:27.399-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Master List Core Java</category><title>Master List Of Core Java Questions</title><description>&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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XluBaBTMS4XS71uFag_ZEwHkwBE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XluBaBTMS4XS71uFag_ZEwHkwBE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XluBaBTMS4XS71uFag_ZEwHkwBE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XluBaBTMS4XS71uFag_ZEwHkwBE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=lMHULGdxyLg:Kk9Sy5lG_z0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=lMHULGdxyLg:Kk9Sy5lG_z0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=lMHULGdxyLg:Kk9Sy5lG_z0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=lMHULGdxyLg:Kk9Sy5lG_z0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=lMHULGdxyLg:Kk9Sy5lG_z0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=lMHULGdxyLg:Kk9Sy5lG_z0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=lMHULGdxyLg:Kk9Sy5lG_z0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/lMHULGdxyLg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/lMHULGdxyLg/master-list-of-core-java-questions.html</link><author>noreply@blogger.com (Deepun)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">12</thr:total><feedburner:origLink>http://www.interviewjava.com/2007/06/master-list-of-core-java-questions.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-6830031140854350771</guid><pubDate>Sun, 01 Mar 2015 16:32:00 +0000</pubDate><atom:updated>2009-08-31T07:23:21.055-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">JEE</category><title>Master List Of Java EE,Open Source,Advanced Technologies Questions(Release I )</title><description>&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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Dibr6th_dkecUTL0xp0Ep_jk8P0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Dibr6th_dkecUTL0xp0Ep_jk8P0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Dibr6th_dkecUTL0xp0Ep_jk8P0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Dibr6th_dkecUTL0xp0Ep_jk8P0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=jJC6MCakdhI:rY2XT5vcsDI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=jJC6MCakdhI:rY2XT5vcsDI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=jJC6MCakdhI:rY2XT5vcsDI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=jJC6MCakdhI:rY2XT5vcsDI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=jJC6MCakdhI:rY2XT5vcsDI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=jJC6MCakdhI:rY2XT5vcsDI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=jJC6MCakdhI:rY2XT5vcsDI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/jJC6MCakdhI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/jJC6MCakdhI/master-list-of-java-ee-questionsrelease.html</link><author>noreply@blogger.com (Deepun)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.interviewjava.com/2007/06/master-list-of-java-ee-questionsrelease.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-3192572842021880014</guid><pubDate>Sun, 01 Feb 2015 16:43:00 +0000</pubDate><atom:updated>2009-08-31T06:55:39.176-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Core Java</category><title>Miscellaneous Core Java Questions With Short Answers</title><description>&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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/B7voqjtdKbvQyfwQyKEGcVjk9sI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/B7voqjtdKbvQyfwQyKEGcVjk9sI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/B7voqjtdKbvQyfwQyKEGcVjk9sI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/B7voqjtdKbvQyfwQyKEGcVjk9sI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=UIjM5463kCY:QZs8pXsjuE8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=UIjM5463kCY:QZs8pXsjuE8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=UIjM5463kCY:QZs8pXsjuE8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=UIjM5463kCY:QZs8pXsjuE8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=UIjM5463kCY:QZs8pXsjuE8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=UIjM5463kCY:QZs8pXsjuE8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=UIjM5463kCY:QZs8pXsjuE8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/UIjM5463kCY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/UIjM5463kCY/miscellaneous-core-java-questions-with.html</link><author>noreply@blogger.com (Deepun)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://www.interviewjava.com/2007/05/miscellaneous-core-java-questions-with.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-1384270668548784189</guid><pubDate>Mon, 26 Jan 2015 14:18:00 +0000</pubDate><atom:updated>2009-08-15T10:10:03.412-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Code Snippet</category><title>Master List Of Code Snippets</title><description>&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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MJPluLqVba0DJ4HgYqY2QCpQoyw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MJPluLqVba0DJ4HgYqY2QCpQoyw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MJPluLqVba0DJ4HgYqY2QCpQoyw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MJPluLqVba0DJ4HgYqY2QCpQoyw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=y33lKexynMo:Kfl6DWGPLtQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=y33lKexynMo:Kfl6DWGPLtQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=y33lKexynMo:Kfl6DWGPLtQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=y33lKexynMo:Kfl6DWGPLtQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=y33lKexynMo:Kfl6DWGPLtQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=y33lKexynMo:Kfl6DWGPLtQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=y33lKexynMo:Kfl6DWGPLtQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/y33lKexynMo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/y33lKexynMo/master-list-of-code-snippets.html</link><author>noreply@blogger.com (Deepun)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.interviewjava.com/2015/01/master-list-of-code-snippets.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-8101714370717194044</guid><pubDate>Mon, 12 Jan 2015 05:35:00 +0000</pubDate><atom:updated>2009-08-31T07:13:48.982-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Service Oriented Architecture</category><title>Simplifying Service Oriented Architecture</title><description>&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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gjlcdEWjd7jl4Fg7lPamz8R5Gww/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gjlcdEWjd7jl4Fg7lPamz8R5Gww/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/gjlcdEWjd7jl4Fg7lPamz8R5Gww/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gjlcdEWjd7jl4Fg7lPamz8R5Gww/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=vqX6Sdf1mEE:PZ2iWVFBE1U:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=vqX6Sdf1mEE:PZ2iWVFBE1U:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=vqX6Sdf1mEE:PZ2iWVFBE1U:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=vqX6Sdf1mEE:PZ2iWVFBE1U:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=vqX6Sdf1mEE:PZ2iWVFBE1U:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=vqX6Sdf1mEE:PZ2iWVFBE1U:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=vqX6Sdf1mEE:PZ2iWVFBE1U:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/vqX6Sdf1mEE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/vqX6Sdf1mEE/simplifying-service-oriented.html</link><author>noreply@blogger.com (Deepun)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://www.interviewjava.com/2008/04/simplifying-service-oriented.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-3942234584192617979</guid><pubDate>Wed, 04 Nov 2009 13:59:00 +0000</pubDate><atom:updated>2009-11-13T05:49:53.825-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Hibernate</category><title>How to persist the java objects using Hibernate ORM framework?</title><description>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;/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;/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('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;/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('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;/div&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;/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('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;/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('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;/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;/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('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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Pf7ROnyLzbrvfXbS3Rpn5oSV-A8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Pf7ROnyLzbrvfXbS3Rpn5oSV-A8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Pf7ROnyLzbrvfXbS3Rpn5oSV-A8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Pf7ROnyLzbrvfXbS3Rpn5oSV-A8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=3B_8BfjjEuk:zYnu_sjQIOk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=3B_8BfjjEuk:zYnu_sjQIOk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=3B_8BfjjEuk:zYnu_sjQIOk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=3B_8BfjjEuk:zYnu_sjQIOk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=3B_8BfjjEuk:zYnu_sjQIOk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=3B_8BfjjEuk:zYnu_sjQIOk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=3B_8BfjjEuk:zYnu_sjQIOk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/3B_8BfjjEuk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/3B_8BfjjEuk/how-to-persist-java-objects-using.html</link><author>noreply@blogger.com (Deepun)</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" /><feedburner:origLink>http://www.interviewjava.com/2009/11/how-to-persist-java-objects-using.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-6023273191282587925</guid><pubDate>Thu, 08 Oct 2009 11:41:00 +0000</pubDate><atom:updated>2009-10-08T04:42:53.239-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ANT</category><title>How is ANT Property Task used?</title><description>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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/To26oJvNiUXxEb7xpONrURDAbDk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/To26oJvNiUXxEb7xpONrURDAbDk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/To26oJvNiUXxEb7xpONrURDAbDk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/To26oJvNiUXxEb7xpONrURDAbDk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=1fQiQASD9GY:41tXZDZ5kJ4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=1fQiQASD9GY:41tXZDZ5kJ4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=1fQiQASD9GY:41tXZDZ5kJ4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=1fQiQASD9GY:41tXZDZ5kJ4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=1fQiQASD9GY:41tXZDZ5kJ4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=1fQiQASD9GY:41tXZDZ5kJ4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=1fQiQASD9GY:41tXZDZ5kJ4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/1fQiQASD9GY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/1fQiQASD9GY/how-is-ant-property-task-used.html</link><author>noreply@blogger.com (Deepun)</author><feedburner:origLink>http://www.interviewjava.com/2009/10/how-is-ant-property-task-used.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-3258296887035331553</guid><pubDate>Thu, 08 Oct 2009 10:21:00 +0000</pubDate><atom:updated>2009-10-08T03:23:47.985-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ANT</category><category domain="http://www.blogger.com/atom/ns#">Eclipse IDE</category><title>How to integrate ANT tool with Eclipse IDE?</title><description>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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gqHvOhPQrc48amsVfT__Jw_wsbQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gqHvOhPQrc48amsVfT__Jw_wsbQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/gqHvOhPQrc48amsVfT__Jw_wsbQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gqHvOhPQrc48amsVfT__Jw_wsbQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=fNBrlgDRy04:-_aV-si3YcE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=fNBrlgDRy04:-_aV-si3YcE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=fNBrlgDRy04:-_aV-si3YcE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=fNBrlgDRy04:-_aV-si3YcE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=fNBrlgDRy04:-_aV-si3YcE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=fNBrlgDRy04:-_aV-si3YcE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=fNBrlgDRy04:-_aV-si3YcE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/fNBrlgDRy04" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/fNBrlgDRy04/how-to-integrate-ant-tool-with-eclipse.html</link><author>noreply@blogger.com (Deepun)</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" /><feedburner:origLink>http://www.interviewjava.com/2009/10/how-to-integrate-ant-tool-with-eclipse.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-5195990000325986209</guid><pubDate>Wed, 07 Oct 2009 16:38:00 +0000</pubDate><atom:updated>2009-10-08T02:33:43.979-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ANT</category><title>What is ANT and how can one configure it?</title><description>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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AzWpxfKt_wnUOgKEHu_kiVhIk28/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AzWpxfKt_wnUOgKEHu_kiVhIk28/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/AzWpxfKt_wnUOgKEHu_kiVhIk28/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AzWpxfKt_wnUOgKEHu_kiVhIk28/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=wd9H5NIsgWs:wxiIwq8Ntkw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=wd9H5NIsgWs:wxiIwq8Ntkw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=wd9H5NIsgWs:wxiIwq8Ntkw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=wd9H5NIsgWs:wxiIwq8Ntkw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=wd9H5NIsgWs:wxiIwq8Ntkw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=wd9H5NIsgWs:wxiIwq8Ntkw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=wd9H5NIsgWs:wxiIwq8Ntkw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/wd9H5NIsgWs" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/wd9H5NIsgWs/what-is-ant-and-how-can-one-configure.html</link><author>noreply@blogger.com (Deepun)</author><feedburner:origLink>http://www.interviewjava.com/2009/10/what-is-ant-and-how-can-one-configure.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-7382838239199505196</guid><pubDate>Mon, 05 Oct 2009 15:29:00 +0000</pubDate><atom:updated>2009-10-05T09:45:51.015-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">log4j</category><title>How do you configure log4j with XML?</title><description>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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/W6jyQAReveu6as9FOBAm3e8EPRQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/W6jyQAReveu6as9FOBAm3e8EPRQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/W6jyQAReveu6as9FOBAm3e8EPRQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/W6jyQAReveu6as9FOBAm3e8EPRQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=x7H_t3PFHVk:sy8RnkD6Nyk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=x7H_t3PFHVk:sy8RnkD6Nyk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=x7H_t3PFHVk:sy8RnkD6Nyk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=x7H_t3PFHVk:sy8RnkD6Nyk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=x7H_t3PFHVk:sy8RnkD6Nyk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=x7H_t3PFHVk:sy8RnkD6Nyk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=x7H_t3PFHVk:sy8RnkD6Nyk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/x7H_t3PFHVk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/x7H_t3PFHVk/how-do-you-configure-log4j-with-xml.html</link><author>noreply@blogger.com (Deepun)</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" /><feedburner:origLink>http://www.interviewjava.com/2009/10/how-do-you-configure-log4j-with-xml.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-7818977099529781494</guid><pubDate>Fri, 02 Oct 2009 16:35:00 +0000</pubDate><atom:updated>2009-10-02T09:35:30.484-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">log4j</category><title>How to log different modules in different log files?</title><description>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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/LOP8JCiY_Gj70VNI9zjuXHJqwk4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LOP8JCiY_Gj70VNI9zjuXHJqwk4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/LOP8JCiY_Gj70VNI9zjuXHJqwk4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LOP8JCiY_Gj70VNI9zjuXHJqwk4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=NaIDvexnqX0:KcjIjj7hJi8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=NaIDvexnqX0:KcjIjj7hJi8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=NaIDvexnqX0:KcjIjj7hJi8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=NaIDvexnqX0:KcjIjj7hJi8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=NaIDvexnqX0:KcjIjj7hJi8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=NaIDvexnqX0:KcjIjj7hJi8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=NaIDvexnqX0:KcjIjj7hJi8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/NaIDvexnqX0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/NaIDvexnqX0/how-to-log-different-modules-in.html</link><author>noreply@blogger.com (Deepun)</author><feedburner:origLink>http://www.interviewjava.com/2009/10/how-to-log-different-modules-in.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-4942019629928583523</guid><pubDate>Sun, 27 Sep 2009 12:37:00 +0000</pubDate><atom:updated>2009-09-27T05:43:25.942-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Code Snippet</category><category domain="http://www.blogger.com/atom/ns#">log4j</category><title>Log4j Configuration With properties file</title><description>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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6dXXwCIkm3KsC-hFL4ClLqcIQ44/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6dXXwCIkm3KsC-hFL4ClLqcIQ44/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/6dXXwCIkm3KsC-hFL4ClLqcIQ44/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6dXXwCIkm3KsC-hFL4ClLqcIQ44/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=8GTIndolaD4:MX3cNOmPFpw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=8GTIndolaD4:MX3cNOmPFpw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=8GTIndolaD4:MX3cNOmPFpw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=8GTIndolaD4:MX3cNOmPFpw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=8GTIndolaD4:MX3cNOmPFpw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=8GTIndolaD4:MX3cNOmPFpw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=8GTIndolaD4:MX3cNOmPFpw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/8GTIndolaD4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/8GTIndolaD4/log4j-configuration-with-properties.html</link><author>noreply@blogger.com (Deepun)</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" /><feedburner:origLink>http://www.interviewjava.com/2009/09/log4j-configuration-with-properties.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-1538232004799133424</guid><pubDate>Sun, 27 Sep 2009 09:34:00 +0000</pubDate><atom:updated>2009-09-27T02:38:46.176-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">log4j</category><title>What is Log4j and how can it be configured?</title><description>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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/euoBkLjp0QOXptQujeps-sJVArU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/euoBkLjp0QOXptQujeps-sJVArU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/euoBkLjp0QOXptQujeps-sJVArU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/euoBkLjp0QOXptQujeps-sJVArU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=QHDVeez-3Ng:9aclfwBv62Q:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=QHDVeez-3Ng:9aclfwBv62Q:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=QHDVeez-3Ng:9aclfwBv62Q:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=QHDVeez-3Ng:9aclfwBv62Q:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=QHDVeez-3Ng:9aclfwBv62Q:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=QHDVeez-3Ng:9aclfwBv62Q:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=QHDVeez-3Ng:9aclfwBv62Q:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/QHDVeez-3Ng" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/QHDVeez-3Ng/what-is-log4j-and-how-can-it-be.html</link><author>noreply@blogger.com (Deepun)</author><feedburner:origLink>http://www.interviewjava.com/2009/09/what-is-log4j-and-how-can-it-be.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-1022243416634253642</guid><pubDate>Wed, 23 Sep 2009 14:34:00 +0000</pubDate><atom:updated>2009-09-23T09:18:22.178-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Code Snippet</category><category domain="http://www.blogger.com/atom/ns#">Velocity Framework</category><title>Velocity With XML</title><description>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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/YBLTU8nlNymaLzRRzD5e2SLW9ZQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YBLTU8nlNymaLzRRzD5e2SLW9ZQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/YBLTU8nlNymaLzRRzD5e2SLW9ZQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YBLTU8nlNymaLzRRzD5e2SLW9ZQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=s-7PJcKJui4:v71HzKxAmPY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=s-7PJcKJui4:v71HzKxAmPY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=s-7PJcKJui4:v71HzKxAmPY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=s-7PJcKJui4:v71HzKxAmPY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=s-7PJcKJui4:v71HzKxAmPY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=s-7PJcKJui4:v71HzKxAmPY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=s-7PJcKJui4:v71HzKxAmPY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/s-7PJcKJui4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/s-7PJcKJui4/velocity-with-xml.html</link><author>noreply@blogger.com (Deepun)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.interviewjava.com/2009/09/velocity-with-xml.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-6961806339990257130</guid><pubDate>Thu, 17 Sep 2009 13:50:00 +0000</pubDate><atom:updated>2009-09-17T23:18:15.955-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Code Snippet</category><category domain="http://www.blogger.com/atom/ns#">Velocity Framework</category><title>EMailing Through Velocity Framework</title><description>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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9G5r-Jwh4qNWWCD-bJQIsejjmmg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9G5r-Jwh4qNWWCD-bJQIsejjmmg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9G5r-Jwh4qNWWCD-bJQIsejjmmg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9G5r-Jwh4qNWWCD-bJQIsejjmmg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=h9OBGB_i32w:mnH8w6lPqL8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=h9OBGB_i32w:mnH8w6lPqL8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=h9OBGB_i32w:mnH8w6lPqL8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=h9OBGB_i32w:mnH8w6lPqL8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=h9OBGB_i32w:mnH8w6lPqL8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=h9OBGB_i32w:mnH8w6lPqL8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=h9OBGB_i32w:mnH8w6lPqL8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/h9OBGB_i32w" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/h9OBGB_i32w/emailing-through-velocity-framework.html</link><author>noreply@blogger.com (Deepun)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.interviewjava.com/2009/09/emailing-through-velocity-framework.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-6469483843855887201</guid><pubDate>Tue, 08 Sep 2009 10:14:00 +0000</pubDate><atom:updated>2009-09-08T03:15:18.547-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">EBooks</category><title>Objects and Java Building Object-Oriented, Multi-Threaded Applications with Java by Bill Venners</title><description>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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3Mjq6dPRWR-TvkHn5ol33ywnLZ8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3Mjq6dPRWR-TvkHn5ol33ywnLZ8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3Mjq6dPRWR-TvkHn5ol33ywnLZ8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3Mjq6dPRWR-TvkHn5ol33ywnLZ8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=NHCBrCgRYZo:3S5Oinhtdis:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=NHCBrCgRYZo:3S5Oinhtdis:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=NHCBrCgRYZo:3S5Oinhtdis:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=NHCBrCgRYZo:3S5Oinhtdis:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=NHCBrCgRYZo:3S5Oinhtdis:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=NHCBrCgRYZo:3S5Oinhtdis:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=NHCBrCgRYZo:3S5Oinhtdis:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/NHCBrCgRYZo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/NHCBrCgRYZo/objects-and-java-building-object.html</link><author>noreply@blogger.com (Deepun)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.interviewjava.com/2009/09/objects-and-java-building-object.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-5473590006050213183</guid><pubDate>Tue, 08 Sep 2009 10:13:00 +0000</pubDate><atom:updated>2009-09-08T03:14:28.535-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">EBooks</category><title>Sams Teach Yourself Java 2 in 24 Hours</title><description>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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KFIJsipj3uKn3N3nnlxjo0l0AnA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KFIJsipj3uKn3N3nnlxjo0l0AnA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KFIJsipj3uKn3N3nnlxjo0l0AnA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KFIJsipj3uKn3N3nnlxjo0l0AnA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=1FO4SDvw9Lw:Ia_2jD4Pemk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=1FO4SDvw9Lw:Ia_2jD4Pemk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=1FO4SDvw9Lw:Ia_2jD4Pemk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=1FO4SDvw9Lw:Ia_2jD4Pemk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=1FO4SDvw9Lw:Ia_2jD4Pemk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=1FO4SDvw9Lw:Ia_2jD4Pemk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=1FO4SDvw9Lw:Ia_2jD4Pemk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/1FO4SDvw9Lw" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/1FO4SDvw9Lw/sams-teach-yourself-java-2-in-24-hours.html</link><author>noreply@blogger.com (Deepun)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.interviewjava.com/2009/09/sams-teach-yourself-java-2-in-24-hours.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-9109526241026708391</guid><pubDate>Tue, 08 Sep 2009 10:12:00 +0000</pubDate><atom:updated>2009-09-08T03:13:41.664-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">EBooks</category><title>Thinking In Java by Bruce Eckel,Ist,IInd and IIIrd Editions</title><description>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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/IIgMiU1wzOOShK5QhZEcImjN8rY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IIgMiU1wzOOShK5QhZEcImjN8rY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/IIgMiU1wzOOShK5QhZEcImjN8rY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IIgMiU1wzOOShK5QhZEcImjN8rY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=RJRUiqF3kp8:GSOfwfgEUYM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=RJRUiqF3kp8:GSOfwfgEUYM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=RJRUiqF3kp8:GSOfwfgEUYM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=RJRUiqF3kp8:GSOfwfgEUYM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=RJRUiqF3kp8:GSOfwfgEUYM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=RJRUiqF3kp8:GSOfwfgEUYM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=RJRUiqF3kp8:GSOfwfgEUYM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/RJRUiqF3kp8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/RJRUiqF3kp8/thinking-in-java-by-bruce-eckelistiind.html</link><author>noreply@blogger.com (Deepun)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.interviewjava.com/2009/09/thinking-in-java-by-bruce-eckelistiind.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-6624385388314443992</guid><pubDate>Tue, 08 Sep 2009 10:12:00 +0000</pubDate><atom:updated>2009-09-08T03:12:44.588-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">EBooks</category><title>The Java Tutorial IIIrd Edition</title><description>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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/aMB6YUBzgOJS-IkMPVbe2jEaJlU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aMB6YUBzgOJS-IkMPVbe2jEaJlU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/aMB6YUBzgOJS-IkMPVbe2jEaJlU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aMB6YUBzgOJS-IkMPVbe2jEaJlU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=fYNNuDLnkZU:lHPHSPNoOdw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=fYNNuDLnkZU:lHPHSPNoOdw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=fYNNuDLnkZU:lHPHSPNoOdw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=fYNNuDLnkZU:lHPHSPNoOdw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=fYNNuDLnkZU:lHPHSPNoOdw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=fYNNuDLnkZU:lHPHSPNoOdw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=fYNNuDLnkZU:lHPHSPNoOdw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/fYNNuDLnkZU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/fYNNuDLnkZU/java-tutorial-iiird-edition.html</link><author>noreply@blogger.com (Deepun)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.interviewjava.com/2009/09/java-tutorial-iiird-edition.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-6316002883402657959</guid><pubDate>Tue, 08 Sep 2009 10:10:00 +0000</pubDate><atom:updated>2009-09-08T03:11:59.057-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">EBooks</category><title>The Java Tutorial Continued</title><description>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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BCeIduY-aKz3NklvBZuD50K_cIE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BCeIduY-aKz3NklvBZuD50K_cIE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BCeIduY-aKz3NklvBZuD50K_cIE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BCeIduY-aKz3NklvBZuD50K_cIE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=2wQDzT-ScLc:knJPkz6mK7s:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=2wQDzT-ScLc:knJPkz6mK7s:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=2wQDzT-ScLc:knJPkz6mK7s:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=2wQDzT-ScLc:knJPkz6mK7s:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=2wQDzT-ScLc:knJPkz6mK7s:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=2wQDzT-ScLc:knJPkz6mK7s:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=2wQDzT-ScLc:knJPkz6mK7s:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/2wQDzT-ScLc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/2wQDzT-ScLc/java-tutorial-continued.html</link><author>noreply@blogger.com (Deepun)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.interviewjava.com/2009/09/java-tutorial-continued.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-8464603197759124022</guid><pubDate>Tue, 08 Sep 2009 10:09:00 +0000</pubDate><atom:updated>2009-09-08T03:10:44.502-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">EBooks</category><title>Introduction To Programming Using Java</title><description>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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/U_BYvGaO25sfPTJvGiAZmtc_60g/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/U_BYvGaO25sfPTJvGiAZmtc_60g/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/U_BYvGaO25sfPTJvGiAZmtc_60g/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/U_BYvGaO25sfPTJvGiAZmtc_60g/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=MdC5hBiK1Do:PeQBJXZUCaA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=MdC5hBiK1Do:PeQBJXZUCaA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=MdC5hBiK1Do:PeQBJXZUCaA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=MdC5hBiK1Do:PeQBJXZUCaA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=MdC5hBiK1Do:PeQBJXZUCaA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=MdC5hBiK1Do:PeQBJXZUCaA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=MdC5hBiK1Do:PeQBJXZUCaA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/MdC5hBiK1Do" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/MdC5hBiK1Do/introduction-to-programming-using-java.html</link><author>noreply@blogger.com (Deepun)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.interviewjava.com/2009/09/introduction-to-programming-using-java.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-3900063264554050041</guid><pubDate>Tue, 08 Sep 2009 10:06:00 +0000</pubDate><atom:updated>2009-09-08T03:09:12.655-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">EBooks</category><title>A Java GUI Programmer's Primer</title><description>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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/uJxIxLutAb6fYC8cGdobfwLau2c/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uJxIxLutAb6fYC8cGdobfwLau2c/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/uJxIxLutAb6fYC8cGdobfwLau2c/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uJxIxLutAb6fYC8cGdobfwLau2c/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=aAznW6f5KfQ:Nq_yiESExx4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=aAznW6f5KfQ:Nq_yiESExx4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=aAznW6f5KfQ:Nq_yiESExx4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=aAznW6f5KfQ:Nq_yiESExx4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=aAznW6f5KfQ:Nq_yiESExx4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=aAznW6f5KfQ:Nq_yiESExx4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=aAznW6f5KfQ:Nq_yiESExx4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/aAznW6f5KfQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/aAznW6f5KfQ/java-gui-programmers-primer.html</link><author>noreply@blogger.com (Deepun)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.interviewjava.com/2009/09/java-gui-programmers-primer.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7300550709382233175.post-2051891342036696901</guid><pubDate>Tue, 08 Sep 2009 10:05:00 +0000</pubDate><atom:updated>2009-09-08T03:06:03.043-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">EBooks</category><title>The Java Swing Tutorial</title><description>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'/&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Om74GlBz8OeWNQG1F-wXFmjIOW8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Om74GlBz8OeWNQG1F-wXFmjIOW8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Om74GlBz8OeWNQG1F-wXFmjIOW8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Om74GlBz8OeWNQG1F-wXFmjIOW8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=vxsgCBSa4dg:nuCp0luIvRM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=vxsgCBSa4dg:nuCp0luIvRM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=vxsgCBSa4dg:nuCp0luIvRM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=vxsgCBSa4dg:nuCp0luIvRM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=vxsgCBSa4dg:nuCp0luIvRM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/iqjava?a=vxsgCBSa4dg:nuCp0luIvRM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/iqjava?i=vxsgCBSa4dg:nuCp0luIvRM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/iqjava/~4/vxsgCBSa4dg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/iqjava/~3/vxsgCBSa4dg/java-swing-tutorial.html</link><author>noreply@blogger.com (Deepun)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://www.interviewjava.com/2009/09/java-swing-tutorial.html</feedburner:origLink></item></channel></rss>
