tag:blogger.com,1999:blog-30586299313367992942024-03-28T14:54:38.443+05:30Make Code EasyThis blog solve the issues comes in daily programming practice.This blog also created for the users who want to brush up their knowledge before Interviews.rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.comBlogger46125tag:blogger.com,1999:blog-3058629931336799294.post-15984528487650850792014-07-08T22:20:00.001+05:302014-07-08T22:20:51.693+05:30Caused by: java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;">Exception :- </span><br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>Caused by: java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource
</code></pre>
<span style="font-size: large;"><br />First ensure that you have included <b><span style="color: #4c1130;">commons-collections</span></b> and <b><span style="color: #4c1130;">commons-dbcp</span></b> jar in classpath. Click here to download </span><span style="font-size: large;"><span style="font-size: large;"><a href="http://central.maven.org/maven2/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar"><b><span style="color: #4c1130;">commons-collections</span></b></a> and <a href="http://central.maven.org/maven2/commons-dbcp/commons-dbcp/1.4/commons-dbcp-1.4.jar"><b><span style="color: #4c1130;">commons-dbcp</span></b></a> jar</span> <br /><br />If you are using maven then add following dependency in pom.xml </span><br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code><dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
</code></pre>
<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code><dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
</code></pre>
</div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com26tag:blogger.com,1999:blog-3058629931336799294.post-29024918291539865132014-07-08T22:05:00.000+05:302014-07-08T22:09:10.044+05:30org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;">Exception :-
</span><br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/demo-servlet.xml]; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReade
</code></pre>
<br />
<span style="font-size: large;">First ensure that you have included <b><span style="color: #4c1130;">aopalliance </span></b>jar in classpath. Click here to download <a href="http://central.maven.org/maven2/aopalliance/aopalliance/1.0/aopalliance-1.0.jar">aopalliance-1.0.jar </a></span><br />
<br />
<span style="font-size: large;">If you are using maven then add following dependency in pom.xml</span><br />
<span style="font-size: large;"> </span>
<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code><dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
</dependency>
</code></pre>
</div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com6tag:blogger.com,1999:blog-3058629931336799294.post-85852788372324137582014-07-04T22:21:00.001+05:302014-07-04T22:35:03.722+05:30java.lang.ClassNotFoundException: javassist.util.proxy.MethodFilter<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;"><b>Exception :- </b></span><br />
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"><code>Caused by: java.lang.ClassNotFoundException: javassist.util.proxy.MethodFilter
Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
</code></pre>
<br />
<span style="font-size: large;">First ensure that you have included <span style="color: #20124d;"><b>javassist </b></span>jar in classpath.
Click here to download <a href="http://central.maven.org/maven2/javassist/javassist/3.12.1.GA/javassist-3.12.1.GA.jar">javassist</a> jar </span><br />
<br />
<span style="font-size: large;">If you are using maven then add following dependency in pom.xml</span><br />
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"><code><dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.12.1.GA</version>
</dependency>
</code></pre>
<span style="font-size: large;"> </span></div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com0tag:blogger.com,1999:blog-3058629931336799294.post-25340708646215202592014-07-03T22:29:00.001+05:302014-07-04T22:37:35.677+05:30java.lang.NoClassDefFoundError: Lorg/apache/commons/logging/Log<div dir="ltr" style="text-align: left;" trbidi="on">
<div id="stcpDiv" style="left: -1988px; position: absolute; top: -1999px;">
<span style="font-size: large;">Please ensure that you have included <span style="color: #20124d;"><b>standred.jar</b></span> in classpath.</span>
<span style="font-size: large;">Click here to download <a href="http://central.maven.org/maven2/taglibs/standard/1.1.2/standard-1.1.2.jar"><span style="color: #20124d;"><b>standred.jar</b></span></a> - See more at: http://makecodeeasy.blogspot.in/2014/07/javautilconcurrentexecutionexception.html#sthash.0Um7PGLr.dpuf</span></div>
<span style="font-size: large;"><b><span style="color: #4c1130;">Exception </span></b>:- <b><span style="color: #4c1130;">java.lang.NoClassDefFoundError: Lorg/apache/commons/logging/Log </span></b></span><br />
<br />
<span style="font-size: large;">First ensure that you have included commons-logging-xxx.jar in classpath.<br />Click here to download </span><span style="color: #38761d; font-size: large;"><a href="http://commons.apache.org/proper/commons-logging/download_logging.cgi">commons-logging-xxx.jar</a></span><br />
<br />
<span style="color: #38761d; font-size: large;"><span style="color: black;">If you are using maven then add following dependency in pom.xml</span></span><br />
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"><code><dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
</code></pre>
<span style="color: #38761d; font-size: large;"><span style="color: black;">The Commons Logging provides a Log interface that is intended to be both light-weight and an independent abstraction of other logging toolkits. It provides the middleware/tooling developer with a simple logging abstraction, that allows the user (application developer) to plug in a specific logging implementation.</span> </span></div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com319tag:blogger.com,1999:blog-3058629931336799294.post-15226107386068330032014-07-03T22:01:00.002+05:302014-07-04T22:41:37.612+05:30java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;"><span style="color: #4c1130;"><b>Exception :- java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina] </b></span></span><br />
<br />
<span style="font-size: large;">Please ensure that you have included <span style="color: #20124d;"><b>standred.jar</b></span> in classpath.</span><br />
<span style="font-size: large;">Click here to download </span><a href="http://central.maven.org/maven2/taglibs/standard/1.1.2/standard-1.1.2.jar"><span style="font-size: large;"><span style="color: #20124d;"><b>standred.jar</b></span></span></a><br />
<br />
<span style="font-size: large;"><span style="color: #20124d;"><b>If you are using maven then add following dependency in pom.xml </b></span></span><br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir9VDus0bQzts1Hu90gZQulLa1v3J_pTfuIEoiSrFCCYy7MJNTNE2_-vhLu78-lGaCUnPQ50ctVbP2jl1eBn1o9JKL0Dxm7md7uzEd88q7yC0VGemtvJ1GPOocZ8YHx2OM6c0rMopuPum9/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> <dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
</code></pre>
<br />
<b style="-webkit-text-stroke-width: 0px; background-color: white; color: #3c3c3c; font-family: Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 21px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">standard.jar</b><span style="-webkit-text-stroke-width: 0px; background-color: white; color: #3c3c3c; display: inline !important; float: none; font-family: Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 21px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;"><span class="Apple-converted-space"> </span>(taglib) library is used to enable the JSTL expression language in JSP page, and it’s always used together with the<span class="Apple-converted-space"> </span></span><b style="-webkit-text-stroke-width: 0px; background-color: white; color: #3c3c3c; font-family: Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 21px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">jstl.jar</b><span style="-webkit-text-stroke-width: 0px; background-color: white; color: #3c3c3c; display: inline !important; float: none; font-family: Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 21px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;"><span class="Apple-converted-space"> </span>together.</span><br />
<span style="-webkit-text-stroke-width: 0px; background-color: white; color: #3c3c3c; display: inline !important; float: none; font-family: Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 21px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;"> </span>
<br />
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"><code> <dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
</code></pre>
</div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com0tag:blogger.com,1999:blog-3058629931336799294.post-23122498071879220352014-06-28T11:34:00.001+05:302014-07-04T22:14:35.203+05:30Drag and Drop using jQuery JavaScript in HTML<div dir="ltr" style="text-align: left;" trbidi="on">
Using jQuery you can create simple Drag & Drop features easily and manage them well. jQuery UI provides with a vast suite of APIs that can create a UI with Drag Drop functionality.<br />
Steps :-<br />
<b><br /></b>
<b>1. Create a HTML file which includes css, jquery & javascript libraries .</b><br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>Drag and drop</title>
<LINK REL=StyleSheet HREF="css/makecodeeasy.css" TYPE="text/css">
<link rel="stylesheet"
href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
</head>
<body>
<div>
<fieldset id="shop" class="draggableContainer">
<legend>Draggable component</legend>
<img class="component" id="1" src="image/1.jpg">
<img class="component" id="2" src="image/2.jpg">
<img class="component" id="3" src="image/3.jpg">
<img class="component" id="4" src="image/4.jpg">
</fieldset>
</div>
<div>
<fieldset>
<legend>dropZone</legend>
<div class="dropZone" id="dropZone"></div>
</fieldset>
</div>
<script src="js/makecodeeasy.js"></script>
</body>
</html>
</code></pre>
<br />
<b>2. Create Javascript file (makecodeeasy.js)</b><br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>var dropArea = document.querySelector('#dropZone');
var conponents = document.querySelectorAll('.component');
for ( var i = 0; i < conponents.length; i++) {
conponents[i].setAttribute('draggable', 'true');
conponents[i].addEventListener('dragstart', function(evnt) {
evnt.dataTransfer.effectAllowed = 'copy';
evnt.dataTransfer.setData('text', this.id);
return false;
}, false);
}
dropArea.addEventListener('dragover', function(evnt) {
if (evnt.preventDefault)
evnt.preventDefault();
evnt.dataTransfer.dropEffect = 'copy';
return false;
}, false);
dropArea.addEventListener('drop', function(evnt) {
if (evnt.stopPropagation)
evnt.stopPropagation();
var id = evnt.dataTransfer.getData('text');
var theitem = document.getElementById(id);
if (theitem == null) {
evnt.preventDefault();
return;
}
var y = document.createElement('img');
y.src = theitem.src;
dropArea.appendChild(y);
evnt.preventDefault(); // for Firefox
return false;
}, false);
</code></pre>
<br />
<b>3. Create css file (makecodeeasy.css) </b><br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>body {
padding: 40px;
}
.draggableContainer {
border-radius: 6px;
}
.component {
border: 3px solid white;
}
.component:hover {
border: 3px solid red;
cursor: move;
}
#dropArea {
position: relative;
height: 200px;
width: 100%;
float: left;
border: 1px dotted #999;
}
.dropZone {
width:100%;
height:100px
}
</code></pre>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJqD6hTX0vlVlHI8bWhqnU7eHv8cyTR0UVPz1kaqlh_qsH3O6CwO38H2b9_ZiS8eerZp0nLso7OpMBg0sa4eRwLCTet9w8cAhaNIjeLE6w6WKivxJSQVLEYpYAqTwZajQ0625V6hKlDtDu/s1600/drag&drop.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJqD6hTX0vlVlHI8bWhqnU7eHv8cyTR0UVPz1kaqlh_qsH3O6CwO38H2b9_ZiS8eerZp0nLso7OpMBg0sa4eRwLCTet9w8cAhaNIjeLE6w6WKivxJSQVLEYpYAqTwZajQ0625V6hKlDtDu/s1600/drag&drop.png" height="75" width="400" /></a></div>
<b><br /></b>
<b>4. Demo </b><br />
<link href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" rel="stylesheet"></link>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<style>
.draggableContainer {
border-radius: 6px;
}
.component {
border: 3px solid white;
}
.component:hover {
border: 3px solid red;
cursor: move;
}
#dropArea {
position: relative;
height: 200px;
width: 100%;
float: left;
border: 1px dotted #999;
}
.dropZone {
width:100%;
min-height:100px;
height:auto;
}
</style>
<br />
<div>
<fieldset class="draggableContainer" id="shop">
<legend>Draggable component</legend>
<img class="component" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFiX4nWiB_Wvk2ECLjjcVzcAsAA9DX3l3oX53nFFiJf3QPXrHMzQzVVfLJT-9pB5bbeQGftUw6yCvLqEIXQl6aw4VPb5lbbjYFO0aFWju7vMPV5LtAm2Tlbsa6NnuxR94xEnb5G0VNfwbt/s1600/button.jpg" id="1" /> <img class="component" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFiX4nWiB_Wvk2ECLjjcVzcAsAA9DX3l3oX53nFFiJf3QPXrHMzQzVVfLJT-9pB5bbeQGftUw6yCvLqEIXQl6aw4VPb5lbbjYFO0aFWju7vMPV5LtAm2Tlbsa6NnuxR94xEnb5G0VNfwbt/s1600/button.jpg" id="2" /> <img class="component" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFiX4nWiB_Wvk2ECLjjcVzcAsAA9DX3l3oX53nFFiJf3QPXrHMzQzVVfLJT-9pB5bbeQGftUw6yCvLqEIXQl6aw4VPb5lbbjYFO0aFWju7vMPV5LtAm2Tlbsa6NnuxR94xEnb5G0VNfwbt/s1600/button.jpg" id="3" /> <img class="component" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFiX4nWiB_Wvk2ECLjjcVzcAsAA9DX3l3oX53nFFiJf3QPXrHMzQzVVfLJT-9pB5bbeQGftUw6yCvLqEIXQl6aw4VPb5lbbjYFO0aFWju7vMPV5LtAm2Tlbsa6NnuxR94xEnb5G0VNfwbt/s1600/button.jpg" id="4" />
</fieldset>
</div>
<div>
<fieldset>
<legend>dropZone</legend>
<br />
<div class="dropZone" id="dropZone">
</div>
</fieldset>
</div>
<script>
var dropArea = document.querySelector('#dropZone');
var conponents = document.querySelectorAll('.component');
for ( var i = 0; i < conponents.length; i++) {
conponents[i].setAttribute('draggable', 'true');
conponents[i].addEventListener('dragstart', function(evnt) {
evnt.dataTransfer.effectAllowed = 'copy';
evnt.dataTransfer.setData('text', this.id);
return false;
}, false);
}
dropArea.addEventListener('dragover', function(evnt) {
if (evnt.preventDefault)
evnt.preventDefault();
evnt.dataTransfer.dropEffect = 'copy';
return false;
}, false);
dropArea.addEventListener('drop', function(evnt) {
if (evnt.stopPropagation)
evnt.stopPropagation();
var id = evnt.dataTransfer.getData('text');
var theitem = document.getElementById(id);
if (theitem == null) {
evnt.preventDefault();
return;
}
var y = document.createElement('img');
y.src = theitem.src;
dropArea.appendChild(y);
evnt.preventDefault(); // for Firefox
return false;
}, false);
</script>
5.<b> Try the code & Enjoy :) </b><br />
<b> jsfiddle link :- </b><a href="http://jsfiddle.net/zBhD7/" target="_blank">http://jsfiddle.net/zBhD7/</a>
</div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com4tag:blogger.com,1999:blog-3058629931336799294.post-26527770542767873252013-10-05T17:46:00.000+05:302013-10-05T17:49:09.804+05:30Amazing Light - Beautiful piece of art<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3pdJx5ZUaHpdaY3ktY-wpTsDuEPbRcXvC0JY5sSK97bNspVEuLrHA9n75H0ZzizwSFrNhxxc6dDS0VpsIF7TgOh0BJ5GM7elNON_5h9M6V8mHJmkesq22_MYZ13VP1yQs8tk0jgA9Svoj/s1600/Art.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3pdJx5ZUaHpdaY3ktY-wpTsDuEPbRcXvC0JY5sSK97bNspVEuLrHA9n75H0ZzizwSFrNhxxc6dDS0VpsIF7TgOh0BJ5GM7elNON_5h9M6V8mHJmkesq22_MYZ13VP1yQs8tk0jgA9Svoj/s1600/Art.jpg" /></a></div>
<br /></div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com1tag:blogger.com,1999:blog-3058629931336799294.post-10819116922383606572013-10-05T11:37:00.001+05:302013-10-05T11:37:06.117+05:30Brick laying machine<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWSZW5tk5gSlSuWgndwahRtViFrOI6f6ohIrxNhue5I5Kc6oVBXV9beghbDl236JWOvUhNnP3bDTW9nmJvU8fp0XiqzcMOeiyYIs2BDUfr2uoWqfLKd5AlcI9wk3piGCH0JbNyp_K5cAx2/s1600/brick-laying-machine.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWSZW5tk5gSlSuWgndwahRtViFrOI6f6ohIrxNhue5I5Kc6oVBXV9beghbDl236JWOvUhNnP3bDTW9nmJvU8fp0XiqzcMOeiyYIs2BDUfr2uoWqfLKd5AlcI9wk3piGCH0JbNyp_K5cAx2/s1600/brick-laying-machine.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-size: large;"><span style="color: #20124d;">Tiger-Stone, the amazing machine can create an instant road wherever it
travels, laying out bricks in formation to create perfect paving. Its
secret lies in a smartly designed gravity-based system. </span></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtQPiPmfjOA2U0ABF7YxUVwvyk0kwCVa8sum97TOUWiVzvwTD7ZiQBeF2yRVADEnRPkVbuABA0HTTthi7RNMYzO5f9naaod1zbdiyllJlpd2nJDZ6VKWayHjvGbZv66YBoNJQLTNpv_wgn/s1600/Tiger-stone.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtQPiPmfjOA2U0ABF7YxUVwvyk0kwCVa8sum97TOUWiVzvwTD7ZiQBeF2yRVADEnRPkVbuABA0HTTthi7RNMYzO5f9naaod1zbdiyllJlpd2nJDZ6VKWayHjvGbZv66YBoNJQLTNpv_wgn/s1600/Tiger-stone.jpg" /></a></div>
<br /></div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com0tag:blogger.com,1999:blog-3058629931336799294.post-49248678548454476062013-10-05T11:00:00.001+05:302013-10-05T11:00:14.595+05:30Virtual wall concept to protect pedestrians<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_n-C8WzOGvZ942YRljzf3TcQG-QdDwm1ccAqzLGRs1VW0ZDcLXbs7eeY3INDj8Z-RKjrkqx2kIYJOrK2dPJxiJJ-xKIq_QlurQ4UcMof-Mzsj2qkXC9OeEOZxdyRDjAQAEAv8bPNC9hHX/s1600/Virtual-Wall.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_n-C8WzOGvZ942YRljzf3TcQG-QdDwm1ccAqzLGRs1VW0ZDcLXbs7eeY3INDj8Z-RKjrkqx2kIYJOrK2dPJxiJJ-xKIq_QlurQ4UcMof-Mzsj2qkXC9OeEOZxdyRDjAQAEAv8bPNC9hHX/s400/Virtual-Wall.jpg" width="400" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<span style="color: #20124d;">Pedestrian/motor vehicle crashes are a serious problem throughout the world and the India has a particular problem with pedestrian deaths and injuries.<br />Almost two-thirds of the 1.2 million people killed annually in road traffic crashes worldwide are pedestrians.</span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTBrw63MVIumy93O-o6H7oxO91HUiAVsNQQ49jbcK4jgTUnt1s0ZSCdQCW09LhftyRUcbsdqHqfU0PsVOBJSaSm9Ujgpw3u6vtJObHAe44jncJnXOCOKkfsceaeh7njrNIpCLuOPHzFNJg/s1600/PedCrashSequence.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="127" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTBrw63MVIumy93O-o6H7oxO91HUiAVsNQQ49jbcK4jgTUnt1s0ZSCdQCW09LhftyRUcbsdqHqfU0PsVOBJSaSm9Ujgpw3u6vtJObHAe44jncJnXOCOKkfsceaeh7njrNIpCLuOPHzFNJg/s400/PedCrashSequence.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="-webkit-text-stroke-width: 0px; background-color: #f9f9f9; color: black; display: inline !important; float: none; font-family: sans-serif; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 15.828125px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">The sequence of events in a car-pedestrian accident</span> </td></tr>
</tbody></table>
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtE4O1W0tUS_RFo6TBgtIc9-eKPkTcDtVdzV_98dl7CAiX1VQx4DXh6XQ2WJr-Ra7TkzX2ph0zBuIKFI_IAU5wD5SUmW30aFU2TPsCqKySEGzWo4L2Z5Jef7LzxN2H56coeKdWUPi7lk81/s1600/large_virtual_wall.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="264" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtE4O1W0tUS_RFo6TBgtIc9-eKPkTcDtVdzV_98dl7CAiX1VQx4DXh6XQ2WJr-Ra7TkzX2ph0zBuIKFI_IAU5wD5SUmW30aFU2TPsCqKySEGzWo4L2Z5Jef7LzxN2H56coeKdWUPi7lk81/s320/large_virtual_wall.jpg" width="320" /></a><span style="color: #20124d;">Traffic accidents are among the major causes of death in India. Every year increased the pedestrian accidents at pedestrian crossing zone. And I thought that crossing zone is sharing space between pedestrian and driver. But drivers are never care which pedestrian’ safety in the real world. Even drivers are sometimes switching to pedestrian. And nowadays, urban sites got the problem that disturbance of traffic signal. We are surrounded such a crazy commercials and crowd environment near the road space. <br /><br /><br />That’s a one of reason that many drivers losing attention and difficulty of awareness into traffic signal. And, I’d like to make wall up on the car’ stop line at the moment. Virtual Wall, It’s really effective in driver awareness. Because Virtual Wall can get bigger image and better look.</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbFLnF8Pq5XHpHiE3A3Wp2iIQ6c2W1SwaedMCkKjYegFfkFwGkYnDVfXJdRNKv8SDPbBUT-0mc93fq-A5RLUIwy8mf_nxmptXH74vxjkwWcyaWQrHI5vhO2OoK6NGd74udABJ-M5JZlhS_/s1600/virtual+wall+1.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbFLnF8Pq5XHpHiE3A3Wp2iIQ6c2W1SwaedMCkKjYegFfkFwGkYnDVfXJdRNKv8SDPbBUT-0mc93fq-A5RLUIwy8mf_nxmptXH74vxjkwWcyaWQrHI5vhO2OoK6NGd74udABJ-M5JZlhS_/s1600/virtual+wall+1.jpg" /></a></div>
<span style="color: #20124d;">the inventor of this concept is Hanyoung Lee, got awarded for this creation work. this can be implemented in all zones for a better safety of pedestrians the concept work like this : at the junctions some two poles are fixed and when the pedestrians crossing the road these poles produces some rays which are visible to naked eye looks like a wall infront of them so this will gives more safety for the pedestrians.</span></div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com1tag:blogger.com,1999:blog-3058629931336799294.post-59618851489088238112013-09-21T15:44:00.000+05:302013-09-21T15:45:07.934+05:30An Engineering Student<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6OOe7mvB8rMD1AB1nlIFy08GtKIQOcm9oKE8tIfj9jzukZ-EnptJCbUNVhvjs77oh5gjTTrmqTOAyR_h_7J5EewAfa9nuViQfMHTFQJzJWIhe-UJZYyApeUJ3-0D-NDm4ctzhImal1MZk/s1600/An+Engineering+Student.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="282" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6OOe7mvB8rMD1AB1nlIFy08GtKIQOcm9oKE8tIfj9jzukZ-EnptJCbUNVhvjs77oh5gjTTrmqTOAyR_h_7J5EewAfa9nuViQfMHTFQJzJWIhe-UJZYyApeUJ3-0D-NDm4ctzhImal1MZk/s400/An+Engineering+Student.jpg" width="400" /></a></div>
<br /></div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com0tag:blogger.com,1999:blog-3058629931336799294.post-44962877590475913032013-09-21T15:34:00.000+05:302013-09-21T15:36:12.365+05:30Resume tips!<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRmMWll8VWh7LaJWFZ1C6s1ah6H9CtmOOg_7eHnahfJ7FLPqc8SndPdgkXI763Ttu-5_SaeHqEm5WN-gtrpuU7-kPPpK2qYRWIT02CnVkNhEmU7P9xyC7VByvkIMuBaHAjDcjpgknQt0HM/s1600/CV.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRmMWll8VWh7LaJWFZ1C6s1ah6H9CtmOOg_7eHnahfJ7FLPqc8SndPdgkXI763Ttu-5_SaeHqEm5WN-gtrpuU7-kPPpK2qYRWIT02CnVkNhEmU7P9xyC7VByvkIMuBaHAjDcjpgknQt0HM/s640/CV.jpg" width="464" /></a></div>
<br /></div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com1tag:blogger.com,1999:blog-3058629931336799294.post-43706485113593848582013-09-15T17:07:00.001+05:302013-09-15T17:07:43.487+05:30Android in alphabetic order<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: center;">
<b><span class="fbPhotosPhotoCaption" data-ft="{"type":45,"tn":"*G"}" id="fbPhotoSnowliftCaption" tabindex="0"><span class="hasCaption">Android in alphabetic order.. c, d, e, f, g, h, i, j and next k</span></span></b></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxrKILoMhrhtFKlTVef7TuKIo49HW1hyphenhyphenON3U44c07cqkHUoHFbvtfEZxW62A0MDZVxwqPdnKPz2dCegDAN6VsfIeRQw19GKRj3H_jFSGlXOyWhbaBQx0YcPCyc6szm_V6wnRPjMVVsQtVO/s1600/Android.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="328" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxrKILoMhrhtFKlTVef7TuKIo49HW1hyphenhyphenON3U44c07cqkHUoHFbvtfEZxW62A0MDZVxwqPdnKPz2dCegDAN6VsfIeRQw19GKRj3H_jFSGlXOyWhbaBQx0YcPCyc6szm_V6wnRPjMVVsQtVO/s400/Android.jpg" width="400" /></a></div>
</div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com5tag:blogger.com,1999:blog-3058629931336799294.post-39579120665743947912013-09-15T16:56:00.000+05:302013-09-15T16:56:30.656+05:30Our Education System<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhGjcalVCOkJoD_6zNJRe4jdwJvtoPoTvpwvZ5koFA-cKohu4X2hOrf3fnH9aPSginBox7dQo55YjYGPecEzNJR_88Y2yMpTwxlq_97nU_LI428vFlqU3WAN7y3EDodz_y9AD2GmiSbzgA/s1600/Education+System.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhGjcalVCOkJoD_6zNJRe4jdwJvtoPoTvpwvZ5koFA-cKohu4X2hOrf3fnH9aPSginBox7dQo55YjYGPecEzNJR_88Y2yMpTwxlq_97nU_LI428vFlqU3WAN7y3EDodz_y9AD2GmiSbzgA/s400/Education+System.jpg" width="372" /></a></div>
<br /></div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com0tag:blogger.com,1999:blog-3058629931336799294.post-61595762906285075242013-09-15T16:01:00.001+05:302013-09-15T16:01:06.272+05:30Evolution of Mac and Steve jobs<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqgbla2O0YHmAEdx2UuiQtZvlMxiMWKXK-10qBBN7s6CzqJKGxByjCOd5rxjrTDkPNil_8GZxg5IbymCnip5V4CJD0NrghdjBRsOtU9uK8kBD1h8T_def4YSoF9FV1vGbFfCoT4vwrBUDv/s1600/Evolution+of+MAC.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="224" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqgbla2O0YHmAEdx2UuiQtZvlMxiMWKXK-10qBBN7s6CzqJKGxByjCOd5rxjrTDkPNil_8GZxg5IbymCnip5V4CJD0NrghdjBRsOtU9uK8kBD1h8T_def4YSoF9FV1vGbFfCoT4vwrBUDv/s400/Evolution+of+MAC.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3h5HQQSYhugODuGX_HiCXNPunrGFbBQoGhtogXiefDKQ3SvRDY-4SaQOyKuWh2rBZJTP3CXmySzH8_KpCKj4EjclY9GzYGp2gcu0WSxscxL8D7wDUHI3A1JMa8-LBkuXkJpLXTwLVsdII/s1600/evolution_of_steve_jobs.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3h5HQQSYhugODuGX_HiCXNPunrGFbBQoGhtogXiefDKQ3SvRDY-4SaQOyKuWh2rBZJTP3CXmySzH8_KpCKj4EjclY9GzYGp2gcu0WSxscxL8D7wDUHI3A1JMa8-LBkuXkJpLXTwLVsdII/s1600/evolution_of_steve_jobs.jpg" /></a></div>
<br /></div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com0tag:blogger.com,1999:blog-3058629931336799294.post-28088722340628777252013-09-14T18:54:00.001+05:302013-09-14T18:54:30.459+05:30Programming tools<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-vDNrEsj7Uk8VPGV9htov4Waes_HliJlBu_Bo4Nxsa-SY0G9BQHwAhf-2KHESCqXmfZT8cI8mkt1_DxBOo4xaQHtdQ5Qxf6-zdu-0rr5seO-AIo7R35FN1g2ti5a_w86G8CwSMgVm2xVE/s1600/programming+tools.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-vDNrEsj7Uk8VPGV9htov4Waes_HliJlBu_Bo4Nxsa-SY0G9BQHwAhf-2KHESCqXmfZT8cI8mkt1_DxBOo4xaQHtdQ5Qxf6-zdu-0rr5seO-AIo7R35FN1g2ti5a_w86G8CwSMgVm2xVE/s640/programming+tools.jpg" width="429" /></a></div>
<br /></div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com0tag:blogger.com,1999:blog-3058629931336799294.post-30430821652708408262013-09-14T18:44:00.001+05:302013-09-14T18:45:17.784+05:30How to charge any device from Lemon<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<b>Step 1 :-</b><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRkoxZCmTjy7ORUI4eN9e82_rTza_4Th1wP70wI9vFVjz1jHAUQ1uhU37ozMhtkEnoDbTc-6PR-htBakBfalXzEl30bRhzYslscjW4h0nv42LoRFumrNExuXedBJT-_adKGLs-bRuzGgvZ/s1600/0.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRkoxZCmTjy7ORUI4eN9e82_rTza_4Th1wP70wI9vFVjz1jHAUQ1uhU37ozMhtkEnoDbTc-6PR-htBakBfalXzEl30bRhzYslscjW4h0nv42LoRFumrNExuXedBJT-_adKGLs-bRuzGgvZ/s1600/0.jpg" /></a></div>
<br />
<br />
<br />
<br />
<br />
<b>Step 2:- </b><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiby9RyCEYj-NMkozrnWwfar68f91zFmHvsJJyu85q4LvAg5ZUSMV4BX2XBV-OCioDg4m9etDrIYXDZTyM8z7Ac68d2JB0ZXbsFL-V-rpGmv76YDbvt8QOWjaKORU042Dbqb8nhqJ2dsfa5/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiby9RyCEYj-NMkozrnWwfar68f91zFmHvsJJyu85q4LvAg5ZUSMV4BX2XBV-OCioDg4m9etDrIYXDZTyM8z7Ac68d2JB0ZXbsFL-V-rpGmv76YDbvt8QOWjaKORU042Dbqb8nhqJ2dsfa5/s1600/1.jpg" /></a></div>
<br />
<br />
<b>Step 3:-</b><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoY9Mc1dK3UwHOthTG6hD0nbVOJJq7BRg52RxtVix5FARKhVMeKyLft7nirysXryrq6SIh_ky_JWuITYmoARMmQO9ElwGYXHz7_-4jc1PtT5ZIRRPD82CC2JhMN8vRMOyDbKUA_cUYB3mY/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="164" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoY9Mc1dK3UwHOthTG6hD0nbVOJJq7BRg52RxtVix5FARKhVMeKyLft7nirysXryrq6SIh_ky_JWuITYmoARMmQO9ElwGYXHz7_-4jc1PtT5ZIRRPD82CC2JhMN8vRMOyDbKUA_cUYB3mY/s320/2.jpg" width="320" /></a></div>
<br />
<br />
<b>Step 4:- </b><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0f-Em3PWy4Fa0l-SUioXhAR0MO32Mza_sJQCKOFhC1dXrvbM__I4WGFH_hBaTsU3vmQJLQHbS8BxEFwc8aJgM__Lyo-V7A8eaVmw1LeW4KwN97MemHN_FT-N2zxYTDG3W5r2SiE_V2244/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0f-Em3PWy4Fa0l-SUioXhAR0MO32Mza_sJQCKOFhC1dXrvbM__I4WGFH_hBaTsU3vmQJLQHbS8BxEFwc8aJgM__Lyo-V7A8eaVmw1LeW4KwN97MemHN_FT-N2zxYTDG3W5r2SiE_V2244/s1600/3.jpg" /></a></div>
<br />
<br />
<b>Step 5:</b>-<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL1stQKzKNFQ7f1wjOQVgYyyZKGiDQ6enu4FWitt7FYPfp0IfNTlaEE1Vdn7hHRIH3FoiZnED6UWQuCY8O6fPfGFpt-CCBx2dtmK8Qn9tA-kOmDkyjuQG03mNx8pEbLp50XBKoIbyV49we/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL1stQKzKNFQ7f1wjOQVgYyyZKGiDQ6enu4FWitt7FYPfp0IfNTlaEE1Vdn7hHRIH3FoiZnED6UWQuCY8O6fPfGFpt-CCBx2dtmK8Qn9tA-kOmDkyjuQG03mNx8pEbLp50XBKoIbyV49we/s1600/4.jpg" /></a></div>
<br />
<br />
<b>Step 6:-</b><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwA18s98WgtpiO8_PmwNJN2zG4JZSjBnrpe6gxcW6iMaRYWoFbC4BY6r3CNnfVJdf2tASm0vBZgJ9hyphenhyphenU5tW5RqVZTQMlPl5JfiVLkAmkswBwwWF1e7HZy6vC4LF3CSJILjAzItr_zSBlBD/s1600/5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwA18s98WgtpiO8_PmwNJN2zG4JZSjBnrpe6gxcW6iMaRYWoFbC4BY6r3CNnfVJdf2tASm0vBZgJ9hyphenhyphenU5tW5RqVZTQMlPl5JfiVLkAmkswBwwWF1e7HZy6vC4LF3CSJILjAzItr_zSBlBD/s1600/5.jpg" /></a></div>
<br />
<br />
<b>Step 7:-</b><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4HjA_M6A6wqT9nowgSl9lL7plnfZ_IKNbBMrTfKH9acmkADbCCXjbHyzkhj12XBxub_mBOXcl8OlviPm17njPkhcbRPSMv6get_1H_iptTmCItSSCMX3L04HrzIHAlOVAJQimfsyDukme/s1600/6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4HjA_M6A6wqT9nowgSl9lL7plnfZ_IKNbBMrTfKH9acmkADbCCXjbHyzkhj12XBxub_mBOXcl8OlviPm17njPkhcbRPSMv6get_1H_iptTmCItSSCMX3L04HrzIHAlOVAJQimfsyDukme/s1600/6.jpg" /></a></div>
<br />
<br />
<b>Step 8:-</b><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuAuuW4HXA46VYmKhvaI7dHSSQt4W7gyZ6EiFTwVfNYs0h_-SuhExn7OmQbP02zG6T1SnFX1ncqwjZ2yVrG3moGRNZPhRL1w-RYa-V2QwpmOZZA0vWoxD_0w1uEPkTwZ77mPOC_dNztP7t/s1600/7.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuAuuW4HXA46VYmKhvaI7dHSSQt4W7gyZ6EiFTwVfNYs0h_-SuhExn7OmQbP02zG6T1SnFX1ncqwjZ2yVrG3moGRNZPhRL1w-RYa-V2QwpmOZZA0vWoxD_0w1uEPkTwZ77mPOC_dNztP7t/s320/7.jpg" width="320" /></a></div>
<br />
<br />
<b>Step 9:-</b><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQlPrG8unva2vTtZBd9wOByJeIrLpSOORe24AaocO2z4fE7Kusd6qJZkCGPaRJkoOrHvXiw2liw9I8ZnXgExDyUD8TkQc3PKa_M-0P5pgf1uV5aXzAsMhUVo2GZwUrQGvNF2yY_D6lLQCG/s1600/8.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQlPrG8unva2vTtZBd9wOByJeIrLpSOORe24AaocO2z4fE7Kusd6qJZkCGPaRJkoOrHvXiw2liw9I8ZnXgExDyUD8TkQc3PKa_M-0P5pgf1uV5aXzAsMhUVo2GZwUrQGvNF2yY_D6lLQCG/s1600/8.jpg" /></a></div>
<br />
<br />
<br />
<br />
<b>Video Understanding :- </b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/AY9qcDCFeVI?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br /></div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com0tag:blogger.com,1999:blog-3058629931336799294.post-66071561206219668312013-06-01T12:18:00.002+05:302013-06-01T12:20:30.469+05:30Two Datasource in Spring/Hiberate<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: small;">We can create two datasource in a single spring/hibernate application.</span><br />
<span style="font-size: small;"><br /></span>
<span style="font-size: small;">There are following steps required to implement this:-</span><br />
<span style="font-size: small;"><br /></span>
<span style="color: #351c75; font-size: small;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="background-color: white; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Create JNDI Datasource while using Tomcat :- </span></span></span><br />
<ol style="text-align: left;"><span style="font-size: small;">
</span>
<li><span style="color: #351c75; font-size: small;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="background-color: white; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Resource entry in <span style="color: #274e13;">server.xml </span></span></span></span><span style="color: #351c75; font-size: small;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="background-color: white; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">under <GlobalNamingResources> for both datasources<br />You can find server.xml in following path in Tomcat folder :-<br /> c://Tomcat/conf/server.xml</span></span></span></li>
<pre class="brush:java"><globalnamingresources>
<resource name="jdbc/first" driverclassname="com.microsoft.sqlserver.jdbc.SQLServerDriver" maxwait="5000" password="makecodeeasy" type="javax.sql.DataSource" url="jdbc:sqlserver://localhost:1433;DatabaseName=DataTest" username="makecodeeasy" validationquery="select 1">
</resource>
<resource name="jdbc/second" driverclassname="com.microsoft.sqlserver.jdbc.SQLServerDriver" maxwait="5000" password="123" type="javax.sql.DataSource" url="jdbc:sqlserver://192.182.21.66:1433;DatabaseName=Second" username="sa" validationquery="select 1">
</resource>
</globalnamingresources>
</pre>
Note :- Database used here in MS Sql server 2008. You can use any database.
You need to change driverClassname, url, username and password according to
database.
<li><span style="color: #351c75; font-size: small;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="background-color: white; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Do the entry in web.xml for both resources<br />You can find web.xml in WEB-INF folder of your application</span></span></span></li>
<pre class="brush:java"><resource-ref>
<description>DB Connection Pooling</description>
<res-ref-name>java:comp/env/jdbc/first</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-ref>
<description>DB Connection Pooling</description>
<res-ref-name>java:comp/env/jdbc/second</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
</pre>
<li><span style="color: #351c75; font-size: small;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="background-color: white; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Use datasource in applicationContext or spring context file</span></span></span></li>
<pre class="brush:java"><bean id="firstDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/first" />
<property name="resourceRef" value="true" />
</bean></pre>
<pre class="brush:java"><bean id="secondDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/second" />
<property name="resourceRef" value="true" />
</bean> </pre>
<li><span style="color: #351c75; font-size: small;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="background-color: white; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Create two session factory for using two datasource.</span></span></span><br /><pre class="brush:java"><bean id="firstSessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean" p:dataSource-ref="firstDataSource" p:configLocation="${hib.config}" p:packagesToScan="com.org.xyz.domain">
</bean></pre>
<pre class="brush:java"><bean id="secondSessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean" p:dataSource-ref="secondDataSource" p:configLocation="${hib.config}" p:packagesToScan="com.org.abc.domain">
</bean></pre>
<span style="color: #351c75; font-size: small;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="background-color: white; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br /></span></span></span></li>
<li><span style="color: #351c75; font-size: small;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="background-color: white; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Now these session factories can be used in Hibernate application.<br /> <span style="color: #274e13;"></span></span></span></span></li>
</ol>
</div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com0tag:blogger.com,1999:blog-3058629931336799294.post-59283820736808194372013-05-19T10:11:00.000+05:302013-05-19T10:40:12.593+05:30JNDI Datasource in spring<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: #351c75; font-size: small;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="color: #351c75;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="background-color: white; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">There are two sources of database connections - either a </span></span></span><span class="Apple-converted-space"> </span></span><tt style="background-color: #e6e6e6; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><a href="http://docs.oracle.com/javase/6/docs/api/javax/sql/DataSource.html">DataSource</a></tt><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class="Apple-converted-space"> </span></span></span><span style="color: #351c75; font-size: small;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class="Apple-converted-space"><span style="color: #351c75;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="background-color: white; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">or a </span></span></span></span><span class="Apple-converted-space"> </span></span><tt style="background-color: #e6e6e6; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><a href="http://docs.oracle.com/javase/6/docs/api/java/sql/DriverManager.html">DriverManager</a></tt><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">.</span></span><br />
<span style="font-size: small;"><br /></span>
<span style="color: #351c75; font-size: small;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><u><span style="color: #351c75;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="background-color: white; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">JNDI</span></span></span></u> </span></span><br />
<span style="color: #351c75; font-size: small;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="background-color: white; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">The Java Naming and Directory Interface (JNDI) is part of the Java platform, providing applications based on Java technology with a unified interface to multiple naming and directory services. You can build powerful and portable directory-enabled applications using this industry standard.</span></span></span><br />
<span style="font-size: small;"><br /></span>
<span style="color: #351c75; font-size: small;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="background-color: white; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Create JNDI Datasource while using Tomcat :- </span></span></span><br />
<ol style="text-align: left;"><span style="font-size: small;">
</span>
<li><span style="color: #351c75; font-size: small;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="background-color: white; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Resource entry in <span style="color: #274e13;">server.xml </span></span></span></span><span style="color: #351c75; font-size: small;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="background-color: white; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">under <GlobalNamingResources> <br />You can find server.xml in following path in Tomcat folder :-<br /> c://Tomcat/conf/server.xml</span></span></span></li>
<pre class="brush:java"><globalnamingresources>
<resource name="jdbc/test" driverclassname="com.microsoft.sqlserver.jdbc.SQLServerDriver" maxwait="5000" password="makecodeeasy" type="javax.sql.DataSource" url="jdbc:sqlserver://localhost:1433;DatabaseName=DataTest" username="makecodeeasy" validationquery="select 1">
</resource>
</globalnamingresources></pre>
Note :- Database used here in MS Sql server 2008. You can use any database.
You need to change driverClassname, url, username and password according to
database.
<li><span style="color: #351c75; font-size: small;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="background-color: white; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Do the entry in web.xml<br />You can find web.xml in WEB-INF folder of your application</span></span></span></li>
<pre class="brush:java"><resource-ref>
<description>DB Connection Pooling</description>
<res-ref-name>java:comp/env/jdbc/test</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
</pre>
<li><span style="color: #351c75; font-size: small;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="background-color: white; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Use datasource in applicationContext or spring context file</span></span></span></li>
<pre class="brush:java"><bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/test" />
<property name="resourceRef" value="true" />
</bean>
</pre>
<li><span style="color: #351c75; font-size: small;"><span style="background-color: #e6e6e6; display: inline ! important; float: none; font-family: Verdana,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="background-color: white; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Your Datasource is ready to use. It ca<span style="font-size: small;">n also be used in hibernate.</span><br /> <span style="color: #274e13;"></span></span></span></span></li>
</ol>
</div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com4tag:blogger.com,1999:blog-3058629931336799294.post-2806578735525368922013-05-18T21:40:00.000+05:302013-05-18T21:40:11.616+05:30Browser CSS Hacks<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75; font-family: Courier New; font-size: large;"><b><u>CSS Hacks</u></b></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';"><br /></span></i></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/***** Selector </span></i><i><span style="background-color: #ffffcc; font-family: 'Courier New';">Hacks</span></i><i><span style="font-family: 'Courier New';"> ******/</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* IE6 and below */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">*</span><span style="font-family: 'Courier New';"> html </span><span style="font-family: 'Courier New';">#mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">red</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* IE7 */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">*</span><span style="font-family: 'Courier New';">:first-child</span><span style="font-family: 'Courier New';">+</span><span style="font-family: 'Courier New';">html </span><span style="font-family: 'Courier New';">#dos</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">red</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"> <o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* IE7, FF, Saf,
Opera */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">html</span><span style="font-family: 'Courier New';">></span><span style="font-family: 'Courier New';">body </span><span style="font-family: 'Courier New';"># mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">red</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* IE8, FF, Saf, Opera
(Everything but IE 6,7) */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">html</span><span style="font-family: 'Courier New';">></span><i><span style="font-family: 'Courier New';">/**/</span></i><span style="font-family: 'Courier New';">body </span><span style="font-family: 'Courier New';"># mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">red</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* Opera 9.27 and below,
safari 2 */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">html</span><span style="font-family: 'Courier New';">:first-child </span><span style="font-family: 'Courier New';"># mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">red</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* Safari 2-3 */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">html</span><span style="font-family: 'Courier New';">[</span><span style="font-family: 'Courier New';">xmlns</span><span style="font-family: 'Courier New';">*=</span><span style="font-family: 'Courier New';">""</span><span style="font-family: 'Courier New';">]</span><span style="font-family: 'Courier New';"> body</span><span style="font-family: 'Courier New';">:last-child </span><span style="font-family: 'Courier New';">#seis</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">red</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* safari 3+, chrome 1+,
opera9+, ff 3.5+ */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">body</span><span style="font-family: 'Courier New';">:nth-of-</span><span style="font-family: 'Courier New';">type</span><span style="font-family: 'Courier New';">(</span><span style="font-family: 'Courier New';">1</span><span style="font-family: 'Courier New';">)</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">#mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">red</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* safari 3+, chrome 1+,
opera9+, ff 3.5+ */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">body</span><span style="font-family: 'Courier New';">:first-of-type </span><span style="font-family: 'Courier New';">#mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">red</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* saf3+, chrome1+ */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">@media screen and
(-webkit-min-device-pixel-ratio:0) {</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">#mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">red</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* iPhone / mobile webkit
*/</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">@media screen and
(max-device-width: 480px) {</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">#mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">red</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* Safari 2 - 3.1 */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">html</span><span style="font-family: 'Courier New';">[</span><span style="font-family: 'Courier New';">xmlns</span><span style="font-family: 'Courier New';">*=</span><span style="font-family: 'Courier New';">""</span><span style="font-family: 'Courier New';">]</span><span style="font-family: 'Courier New';">:root </span><span style="font-family: 'Courier New';">#mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">red</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* Safari 2 - 3.1, Opera
9.25 */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">*</span><span style="font-family: 'Courier New';">|html</span><span style="font-family: 'Courier New';">[</span><span style="font-family: 'Courier New';">xmlns</span><span style="font-family: 'Courier New';">*=</span><span style="font-family: 'Courier New';">""</span><span style="font-family: 'Courier New';">]</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">#mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">red</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* Everything but IE6-8
*/</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">:root </span><span style="font-family: 'Courier New';">*></span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">#mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">red</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* IE7 */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">*+</span><span style="font-family: 'Courier New';">html </span><span style="font-family: 'Courier New';">#mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">red</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* Firefox only. 1+ */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">#mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">,</span><span style="font-family: 'Courier New';"> x</span><span style="font-family: 'Courier New';">:-moz-any-link </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">red</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* Firefox 3.0+ */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">#mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">,</span><span style="font-family: 'Courier New';"> x</span><span style="font-family: 'Courier New';">:-moz-any-link</span><span style="font-family: 'Courier New';">,</span><span style="font-family: 'Courier New';"> x</span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';">default</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">red</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* FF 3.5+ */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">body</span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';">not</span><span style="font-family: 'Courier New';">(</span><span style="font-family: 'Courier New';">:-moz-handler-</span><span style="font-family: 'Courier New';">blocked</span><span style="font-family: 'Courier New';">)</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">#mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">red</span><span style="font-family: 'Courier New';">;</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/***** Attribute </span></i><i><span style="background-color: #ffffcc; font-family: 'Courier New';">Hacks</span></i><i><span style="font-family: 'Courier New';"> ******/</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* IE6 */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">#mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> _color</span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> <b>blue</b> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* IE6, IE7 */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">#mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">*</span><b><span style="font-family: 'Courier New';">color</span></b><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> <b>blue</b></span><span style="font-family: 'Courier New';">;</span><span style="font-family: 'Courier New';"> </span><i><span style="font-family: 'Courier New';">/* or #color: blue */</span></i><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* Everything but IE6 */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">#mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><i><span style="font-family: 'Courier New';">/**/</span></i><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> <b>blue</b> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* IE6, IE7, IE8 */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">#mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> <b>blue</b>\</span><span style="font-family: 'Courier New';">9</span><span style="font-family: 'Courier New';">;</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* IE7, IE8 */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">#mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><i><span style="font-family: 'Courier New';">/*\**/</span></i><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> <b>blue</b>\</span><span style="font-family: 'Courier New';">9</span><span style="font-family: 'Courier New';">;</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* IE6, IE7 -- acts as an
!important */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">#mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><span style="font-family: 'Courier New';"> <b>color</b></span><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> <b>blue</b> !ie</span><span style="font-family: 'Courier New';">;</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"> </span><i><span style="font-family: 'Courier New';">/* string after ! can be
anything */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';">/* IE8, IE9 */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><span style="font-family: 'Courier New';">#mydiv</span><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">{</span><b><span style="font-family: 'Courier New';">color</span></b><span style="font-family: 'Courier New';">:</span><span style="font-family: 'Courier New';"> <b>blue</b>\</span><span style="font-family: 'Courier New';">0</span><span style="font-family: 'Courier New';">/</span><span style="font-family: 'Courier New';">;}</span><span style="font-family: 'Courier New';"> </span><i><span style="font-family: 'Courier New';">/* must go at the END of all rules */</span></i><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';"><br /></span></i></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';"><br /></span></i></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';"><b>Some More Hacks :-</b></span></i></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';"><b><br /></b></span></i></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
</div>
<div style="font-family: arial, sans-serif;">
<div class="im">
<span style="color: #351c75;">#mydiv {</span></div>
</div>
<div class="gmail_quote" style="font-family: arial, sans-serif;">
<div class="gmail_quote">
<div class="im">
<span style="color: #351c75;"> width:89px; (common for all)<br /> margin-left/*\**/:90px\9; ( For IE8)<br /> margin-top/*\**/:-31px\9;<br />}<br /><br />#</span><span style="color: #351c75;">mydiv</span><span style="color: #351c75;"> </span><span style="color: #351c75;"> {</span></div>
<div class="im">
<span style="color: #351c75;"> width:89px;<br /> margin-left/*\**/: 180px\9;<br /> margin-top/*\**/:-32px\9;<br /> <br />}<br />(only IE6)<br />* html #</span><span style="color: #351c75;">mydiv </span><span style="color: #351c75;"> {<br /> margin-left:95px;<br /> margin-top:-33px;<br />}<br /><br />*html #</span><span style="color: #351c75;">mydiv </span><span style="color: #351c75;"> {<br /> margin-left:186px;<br /> margin-top:-30px;<br />}<br />(only IE7)<br />*:first-child+html #</span><span style="color: #351c75;">mydiv </span><span style="color: #351c75;"> {<br /> margin-left:90px;<br /> margin-top:-30px;<br />}<br /><br />*:first-child+html #</span><span style="color: #351c75;">mydiv </span><span style="color: #351c75;"> {<br /> margin-left:180px;<br /> margin-top:-27px;<br />}<br /><br />(SAFARI)<br />body:last-child:not(:root:<wbr></wbr>root) #</span><span style="color: #351c75;">mydiv </span><span style="color: #351c75;"> {<br /> margin-left:90px;<br /> margin-top:-31px;<br />}<br /><br />body:last-child:not(:root:<wbr></wbr>root) #</span><span style="color: #351c75;">mydiv </span><span style="color: #351c75;"> {<br /> margin-left:180px;<br /> margin-top:-31px;<br />}<br /><br />/* body:first-of-type #</span><span style="color: #351c75;">mydiv </span><span style="color: #351c75;"> {<br /> margin-left:90px;<br /> margin-top:-31px;<br />}<br /><br />body:first-of-type #</span><span style="color: #351c75;">mydiv </span><span style="color: #351c75;"> {<br /> margin-left:180px;<br /> margin-top:-31px;<br />}<br />*/<br /><br />/*::root #</span><span style="color: #351c75;">mydiv </span><span style="color: #351c75;"> {<br /> margin-left:90px;<br /> margin-top:-31px;<br />}<br /><br />::root #</span><span style="color: #351c75;">mydiv </span><span style="color: #351c75;"> {<br /> margin-left:180px;<br /> margin-top:-31px;<br />}<br />*/<br /><br />/* @media screen and (-webkit-min-device-pixel-<wbr></wbr>ratio:0){<br /> #</span><span style="color: #351c75;">mydiv </span><span style="color: #351c75;"> {<br /> margin-left:90px;<br /> margin-top:-31px;<br /> }<br /> #</span><span style="color: #351c75;">mydiv </span><span style="color: #351c75;"> {<br /> margin-left:180px;<br /> margin-top:-31px;<br /> }<br /><br />}<br />*/</span></div>
</div>
</div>
<br />
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';"><br /></span></i></span></div>
<div class="MsoNormal" style="background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;">
<span style="color: #351c75;"><i><span style="font-family: 'Courier New';"><br /></span></i></span></div>
<div class="MsoNormal">
<br /></div>
</div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com0tag:blogger.com,1999:blog-3058629931336799294.post-69861244490365411042013-05-05T09:59:00.000+05:302013-05-19T10:43:29.623+05:30JNDI<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;"><span style="color: #20124d;"><span style="background-color: white; color: black; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">The Java Naming and Directory Interface (JNDI) is part of the Java platform, providing applications based on Java technology with a unified interface to multiple naming and directory services. You can build powerful and portable directory-enabled applications using this industry standard.</span></span></span><br />
<br />
<span style="font-size: large;"><span style="color: #20124d;"><span style="background-color: white; color: black; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><a href="http://makecodeeasy.blogspot.in/2013/05/jndi-datasource-in-spring.html" target="_blank">Example of creating JND<span style="font-size: large;">I Datasource.</span></a> </span></span></span></div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com0tag:blogger.com,1999:blog-3058629931336799294.post-53768116884195686572013-04-30T07:12:00.001+05:302013-04-30T07:19:25.857+05:30Iterate a HashMap<div dir="ltr" style="text-align: left;padding-left:10px;background-color:#DCDCDC" trbidi="on">
<br />
<span style="color: #351c75;">HashMap is an object that stores both “key/value” as a pairs.</span><br />
<span style="color: #351c75;">It is one of the most useful data structures in the Java programming language.</span><br />
<span style="color: #351c75;"><br /></span>
<span style="color: #351c75;">Step by Step Iterating a HashMap :- </span><br />
<br />
<span style="color: #4c1130;"><b>Method 1 :</b>-
</span><br />
<pre class="brush:java">Map<Integer, Integer> map = new HashMap<Integer, Integer>();
//iterating over keys only
for (Integer key : map.keySet()) {
System.out.println("Key = " + key);
}
//iterating over values only
for (Integer value : map.values()) {
System.out.println("Value = " + value);
}
</pre>
<br />
<span style="color: #4c1130;"><b>Method 2 :-
</b></span><br />
<pre class="brush:java">Map<Integer, Integer> map = new HashMap<Integer, Integer>();
for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
System.out.println("Key = " + entry.getKey() + ", Value = " + entry.getValue());
}
</pre>
</div>rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com0tag:blogger.com,1999:blog-3058629931336799294.post-77719939764904470892013-03-23T22:16:00.001+05:302013-03-23T22:31:26.528+05:30Logger in Spring web application<div dir="ltr" style="text-align: left;padding-left:10px;background-color:#DCDCDC" trbidi="on">
<div>
<span style="color: #351c75; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<span style="color: #351c75; font-family: Georgia, Times New Roman, serif;">The logging API is designed to let a Java program, servlet, applet, EJB, etc. produce messages of interest to end users, system administrators, field engineers, and software developers. Especially in production situations, where things can't be run in a debugger, or if doing so masks the problem that is occurring (because it is timing related, for example), such logs are frequently the greatest (and sometimes the only) source of information about a running program.</span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #351c75;"><br /></span>
<span style="color: #351c75;"><b>Step by Step implementing Logger</b> <b>in Spring</b> <b>Web Application</b>:-</span></span><br />
<ol style="text-align: left;">
<li><b><span style="color: #351c75; font-family: Georgia, Times New Roman, serif;">Download log4j jar and put to application build path / put to WEB-INF lib folder.<br /><a href="http://logging.apache.org/log4j/1.2/download.html" target="_blank">Download JAR link</a></span></b></li>
<li><b><span style="color: #351c75; font-family: Georgia, Times New Roman, serif;">Create a file name Log4js.properties</span></b></li>
<pre class="brush:java">log4j.rootCategory=INFO,S,rollingFile
log4j.appender.S =org.apache.log4j.ConsoleAppender
log4j.appender.S.layout =org.apache.log4j.PatternLayout
log4j.appender.S.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n
log4j.appender.rollingFile = org.apache.log4j.DailyRollingFileAppender
#provide path to your location where you want logs created. For now its logs folder of tomcat.
log4j.appender.rollingFile.File = ${catalina.home}/logs/loggerDemo.log
log4j.appender.rollingFile.Append = true
log4j.appender.rollingFile.Threshold = ALL
log4j.appender.rollingFile.DatePattern = '.'yyy-MM-dd
log4j.appender.rollingFile.layout = org.apache.log4j.PatternLayout
log4j.appender.rollingFile.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n
</pre>
<span style="color: #351c75;"><span style="background-color: white; font-family: Georgia, Times New Roman, serif;"><ol><span style="line-height: 16px;"><b>Here ${catalina.home} :- The Tomcat Web container uses a file system directory, called the catalina home directory, to hold files that are common to the entire container.</b></span></ol>
<ol><span style="line-height: 16px;"><b>You can also give other path for generating log file.<br /></b></span></ol>
</span></span>
<li><b><span style="color: #351c75; font-family: Georgia, Times New Roman, serif;">Entry in web.xml file</span></b></li>
<pre class="brush:xml"> <context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/resources/log4j.properties</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
</pre>
<li><b><span style="color: #351c75; font-family: Georgia, Times New Roman, serif;">JAVA Code for logger.</span></b></li>
<pre class="brush:java">
import org.apache.log4j.Logger;
public class LoggerController {
private static final Logger LOGGER = Logger.getLogger(LoggerDemo.class);
@RequestMapping(method=RequestMethod.GET, value="/login/{id}")
@ResponseBody public void getUserName(@PathVariable String id) {
LOGGER.info("Calling service User authentication" + id);
}
}
</pre>
<li><b><span style="color: #351c75; font-family: Georgia, Times New Roman, serif;">Enjoy :)</span></b></li>
</ol>
</div>rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com0tag:blogger.com,1999:blog-3058629931336799294.post-32213972651291103782013-01-06T18:07:00.000+05:302013-01-06T18:08:19.546+05:30Extract a list of filtered files in Java<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: #20124d;"><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;">Sometimes, we need to get a list of files exist within a directory as per our criteria like filename, file extension, last modified date or other attributes. It reduces the overhead to filter them after getting the list using our code. To achieve this, Java provides an interface - </span><i style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;"><b>FileFilter</b></i><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;"> which has a single method prototype as </span><b style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;"><i>boolean accept(File file)</i></b><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;">. To apply our filtering criteria, we have to override this method and if our logic returns true for a file then only the file will be included in the list otherwise not. </span></span><br />
<span style="color: #20124d;"><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;"><br /></span>
<span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;">Example :- </span></span><br />
<pre class="brush:java">import java.io.*;
import java.util.*;
public class FilteredFileList {
public static File[] getFilteredFileList(File folder, final String filenameFilter, Date lastModifiedDateFilter) {
File[] listOfFiles = folder.listFiles(new FileFilter(){
public boolean accept(File file) {
//file is the object against which we are applying our logic.
//You can put your logic using filenameFilter and check whether
//the file's name comes under your criteria or not.
//To check against the lastmodified date you can use lastModifiedDateFilter.
return true;
}});
return listOfFiles;
}
}</pre>
</div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com0tag:blogger.com,1999:blog-3058629931336799294.post-19086564861840976252013-01-06T17:59:00.002+05:302013-01-06T18:01:14.552+05:30JDBC Connection in Java<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: #20124d;"><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;">JDBC (Java DataBase Connectivity) is an API for the Java programming language through which the databse can be accessed using methods for querying and updating data.</span><br style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;" /><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;"><br /></span></span><br />
<span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;"><span style="color: #20124d;">Example :- </span></span><br />
<span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;"><span style="color: #20124d;"><br /></span></span>
<pre class="brush:java">import java.sql.*;
public class ConnectionInfo {
public Connection getConnection() {
Connection conn = null;
// the below properties should be read from a properties file based on the Database used
String url = "jdbc:mysql://localhost:3306/"; // url = jdbc:[subprotocol]://[hostname]:[portnumber]/
String dbName = "jdbctutorial"; // database name
String driver = "com.mysql.jdbc.Driver"; //Driver class name
String username = "root"; // username
String password = "root"; // password
try {
Class.forName(driver); // Dynamic loading based on database used.
conn = DriverManager.getConnection(url + dbName, username, password);
System.out.println("Connection Established");
} catch (SQLException e) {
e.printStackTrace();
} finally {
return conn;
}
}
public void closeConnection(Connection conn) {
if (conn != null) {
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
}</pre>
</div>
rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com0tag:blogger.com,1999:blog-3058629931336799294.post-2509615966784124762013-01-06T17:57:00.000+05:302013-01-06T17:57:23.372+05:30Java Multithreading<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;">
<span style="color: #20124d;">Process can be further divided into small tasks which refer as a <b><i>Thread</i></b>. If two or more tasks of a process executes concurrently, then this scenario refers as a<b><i>Multithreading</i></b> environment. Every thread has it's own independent path of execution. In java, there are two ways to implement multithreading -</span></div>
<div style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;">
<span style="color: #20124d;"><br /></span></div>
<div style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;">
<span style="color: #20124d;"><u><b><i>Through implementation of Runnable interface</i></b></u> - To create a thread, we can implement Runnable interface. This interface has a single run() method declaration, so we have to override that method. Actually, in this approach, we write a wrapper over Thread class. The objects of the class which implements Runnable interface, work as a thread of the program and run on their own execution paths.</span></div>
<div style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;">
<span style="color: #20124d;"><br /></span></div>
<div style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;">
<span style="color: #20124d;">Example :- </span>
<pre class="brush:java">
public class RunnableExample implements Runnable {
private Thread thread;
public RunnableExample(String name) {
//here we pass the reference whose run method should be called.
thread = new Thread(this, name);
//creating thread
thread.start();
}
public void run() {
//your logic will go here
System.out.println(thread.getName());
}
}
public class RunnableMain {
public static void main(String[] args) {
//Creating three objects
Runnable run1 = new RunnableExample("Thread-1");
Runnable run2 = new RunnableExample("Thread-2");
Runnable run3 = new RunnableExample("Thread-3");
}
}
</pre>
</div>
<div style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;">
<span style="color: #20124d;"><br /></span></div>
<div style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;">
<span style="color: #20124d;"><br /></span></div>
<div style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;">
<span style="color: #20124d;"><br /></span></div>
<div style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 19px;">
<div>
<span style="color: #20124d;"><u><b><i>2. Using Thread class extension</i></b></u> - This is another approach of thread creation. But, it restricts the class to extend other classes (if required). In this approach, we extend our class to Thread class so that it's objects work as threads and run on their own separate execution paths.</span></div>
<div>
<span style="color: #20124d;"><br /></span></div>
<div>
<i><span style="color: #20124d;">Here is the sample code -</span></i></div>
</div>
<pre class="brush:java">
public class ThreadExample extends Thread {
public ThreadExample(String name) {
super(name);
}
public void run() {
//your logic will go here
System.out.println(thread.getName());
}
}
public class ThreadMain {
public static void main(String[] args) {
//Creating three objects
Thread t1 = new ThreadExample("Thread-1");
Thread t2 = new ThreadExample("Thread-2");
Thread t3 = new ThreadExample("Thread-3");
creating threads
t1.start();
t2.start();
t3.start();
}
}
</pre>
</div>rahulhttp://www.blogger.com/profile/11031765722695855607noreply@blogger.com1