<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7480207249380608993</id><updated>2011-11-27T16:50:41.181-08:00</updated><category term='History of Java-2'/><category term='String in Java-3'/><category term='String in Java-2'/><category term='Extensible Markup Language'/><category term='What is Web server ?'/><category term='What is resource adapter ?'/><category term='Simple Program'/><category term='Controllers'/><category term='Spring’s MVC Architecture'/><category term='What is session bean ?'/><category term='What is security role ?'/><category term='Features of Spring'/><category term='History of Java-1'/><category term='What is role (security) ?'/><category term='What is URL path ?'/><category term='What is XML ?'/><category term='JAVA- PLSQL-2'/><category term='String in Java-1'/><category term='What is Web service ?'/><category term='String in Java-4'/><category term='Variables'/><category term='Expressions'/><category term='What is value-binding expression ?'/><category term='ForgotPasswordController'/><category term='BeanFactory and ApplicationContext'/><category term='What is schema ?'/><category term='Wrapper Classes'/><category term='JAVA- PLSQL-1'/><category term='Dispatcher Servlet'/><category term='JAVA- PLSQL-3'/><category term='Spring introduction'/><category term='What is reference ?'/><title type='text'>JAVA</title><subtitle type='html'>Java - J2EE - Strings - Constructors - AWT - Multithreading - Exception Handling - Garbage Collection - J2ME - JDBC - Servlets - JSP - WebSphere - WSAD - Weblogic - Tomcat - Eclipse - JFC - Swings - EJB - Struts - Spring - Hibernate - AJAX - HTML - UML -JavaScript - XML - Webservices - SOAP - AXIS - JMS - JNDI - Oracle -PL/SQL - MySQL - InterviewQuestions</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>33</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-3598207032195791387</id><published>2008-06-30T00:14:00.000-07:00</published><updated>2008-06-30T00:24:11.163-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ForgotPasswordController'/><title type='text'></title><content type='html'>&lt;div align="center"&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;Previous&lt;/span&gt;&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left"&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#660000;"&gt;Spring’s Dispatcher Servlet:&lt;/span&gt;&lt;/strong&gt; test-servlet.xml You can break your xml files as you wish and can import all of them in test-servlet.xml so that during initialization of the application all of them will be loaded by the server as:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;textarea name="unique_name" rows="5" cols="40"&gt;&lt;import resource="/service.xml"&gt;&lt;br /&gt;&lt;br /&gt;&lt;import resource= "classpath:/com/test/testproject/spring/admin/xyz.xml"&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;You have to give the url Mappings for different request types you want to handle by this servlet as:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;textarea name="unique_name" rows="7" cols="40"&gt;&lt;bean id="urlMapping1" class= "org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"&gt;             &lt;property name="mappings"&gt;                                                          &lt;props&gt;                                                                             &lt;prop key="*Login.do"&gt;loginController&lt;/prop&gt;                                        &lt;/props&gt;                                                                           &lt;/property&gt;                                                                 &lt;/bean&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The above syntax means, whatever request comes containing text Login.do will be handled by the bean loginController. Bean loginController can be defined there as&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;textarea name="unique_name" rows="7" cols="40"&gt;&lt;bean id="loginController" class= "com.test.testproject.spring.common.LoginController"&gt;                 &lt;property name="methodNameResolver"&gt;                                               &lt;ref bean="loginMethodNameResolver"&gt;                                        &lt;/property&gt;                                                                            &lt;property name="commonUtil"&gt;                                                       &lt;ref bean="commonUtil"&gt;                                                             &lt;/property&gt;                                                                                  &lt;/bean&gt;                                                                      &lt;bean id="loginMethodNameResolver" class="org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver"&gt;                                                                                        &lt;property name="mappings"&gt;                                                        &lt;props&gt;                                                                                &lt;prop key="/Login.do"&gt;login&lt;/prop&gt;                                                 &lt;prop key="/LoginSubmit.do"&gt;formSubmit&lt;/prop&gt;                                      &lt;/props&gt;                                                                                       &lt;/property&gt;                                                              &lt;/bean&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In this definition, bean id is the name of the bean which should be unique among all application xml files. Class signifies the location of the actual java file.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#660000;"&gt;There are mainly two types of controllers which can process request in Spring –&lt;/span&gt; &lt;/strong&gt;&lt;/div&gt;&lt;div align="left"&gt; &lt;/div&gt;&lt;div align="left"&gt;&lt;strong&gt;SimpleFormController and MultiActionController.&lt;/strong&gt; SimpleFormControllers are the controllers can handle only one type of request where as MultiActionControllers can handle different types of request.&lt;br /&gt;&lt;br /&gt;Here loginController, which extends MultiActionController, is a MultiActionControllers. In a MultiActionController like loginController there are different methods to handle different requests. To map between them a property provided by Spring “methodNameResolver“ is there which tells the Controller which method is to be invoked for a given request. Here that method name resolver bean is “loginMethodNameResolver”.&lt;/div&gt;&lt;div align="left"&gt;It tells that if request type is “/Login.do” then go to “login” method in the loginController and for “/LoginSubmit.do” request go to “formSubmit” method.&lt;br /&gt;&lt;br /&gt;There are a lot of mappings of this kind which we have placed in other xml files and then all of them are imported in this test-servlet.xml. This type of break up will help in maintaining the changes in these files.&lt;br /&gt;&lt;br /&gt;We have discussed mapping required for MultiActionController above. Following is the example of a SimpleFormController mapping:&lt;br /&gt;&lt;br /&gt;&lt;textarea name="unique_name" rows="7" cols="40"&gt;&lt;bean id="urlMapping5" class=                                                                              "org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"&gt;                     &lt;property name="mappings"&gt;                                                      &lt;props&gt;                                                                                &lt;prop key="test/update.do"&gt;updateController&lt;/prop&gt;                              &lt;/props&gt;                                                                               &lt;/property&gt;                                                                        &lt;/bean&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This controller, which extends SimpleFormController, handles request “test/update.do” only.Below is the example of a Controller, other than SimpleFormController and MultiAction Controller:&lt;br /&gt;&lt;br /&gt;&lt;textarea name="unique_name" rows="7" cols="40"&gt;&lt;bean id="urlMapping11" class= "org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"&gt;         &lt;property name="mappings"&gt;                                                           &lt;props&gt;                                                                              &lt;prop key="ForgotPassword.do"&gt;                                     forgotPasswordController                                                        &lt;/prop&gt;                                                                                &lt;/props&gt;                                                                       &lt;/property&gt;                                                                        &lt;/bean&gt;                                                                                        &lt;bean id="forgotPasswordController" class= "com.test.testproject.spring.common.ForgotPasswordController"&gt;      &lt;/bean&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This “&lt;strong&gt;forgotPasswordController&lt;/strong&gt;” handles only one request ”ForgotPassword.do”. This controller, which implements Controller Interface, only redirects the request to another controller or returns a simple model which contains nothing. We will see this Controller class later....&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="center"&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#000099;"&gt;Next&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div align="left"&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-3598207032195791387?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/3598207032195791387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=3598207032195791387' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/3598207032195791387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/3598207032195791387'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/06/previous-springs-dispatcher-servlet.html' title=''/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-7519172905094873455</id><published>2008-06-30T00:01:00.000-07:00</published><updated>2008-06-30T00:13:58.458-07:00</updated><title type='text'></title><content type='html'>&lt;div align="center"&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color:#000099;"&gt;&lt;strong&gt;Previous&lt;/strong&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;div align="left"&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The syntax says that any request which ends with .do will be handled by test-servlet that is described by test-servlet.xml.To set the index file, the first jsp to be loaded from the application, can be set as:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;textarea name="unique_name" rows="5" cols="40"&gt;&lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;                                                                        &lt;/welcome-file-list&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;In the above case index.jsp file is to be placed directly under the application folder. This jsp redirects the url to another request as:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;textarea name="unique_name" rows="5" cols="30"&gt;&lt;core:redirect url="./login.do"&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;To include the taglibs (Java Standard Tag Library) into your jsp first add the following lines into the web-xml:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;textarea name="unique_name" rows="5" cols="40"&gt;&lt;taglib&gt;http://java.sun.com/jstl/fmt&lt;/taglib-uri&gt;                                 &lt;taglib-location&gt;/WEB-INF/fmt.tld&lt;/taglib-location&gt;                         &lt;/taglib&gt;                                                               &lt;taglib&gt;                                                                      &lt;taglib-uri&gt;http://java.sun.com/jstl/core&lt;/taglib-uri&gt;                              &lt;taglib-location&gt;/WEB-INF/c.tld&lt;/taglib-location&gt;                                  &lt;/taglib&gt;&lt;taglib&gt;&lt;taglib-uri&gt;http://java.sun.com/jstl/core-rt&lt;/taglib-uri&gt;     &lt;taglib-location&gt;/WEB-INF/c-rt.tld&lt;/taglib-location&gt;                         &lt;/taglib&gt; &lt;taglib&gt;                                                                      &lt;taglib-uri&gt;http://java.sun.com/jstl/sql&lt;/taglib-uri&gt;                                                                                &lt;taglib-location&gt;/WEB-INF/sql.tld                                                 &lt;/taglib-location&gt;&lt;/taglib&gt;&lt;taglib&gt;                                                &lt;taglib-uri&gt;http://java.sun.com/jstl/sql-rt                                  &lt;/taglib-uri&gt;&lt;taglib-location&gt;/WEB-INF/sql-rt.tld&lt;/tagliblocation&gt; &lt;/taglib&gt;               &lt;taglib&gt;                                                                      &lt;taglib-uri&gt;http://java.sun.com/jstl/x&lt;/taglib-uri&gt;                                  &lt;taglib-location&gt;/WEB-INF/x.tld&lt;/taglib-location&gt;&lt;/taglib&gt;&lt;taglib&gt;                                                     &lt;taglib-uri&gt;http://java.sun.com/jstl/x-rt&lt;/taglib-uri&gt;                          &lt;taglib-location&gt;/WEB-INF/x-rt.tld&lt;/taglib-location&gt;                     &lt;/taglib&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;To include spring tags include the following lines:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;textarea name="unique_name" rows="5" cols="40"&gt;&lt;taglib-uri&gt;/spring            &lt;/taglib-uri&gt;                                                                       &lt;taglib-location&gt;/WEB-INF/spring.tld                                         &lt;/taglib-location&gt;                                                     &lt;/taglib&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We have used only a few of them in our project (core and fmt tags). Before you use this tags in your jsp, you must place those .tld files in WEB-INF.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="center"&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;Next&lt;/strong&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="center"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-7519172905094873455?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/7519172905094873455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=7519172905094873455' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/7519172905094873455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/7519172905094873455'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/06/previous-syntax-says-that-any-request.html' title=''/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-6994946009439669279</id><published>2008-06-29T22:50:00.000-07:00</published><updated>2008-06-29T23:59:32.575-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Controllers'/><title type='text'></title><content type='html'>&lt;div align="center"&gt;&lt;span style="color:#000099;"&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;Previous&lt;/span&gt;&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left"&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#660000;"&gt;Controllers:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Controllers are classes that interpret user input data or handles requests and send a model along with the view to the client after doing some customized processing. Every controller class actually returns a ModelAndView type of object. Controllers even can forward or redirect the request to a URL.&lt;br /&gt;Among various types of controllers we have used:&lt;br /&gt;&lt;br /&gt;• Controller – Default and the simplest form of controllers, when no form data is required to be handled at all&lt;br /&gt;&lt;br /&gt;• SimpleFormController – For handling a single request by a controller&lt;br /&gt;&lt;br /&gt;• MultiActionController – For handling different requests by a single controller&lt;br /&gt;web.xml:&lt;br /&gt;&lt;br /&gt;Whatever request comes from the client side first reaches to web.xml. This file was kept in WEB-INF. This file was mapped with the Spring Dispatcher Servlet named as test-servlet.xml as in our project (You can change the first part “test”):&lt;br /&gt;&lt;br /&gt;&lt;textarea name="unique_name" rows="7" cols="40"&gt;&lt;servlet-name&gt;test&lt;/servlet-name&gt; &lt;servlet-class&gt;                      org.springframework.web.servlet.DispatcherServlet                                   &lt;/servlet-class&gt;                                                                     &lt;load-on-startup&gt;2&lt;/load-on-startup&gt;                                    &lt;/servlet&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Even you can set the context configuration inside test-servlet.xml as:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;textarea name="unique_name" rows="10" cols="40"&gt;&lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;                                              &lt;param-value&gt;/WEB-INF/test-servlet.xml                                               &lt;/paramvalue&gt;                                                                             &lt;/context-param&gt;                                                      &lt;listener&gt;                                                                          &lt;listener-class&gt;               org.springframework.web.context.ContextLoaderListener                       &lt;/listener-class&gt;                                                     &lt;/listener&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Next is how the web.xml will handle different types of request. This can be mapped as:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;textarea name="unique_name" rows="5" cols="40"&gt;&lt;servlet-name&gt;test&lt;/servlet-name&gt;&lt;url-pattern&gt;*.do&lt;/url-pattern&gt;                                              &lt;/servlet-mapping&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="center"&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#000099;"&gt;Next&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div align="center"&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-6994946009439669279?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/6994946009439669279/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=6994946009439669279' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/6994946009439669279'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/6994946009439669279'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/06/previous-controllers-controllers-are.html' title=''/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-946211823544158406</id><published>2008-06-29T22:47:00.000-07:00</published><updated>2008-06-29T22:50:06.994-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BeanFactory and ApplicationContext'/><title type='text'></title><content type='html'>&lt;div align="center"&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color:#000099;"&gt;&lt;strong&gt;Previous&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;strong&gt;&lt;/strong&gt;&lt;div align="left"&gt;&lt;strong&gt;&lt;span style="color:#990000;"&gt;BeanFactory and ApplicationContext:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The BeanFactory is the Spring’s bean container which loads and wires bean at the initial time and supply them when requested for. The ApplicationContext is a BeanFactory which does this work.&lt;br /&gt;&lt;br /&gt;You can have separate xml files for defining beans or can have a file such as an applicationContext.xml file to define all bean definition. We have used Spring’s Dispatcher Servlet test-servlet.xml as a bean factory which imports all other xml into it during initialization and loads all beans into the ApplicationContext.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="center"&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#000099;"&gt;Next&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div align="center"&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#000099;"&gt;&lt;/span&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-946211823544158406?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/946211823544158406/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=946211823544158406' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/946211823544158406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/946211823544158406'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/06/previous-beanfactory-and.html' title=''/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-3575751399534468856</id><published>2008-06-29T22:42:00.000-07:00</published><updated>2008-06-29T22:46:19.005-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Dispatcher Servlet'/><title type='text'></title><content type='html'>&lt;div align="center"&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#000099;"&gt;&lt;/span&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div align="center"&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#000099;"&gt;Previous&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div align="left"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#660000;"&gt;Dispatcher Servlet:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Spring's web MVC framework is a request-driven web MVC framework, designed around a servlet that dispatches requests to controllers and offers other functionality facilitating the development of web applications. Spring's DispatcherServlet does that.&lt;br /&gt;&lt;br /&gt;The Spring DispatcherServlet has a couple of special beans it uses, in order to be able to process requests and render the appropriate views. These beans are included in the Spring framework and can be configured in the WebApplicationContext, just as any other bean would be configured. Right now, we'll just mention some of them. For most of the beans, defaults are provided so you don't have to worry about configuring them.&lt;br /&gt;&lt;br /&gt;• Handler mappings – for matching the URL and send them to a controllers&lt;br /&gt;&lt;br /&gt;• Controllers – the actual controller beans&lt;br /&gt;&lt;br /&gt;• View resolver – to find the exact location of the view (JSP)&lt;br /&gt;&lt;br /&gt;• Theme resolver – capable of resolving themes for the application&lt;br /&gt;&lt;br /&gt;• Handlerexceptionresolver – offers functionality to map different exceptions&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="center"&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#000099;"&gt;Next&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-3575751399534468856?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/3575751399534468856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=3575751399534468856' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/3575751399534468856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/3575751399534468856'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/06/previous-dispatcher-servlet-springs-web.html' title=''/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-1012985256871207044</id><published>2008-06-18T09:00:00.000-07:00</published><updated>2008-06-18T09:05:55.009-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Features of Spring'/><title type='text'>Spring Framework</title><content type='html'>&lt;div align="center"&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;previous&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#660000;"&gt;Features of Spring:&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;• Clear separation of roles – controller, validator, command object, form object, model object, Dispatcher Servlet, handler mapping, view resolver etc. separate objects for each role.&lt;br /&gt;&lt;br /&gt;• Powerful and straightforward configuration, easy referencing across contexts of both framework and application classes as beans.&lt;br /&gt;&lt;br /&gt;• Separate controllers for different scenarios – plain, form, wizard, simple, multiaction.&lt;br /&gt;&lt;br /&gt;• Customizable binding and validation – binding of any object is possible along with validation after submission of form.&lt;br /&gt;&lt;br /&gt;• Customizable handler/controller mapping and view resolver – can handle simple requests via URLs or even can intercept a URL, and view resolvers help to locate the actual path of views.&lt;br /&gt;&lt;br /&gt;• Map model transfer – transfer of any number of objects is possible via model object, no need to set them as request attributes.&lt;br /&gt;&lt;br /&gt;• Supports Theme and JSTL tags with or without Spring tags.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="center"&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#000099;"&gt;Next&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div align="center"&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#000099;"&gt;&lt;/span&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div align="center"&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#000099;"&gt;&lt;/span&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-1012985256871207044?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/1012985256871207044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=1012985256871207044' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/1012985256871207044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/1012985256871207044'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/06/spring-framework_907.html' title='Spring Framework'/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-3785101453905366447</id><published>2008-06-18T08:49:00.000-07:00</published><updated>2008-06-18T08:52:24.290-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Spring’s MVC Architecture'/><title type='text'>Spring Framework</title><content type='html'>&lt;div align="center"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;Previous&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#660000;"&gt;Spring’s MVC Architecture:&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Spring’s MVC framework is designed based on Dispatcher Servlet which dispatches requests to respective request-handlers better known as controllers. Spring can bind any object as a command object which will be available directly in the controller class.&lt;br /&gt;&lt;br /&gt;To do any validation of the form objects, you need a validation class which is provided by this framework.&lt;br /&gt;&lt;br /&gt;After validation, if you want to send some data to the JSP that can be done via referenceData method. The controller class returns a view name (the JSP name) and a model Map.&lt;br /&gt;&lt;br /&gt;The model contains all the bean names and corresponding objects you need to send to the view. View names and it’s location is resolved via view Resolver bean provided in the XML mapping.&lt;/p&gt;&lt;div align="center"&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#000099;"&gt;Next&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-3785101453905366447?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/3785101453905366447/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=3785101453905366447' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/3785101453905366447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/3785101453905366447'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/06/spring-framework_18.html' title='Spring Framework'/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-3526755314069807806</id><published>2008-06-18T08:43:00.000-07:00</published><updated>2008-06-18T08:48:36.253-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Spring introduction'/><title type='text'>Spring Framework</title><content type='html'>&lt;div align="center"&gt;&lt;br /&gt;&lt;/div&gt;&lt;p align="center"&gt;&lt;/p&gt;&lt;p align="center"&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#000099;"&gt;Previous&lt;/span&gt; &lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#660000;"&gt;Introduction:&lt;/span&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p align="left"&gt;The content of this document is not a detailed description on Spring or Hibernate. This document contains how we have used Spring and Hibernate in our project.&lt;br /&gt;&lt;br /&gt;I have shared most of the learning experiences I have gathered during execution of the project here. Those who have some prior knowledge on J2EE framework would be able to understand these.&lt;br /&gt;&lt;br /&gt;Our project got executed using JBoss-3.2 server and Hibernate as back end. We have developed our codes in Eclipse-3 platform using Spring framework.&lt;br /&gt;&lt;br /&gt;Finally the war file was deployed in Linux and it was platform independent.&lt;br /&gt;&lt;/p&gt;&lt;p align="center"&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#000099;"&gt;Next&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-3526755314069807806?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/3526755314069807806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=3526755314069807806' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/3526755314069807806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/3526755314069807806'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/06/spring-framework.html' title='Spring Framework'/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-7708118782804262798</id><published>2008-04-15T23:50:00.000-07:00</published><updated>2008-04-15T23:51:19.118-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is reference ?'/><title type='text'></title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#cc6600;"&gt;What is reference ?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;A reference to an entity that is substituted for the reference when the XML document is parsed. It can reference a predefined entity such as &lt;&gt; &lt;p&gt;The DTD can also carve out a segment of DTD specifications and give it a name so that it can be reused (included) at multiple points in the DTD by defining a parameter entity.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-7708118782804262798?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/7708118782804262798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=7708118782804262798' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/7708118782804262798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/7708118782804262798'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/what-is-reference-reference-to-entity.html' title=''/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-7295771117454364314</id><published>2008-04-15T23:34:00.000-07:00</published><updated>2008-04-15T23:44:35.198-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is resource adapter ?'/><title type='text'></title><content type='html'>&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#993300;"&gt;What is resource adapter ?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;A system-level software driver that is used by an EJB container or an application client to connect to an enterprise information system. &lt;/p&gt;&lt;p&gt;A resource adapter typically is specific to an enterprise information system. It is available as a library and is used within the address space of the server or client using it. A resource adapter plugs in to a container. &lt;/p&gt;&lt;p&gt;The application components deployed on the container then use the client API (exposed by the adapter) or tool-generated high-level abstractions to access the underlying enterprise information system. &lt;/p&gt;&lt;p&gt;The resource adapter and EJB container collaborate to provide the underlying mechanisms-transactions, security, and connection pooling-for connectivity to the enterprise information system.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-7295771117454364314?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/7295771117454364314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=7295771117454364314' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/7295771117454364314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/7295771117454364314'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/what-is-resource-adapter-system-level.html' title=''/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-9202648753066118405</id><published>2008-04-15T23:27:00.000-07:00</published><updated>2008-04-15T23:28:55.417-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is role (security) ?'/><title type='text'></title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#993300;"&gt;What is role (security) ?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;An abstract logical grouping of users that is defined by the application assembler. When an application is deployed, the roles are mapped to security identities, such as principals or groups, in the operational environment. &lt;/p&gt;&lt;p&gt;In the J2EE server authentication service, a role is an abstract name for permission to access a particular set of resources. &lt;/p&gt;&lt;p&gt;A role can be compared to a key that can open a lock. Many people might have a copy of the key; the lock doesn't care who you are, only that you have the right key.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-9202648753066118405?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/9202648753066118405/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=9202648753066118405' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/9202648753066118405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/9202648753066118405'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/what-is-role-security-abstract-logical.html' title=''/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-3091191304590133601</id><published>2008-04-15T23:25:00.000-07:00</published><updated>2008-04-15T23:27:08.639-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is schema ?'/><title type='text'></title><content type='html'>&lt;strong&gt;&lt;span style="font-size:130%;color:#993300;"&gt;What is schema ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#993300;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;A database-inspired method for specifying constraints on XML documents using an XML-based language. Schemas address deficiencies in DTDs, such as the inability to put constraints on the kinds of data that can occur in a particular field.&lt;br /&gt;&lt;br /&gt;Because schemas are founded on XML, they are hierarchical. Thus it is easier to create an unambiguous specification, and it is possible to determine the scope over which a comment is meant to apply.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-3091191304590133601?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/3091191304590133601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=3091191304590133601' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/3091191304590133601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/3091191304590133601'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/what-is-schema-database-inspired-method.html' title=''/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-365586218306946924</id><published>2008-04-15T23:23:00.000-07:00</published><updated>2008-04-15T23:25:29.470-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is security role ?'/><title type='text'></title><content type='html'>&lt;strong&gt;&lt;span style="font-size:130%;color:#993300;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#993300;"&gt;What is security role ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#993300;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;An abstract logical grouping of users that is defined by the application assembler.&lt;br /&gt;&lt;br /&gt;When an application is deployed, the roles are mapped to security identities, such as principals or groups, in the operational environment.&lt;br /&gt;&lt;br /&gt;In the J2EE server authentication service, a role is an abstract name for permission to access a particular set of resources.&lt;br /&gt;&lt;br /&gt;A role can be compared to a key that can open a lock.&lt;br /&gt;&lt;br /&gt;Many people might have a copy of the key; the lock doesn't care who you are, only that you have the right key.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-365586218306946924?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/365586218306946924/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=365586218306946924' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/365586218306946924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/365586218306946924'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/what-is-security-role-abstract-logical.html' title=''/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-1220256065306991030</id><published>2008-04-15T23:21:00.000-07:00</published><updated>2008-04-15T23:23:22.753-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is session bean ?'/><title type='text'></title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#993300;"&gt;What is session bean ?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;An enterprise bean that is created by a client and that usually exists only for the duration of a single client-server session. &lt;/p&gt;&lt;p&gt;A session bean performs operations, such as calculations or database access, for the client. Although a session bean can be transactional, it is not recoverable should a system crash occur. &lt;/p&gt;&lt;p&gt;Session bean objects either can be stateless or can maintain conversational state across methods and transactions. &lt;/p&gt;&lt;p&gt;If a session bean maintains state, then the EJB container manages this state if the object must be removed from memory. However, the session bean object itself must manage its own persistent data.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-1220256065306991030?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/1220256065306991030/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=1220256065306991030' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/1220256065306991030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/1220256065306991030'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/what-is-session-bean-enterprise-bean.html' title=''/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-2233267919993411496</id><published>2008-04-15T23:19:00.000-07:00</published><updated>2008-04-15T23:20:55.136-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is URL path ?'/><title type='text'></title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#993300;"&gt;What is URL path ?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#993300;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The part of a URL passed by an HTTP request to invoke a servlet. A URL path consists of the context path + servlet path + path info, where Context path is the path prefix associated with a servlet context of which the servlet is a part. &lt;/p&gt;&lt;p&gt;If this context is the default context rooted at the base of the Web server's URL namespace, the path prefix will be an empty string. &lt;/p&gt;&lt;p&gt;Otherwise, the path prefix starts with a / character but does not end with a / character. Servlet path is the path section that directly corresponds to the mapping that activated this request. This path starts with a / character. Path info is the part of the request path that is not part of the context path or the servlet path&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-2233267919993411496?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/2233267919993411496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=2233267919993411496' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/2233267919993411496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/2233267919993411496'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/what-is-url-path-part-of-url-passed-by.html' title=''/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-6014108740230876968</id><published>2008-04-15T23:18:00.000-07:00</published><updated>2008-04-15T23:19:19.130-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is value-binding expression ?'/><title type='text'></title><content type='html'>&lt;strong&gt;&lt;span style="font-size:130%;color:#993300;"&gt;What is value-binding expression ?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#993300;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;A JavaServer Faces EL expression that refers to a property of a backing bean.&lt;br /&gt;&lt;br /&gt;A component tag uses this expression to bind the associated component's value or the component instance to the bean property.&lt;br /&gt;&lt;br /&gt;If the component tag refers to the property via its value attribute, then the component's value is bound to the property.&lt;br /&gt;&lt;br /&gt;If the component tag refers to the property via its binding attribute then the component itself is bound to the property.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-6014108740230876968?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/6014108740230876968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=6014108740230876968' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/6014108740230876968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/6014108740230876968'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/what-is-value-binding-expression.html' title=''/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-3990748678323723266</id><published>2008-04-15T23:16:00.000-07:00</published><updated>2008-04-15T23:18:00.322-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is Web server ?'/><title type='text'></title><content type='html'>&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#993300;"&gt;What is Web server ?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Software that provides services to access the Internet, an intranet, or an extranet.&lt;/p&gt;&lt;p&gt;A Web server hosts Web sites, provides support for HTTP and other protocols, and executes server-side programs (such as CGI scripts or servlets) that perform certain functions. &lt;/p&gt;&lt;p&gt;In the J2EE architecture, a Web server provides services to a Web container. For example, a Web container typically relies on a Web server to provide HTTP message handling. &lt;/p&gt;&lt;p&gt;The J2EE architecture assumes that a Web container is hosted by a Web server from the same vendor, so it does not specify the contract between these two entities. A Web server can host one or more Web containers.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-3990748678323723266?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/3990748678323723266/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=3990748678323723266' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/3990748678323723266'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/3990748678323723266'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/what-is-web-server-software-that.html' title=''/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-4063124879696976425</id><published>2008-04-15T23:13:00.000-07:00</published><updated>2008-04-15T23:15:33.309-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is Web service ?'/><title type='text'></title><content type='html'>&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;color:#993300;"&gt;What is Web service ?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;An application that exists in a distributed environment, such as the Internet. A Web service accepts a request, performs its function based on the request, and returns a response. &lt;/p&gt;&lt;p&gt;The request and the response can be part of the same operation, or they can occur separately, in which case the consumer does not need to wait for a response. &lt;/p&gt;&lt;p&gt;Both the request and the response usually take the form of XML, a portable data-interchange format, and are delivered over a wire protocol, such as HTTP.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-4063124879696976425?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/4063124879696976425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=4063124879696976425' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/4063124879696976425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/4063124879696976425'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/what-is-web-service-application-that.html' title=''/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-5540906385049156427</id><published>2008-04-15T23:04:00.000-07:00</published><updated>2008-04-15T23:11:09.221-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is XML ?'/><title type='text'></title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#993300;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="color:#993300;"&gt;&lt;strong&gt;What is XML ?&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Extensible Markup Language. A markup language that allows you to define the tags (markup) needed to identify the content, data, and text in XML documents. It differs from HTML, the markup language most often used to present information on the Internet. HTML has fixed tags that deal mainly with style or presentation. An XML document must undergo a transformation into a language with style tags under the control of a style sheet before it can be presented by a browser or other presentation mechanism. &lt;/p&gt;&lt;p&gt;Two types of style sheets used with XML are CSS and XSL. Typically, XML is transformed into HTML for presentation. Although tags can be defined as needed in the generation of an XML document, a document type definition (DTD) can be used to define the elements allowed in a particular type of document. A document can be compared by using the rules in the DTD to determine its validity and to locate particular elements in the document. &lt;/p&gt;&lt;p&gt;A Web services application's J2EE deployment descriptors are expressed in XML with schemas defining allowed elements. Programs for processing XML documents use SAX or DOM APIs.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-5540906385049156427?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/5540906385049156427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=5540906385049156427' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/5540906385049156427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/5540906385049156427'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/what-is-xml-extensible-markup-language.html' title=''/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-3468907743611808259</id><published>2008-04-07T23:30:00.000-07:00</published><updated>2008-04-07T23:33:58.569-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA- PLSQL-3'/><title type='text'>JAVA- PLSQL STORED PROCEDURES</title><content type='html'>&lt;strong&gt;&lt;span style="color:#993300;"&gt;How can I protect my PL/SQL source code?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;PL/SQL V2.2, available with Oracle7.2, implements a binary wrapper for PL/SQL programs to protect the source code.&lt;br /&gt;This is done via a standalone utility that transforms the PL/SQL source code into portable binary object code (somewhat larger than the original).&lt;br /&gt;This way you can distribute software without having to worry about exposing your proprietary algorithms and methods.&lt;br /&gt;SQL*Plus and SQL*DBA will still understand and know how to execute such scripts. Just be careful, there is no "decode" command available.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;The syntax is:&lt;/span&gt;&lt;/strong&gt; wrap iname=myscript.sql oname=xxxx.plb&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#993300;"&gt;Can one print to the screen from PL/SQL?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;One can use the DBMS_OUTPUT package to write information to an output buffer. This buffer can be displayed on the screen from SQL*Plus if you issue the SET SERVEROUTPUT ON; command.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;set serveroutput on&lt;br /&gt;Begin&lt;br /&gt;dbms_output.put_line('Look Ma, I can print from PL/SQL!!!');&lt;br /&gt;end;&lt;br /&gt; /&lt;br /&gt;&lt;br /&gt;DBMS_OUTPUT is useful for debugging PL/SQL programs. However, if you print too much, the output buffer will overflow.&lt;br /&gt;&lt;br /&gt;In that case, set the buffer size to a larger value,&lt;br /&gt;&lt;br /&gt;Eg.:&lt;br /&gt;set serveroutput on size 200000&lt;br /&gt;&lt;br /&gt;If you forget to set serveroutput on type SET SERVEROUTPUT ON once you remember, and then EXEC NULL;.&lt;br /&gt;&lt;br /&gt;If you haven't cleared the DBMS_OUTPUT buffer with the&lt;br /&gt;disable&lt;br /&gt;or&lt;br /&gt;enable procedure,&lt;br /&gt;SQL*Plus will display the entire contents of the buffer when it executes this dummy PL/SQL block.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-3468907743611808259?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/3468907743611808259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=3468907743611808259' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/3468907743611808259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/3468907743611808259'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/java-plsql-stored-procedures_391.html' title='JAVA- PLSQL STORED PROCEDURES'/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-3540249572875648323</id><published>2008-04-07T23:26:00.000-07:00</published><updated>2008-04-07T23:30:10.939-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA- PLSQL-2'/><title type='text'>JAVA- PLSQL STORED PROCEDURES</title><content type='html'>&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="color:#993300;"&gt;How can one see if somebody modified any code?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Code for stored procedures, functions and packages are stored in the Oracle Data Dictionary. One can detect code changes by looking at the LAST_DDL_TIME column in the USER_OBJECTS dictionary view. &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;Example:&lt;/span&gt;&lt;/strong&gt; SELECT OBJECT_NAME, TO_CHAR (CREATED, 'DD-Mon-RR HH24: MI’) CREATE_TIME, TO_CHAR(LAST_DDL_TIME, 'DD-Mon-RR HH24:MI') MOD_TIME, STATUS FROM USER_OBJECTS WHERE LAST_DDL_TIME &gt; '&amp;amp;CHECK_FROM_DATE';&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="color:#993300;"&gt;How can one search PL/SQL code for a string/ key value?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The following query is handy if you want to know where a certain table, field or expression is referenced in your PL/SQL source code. &lt;/p&gt;&lt;p&gt;SELECT TYPE, NAME, LINE FROM USER_SOURCE WHERE UPPER(TEXT) LIKE '%&amp;amp;KEYWORD%';&lt;/p&gt;&lt;p&gt;&lt;span style="color:#993300;"&gt;&lt;strong&gt;How can one keep a history of PL/SQL code&lt;/strong&gt; &lt;/span&gt;&lt;span style="color:#993300;"&gt;&lt;strong&gt;changes&lt;/strong&gt;&lt;strong&gt;?&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;One can build a history of PL/SQL code changes by setting up an AFTER CREATE schema (or database) level trigger (available from Oracle 8.1.7). This way one can easily revert to previous code should someone make any catastrophic changes. &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="color:#993300;"&gt;Look at this example&lt;/span&gt;:&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;CREATE TABLE SOURCE_HIST -- Create history table &lt;/p&gt;&lt;p&gt;AS &lt;/p&gt;&lt;p&gt;SELECT SYSDATE CHANGE_DATE, USER_SOURCE.* FROM USER_SOURCE &lt;/p&gt;&lt;p&gt;WHERE 1=2; &lt;/p&gt;&lt;p&gt;CREATE OR REPLACE TRIGGER change_hist -- Store code in hist table &lt;/p&gt;&lt;p&gt;AFTER &lt;/p&gt;&lt;p&gt;CREATE &lt;/p&gt;&lt;p&gt;ON SCOTT.SCHEMA -- Change SCOTT to your schema name &lt;/p&gt;&lt;p&gt;DECLARE &lt;/p&gt;&lt;p&gt;BEGIN &lt;/p&gt;&lt;p&gt;if DICTIONARY_OBJ_TYPE &lt;/p&gt;&lt;p&gt;in ('PROCEDURE', 'FUNCTION', 'PACKAGE', 'PACKAGE BODY', 'TYPE') &lt;/p&gt;&lt;p&gt;then -- Store old code in SOURCE_HIST table &lt;/p&gt;&lt;p&gt;INSERT INTO SOURCE_HIST SELECT sysdate, user_source.* FROM &lt;/p&gt;&lt;p&gt;USER_SOURCE WHERE TYPE = DICTIONARY_OBJ_TYPE &lt;/p&gt;&lt;p&gt;AND NAME = DICTIONARY_OBJ_NAME; end if; &lt;/p&gt;&lt;p&gt;EXCEPTION &lt;/p&gt;&lt;p&gt;WHEN OTHERS THEN raise_application_error(-20000, SQLERRM); &lt;/p&gt;&lt;p&gt;END; &lt;/p&gt;&lt;p&gt;/ show errors&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-3540249572875648323?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/3540249572875648323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=3540249572875648323' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/3540249572875648323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/3540249572875648323'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/java-plsql-stored-procedures_07.html' title='JAVA- PLSQL STORED PROCEDURES'/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-2052445194617810035</id><published>2008-04-07T23:22:00.000-07:00</published><updated>2008-04-07T23:26:19.964-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA- PLSQL-1'/><title type='text'>JAVA- PLSQL STORED PROCEDURES</title><content type='html'>&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="color:#993300;"&gt;What is PL/SQL and what is it used for?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;PL/SQL is Oracle's Procedural Language extension to SQL. PL/SQL's language syntax, structure and data types are similar to that of ADA. The PL/SQL language includes object oriented programming techniques such as encapsulation, function overloading, information hiding (all but inheritance). &lt;/p&gt;&lt;p&gt;PL/SQL is commonly used to write data-centric programs to manipulate data in an Oracle database.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="color:#993300;"&gt;Should one use PL/SQL or Java to code procedures and triggers?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Internally the Oracle database supports two procedural languages, namely PL/SQL and Java. This leads to questions like "Which of the two is the best?" and "Will Oracle ever desupport PL/SQL in favor of Java?”&lt;/p&gt;&lt;p&gt;Many Oracle applications are based on PL/SQL and it would be difficult of Oracle to ever desupport PL/SQL. In fact, all indications are that PL/SQL still has a bright future ahead of it. Many enhancements are still being made to PL/SQL. &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="color:#996633;"&gt;For example&lt;/span&gt;&lt;/strong&gt;, Oracle 9iDB supports native compilation of Pl/SQL code to binaries.PL/SQL and Java appeal to different people in different job roles. &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;The following table briefly describes the difference between these two language environments:&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="color:#993300;"&gt;PL/SQL: &lt;/span&gt;&lt;/strong&gt;Data centric and tightly integrated into the databaseProprietary to Oracle and difficult to port to other database systemsData manipulation is slightly faster in PL/SQL than in JavaEasier to use than Java (depending on your background) &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="color:#993300;"&gt;Java:&lt;/span&gt;&lt;/strong&gt;Open standard, not proprietary to OracleIncurs some data conversion overhead between the Database and Java type systemsJava is more difficult to use (depending on your background).&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-2052445194617810035?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/2052445194617810035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=2052445194617810035' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/2052445194617810035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/2052445194617810035'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/java-plsql-stored-procedures.html' title='JAVA- PLSQL STORED PROCEDURES'/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-7776091733789769391</id><published>2008-04-07T23:17:00.000-07:00</published><updated>2008-04-07T23:21:54.092-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Simple Program'/><title type='text'></title><content type='html'>&lt;span style="color:#990000;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#990000;"&gt;&lt;strong&gt;A Simple java program&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Let's look into our first program. Save the following text into the file called HelloWorld.java&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;class HelloWorld {public static void main(String[] args)&lt;br /&gt;{&lt;br /&gt;System.out.println("Hello World!");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;We examine that there is a class called HelloWorld. Since HelloWorld is the only class in the file, it is called the main class. The main class of the file has to be runnable in order to make your program runnable. In order to make your program runnable, you should have a function called main which is defined as:&lt;br /&gt;&lt;br /&gt;public static void main(Strings[] args)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#993300;"&gt;The explanation is as follows:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The public qualifier tells you that the function main is callable from outside. You don't have to worry about this one yet as the concept of making a function private or public is later described in Object Oriented Programming (OOP) philosophy.&lt;br /&gt;&lt;br /&gt;Then the next qualifier is static. You don't have to worry about this either.Then, void tells you that the function main returns nothing to the system.Then the function's name, main.Then String[] args denotes the argument passed into the program. The arguments are not used in the moment. What is an argument? It is the options or switches you would mention when invoking programs. Like in dir /w or ls -la both /w and -la serve as arguments.&lt;br /&gt;&lt;br /&gt;You can consider System.out.println as a command to print some text on the screen. Not that the text has to be surrounded by the double quotes. In this case, "Hello World!" is being printed, without the quotes of course. Remember that almost every command in Java ends with a semicolon(;).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;IMPORTANT:&lt;/span&gt;&lt;/strong&gt; The main class name has to be the same as the program file name. Otherwise, your Java program won't compile. In this example the class name is HelloWorld. The program file has to be HelloWorld.java. You have to pay attention that this naming convention is CASE SENSITIVE it means that naming your file into helloworld.java WON'T work. If your program won't compile, pay attention to the capitalization of your file name. This rule also applies even in Windows platform.&lt;br /&gt;&lt;br /&gt;How to Compile and Run Your ProgramIn either Windows or UNIX, to compile the program, type the following command at your prompt: Don't forget to change the directory to the directory where your Java program resides. Also, make sure that your JDK installation is correct.&lt;br /&gt;&lt;br /&gt;javac HelloWorld.javaIn Macintosh, just drag your HelloWorld.java file into the Java Compiler icon.&lt;br /&gt;&lt;br /&gt;If it produces a file called HelloWorld.class, it means that your compilation is successful.&lt;br /&gt;&lt;br /&gt;To run it, under Windows or UNIX,&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;Type the following:&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;java HelloWorldNotice that there is no .class extension on it.&lt;br /&gt;Under Macintosh, simply double-click your HelloWorld.class file.&lt;br /&gt;&lt;br /&gt;Commenting Your ProgramSometimes, it is useful to make some note about your program. Not only making you clear about what's going on your program, but also making others able to read your program based on the comments of your program. The compiler will completely ignore your comment, however. You cannot persuade the compiler to do your program eventhough your program has errors.&lt;br /&gt;&lt;br /&gt;In Java, there are three ways of commenting:&lt;br /&gt;Double slash comment.&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#996633;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#996633;"&gt;Example:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#996633;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;// Put your comments hereAfter you put the double slash (//), everything else behind it is considered as comment.Embracing comment.&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#006600;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#006600;"&gt;Example:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;/*&lt;br /&gt;My comment is hereNeat huh?&lt;br /&gt;*/&lt;br /&gt;If your comment is pretty long, it is better to embrace it with&lt;br /&gt;/*&lt;br /&gt;and&lt;br /&gt; */.&lt;br /&gt;&lt;br /&gt;Everything within it is considered as a comment.Java doc comment. It is similar to above, except:&lt;br /&gt;/**My comments here will be put intodocumentation by Javadoc program&lt;br /&gt;*/It is embraced with&lt;br /&gt; /**&lt;br /&gt;and&lt;br /&gt;*/.&lt;br /&gt;&lt;br /&gt;Notice the double star. Your comments within it will be documented by the Javadoc program, an automatic documentation maker from Java SDK package.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-7776091733789769391?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/7776091733789769391/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=7776091733789769391' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/7776091733789769391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/7776091733789769391'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/simple-java-program-lets-look-into-our.html' title=''/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-1532987395071049805</id><published>2008-04-04T05:08:00.001-07:00</published><updated>2008-04-04T05:08:58.991-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='String in Java-4'/><title type='text'>STRING IN JAVA</title><content type='html'>&lt;p style="color: rgb(153, 51, 0);"&gt;&lt;b&gt;Replacing characters in String&lt;/b&gt;  &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;The replace method of String can be used to  replace all occurrences of the specified character with given character.&lt;/span&gt;  &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String replace(char oldChar, int  newchar)&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p style="color: rgb(153, 51, 0);"&gt;&lt;b&gt;Getting substrings&lt;/b&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String class provides substring method to  extract specified portion of the given String. This method has been  overloaded.&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String substring(int startIndex)&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String substring(int startIndex, int  endIndex)&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-weight: bold; color: rgb(153, 51, 0);"&gt;Note:&lt;/span&gt; A new String object containing the  substring is created and returned. The original String won’t be affected.&lt;/span&gt;  &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;If the index value is not valid, a  StringIndexOutOfBoundsException is thrown.&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p style="color: rgb(153, 51, 0);"&gt;&lt;b&gt;Conversions&lt;/b&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String class provides set of static  overloaded valueOf method to convert primitives and object into strings.&lt;/span&gt;  &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;static String valueOf(Object obj)&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;static String valueOf(char[]  character)&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;static String valueOf(boolean b)&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;static String valueOf(char c)&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;static String valueOf(int i)&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;static String valueOf(long l)&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;static String valueOf(float f)&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;static String valueOf(double d)&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p style="color: rgb(153, 51, 0);"&gt;&lt;b&gt;Manipulating Character Case&lt;/b&gt;  &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String class provides following methods to  manipulate character case in String.&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String toUpperCase()&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String toUpperCase(Locale locale)&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String toLowerCase()&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String toLowerCase(Locale locale)&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Note : Original String object is returned if  none of the characters changed, otherwise new String object is constructed and  returned.&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p style="color: rgb(153, 51, 0);"&gt;&lt;b&gt;Miscellaneous methods&lt;/b&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String trim()&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;This method removes white space from the  front and the end of a String.&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int length()&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Returns length of the String.&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String intern()&lt;/span&gt; &lt;/p&gt;    &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;This method returns interned String object,  if already present in the String pool. Otherwise this String is added into the  pool, and then interned reference is returned.&lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-1532987395071049805?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/1532987395071049805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=1532987395071049805' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/1532987395071049805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/1532987395071049805'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/string-in-java_2064.html' title='STRING IN JAVA'/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-6467220380603702810</id><published>2008-04-04T05:07:00.000-07:00</published><updated>2008-04-04T05:08:21.034-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='String in Java-3'/><title type='text'>STRING IN JAVA</title><content type='html'>&lt;p style="font-weight: bold; color: rgb(153, 51, 0);"&gt;String Manipulations &lt;/p&gt;   &lt;p&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;p style="color: rgb(153, 51, 0);"&gt;&lt;b&gt;Reading  characters from String:&lt;/b&gt;&lt;/p&gt;  &lt;p style="color: rgb(153, 51, 0);"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt; &lt;/p&gt;   &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;char charAt(index i)&lt;/span&gt; &lt;/p&gt;   &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Returns char at specified index. An index  ranges from 0 to length() -1.&lt;/span&gt; &lt;/p&gt;   &lt;p&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;p style="color: rgb(153, 51, 0);"&gt;&lt;b&gt;Searching characters in String&lt;/b&gt;&lt;/p&gt;  &lt;p style="color: rgb(153, 51, 0);"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;  &lt;/p&gt;   &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String class provides indexOf method which  searches for the specified character inside the string object. This method has  been overloaded. If the search is successful, then it returns the index of the  char otherwise -1 is returned.&lt;/span&gt; &lt;/p&gt;   &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int indexOf(int c)&lt;/span&gt; &lt;/p&gt;   &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Returns the index of first occurrence of the  argument char.&lt;/span&gt; &lt;/p&gt;   &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int indexOf(int c, int fromIndex)&lt;/span&gt; &lt;/p&gt;   &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Finds the index of the first occurrence of  the argument character in a string, starting at the index specified in the  second argument.&lt;/span&gt; &lt;/p&gt;   &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int indexOf(String str)&lt;/span&gt; &lt;/p&gt;   &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Finds the start index of the first occurrence  of the substring argument in a String.&lt;/span&gt; &lt;/p&gt;   &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int indexOf(String str, int fromIndex)&lt;/span&gt;  &lt;/p&gt;   &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Finds the start index of the first occurrence  of the substring argument in a String, starting at the index specified in the  second argument.&lt;/span&gt; &lt;/p&gt;   &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;The String class also provides methods to  search for a character or string in backward direction. These methods are given  below.&lt;/span&gt; &lt;/p&gt;   &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int lastIndexOf(int ch)&lt;/span&gt; &lt;/p&gt;   &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int lastIndexOf(int ch, int fromIndex)&lt;/span&gt;  &lt;/p&gt;   &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int lastIndexOf(String str)&lt;/span&gt; &lt;/p&gt;   &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int lastIndexOf(String str, int  fromIndex)&lt;/span&gt; &lt;/p&gt;   &lt;p&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-6467220380603702810?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/6467220380603702810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=6467220380603702810' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/6467220380603702810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/6467220380603702810'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/string-in-java_4294.html' title='STRING IN JAVA'/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-1941550710145962839</id><published>2008-04-04T05:05:00.000-07:00</published><updated>2008-04-04T05:07:24.928-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='String in Java-2'/><title type='text'>STRING IN JAVA</title><content type='html'>&lt;p style="color: rgb(153, 102, 51);"&gt;&lt;b&gt;Constructors&lt;/b&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String class provides &lt;a href="http://techiestage.blogspot.com/"&gt;various types &lt;/a&gt;of  constructors to create String objects. Some of them are,&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String()&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Creates a new String object whose content is  empty i.e. “”.&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String(String s)&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Creates a new String object whose content is  same as the String object passed as an argument.&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;a href="http://techiestage.blogspot.com/"&gt;&lt;span style="font-weight: bold; color: rgb(153, 51, 0);"&gt;Note:&lt;/span&gt;&lt;/a&gt; Constructor creates a new string means  it does not intern the String. Interned String object reference can be obtained  by using intern() method of the String class&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String also provides constructors that take  byte and char array as argument and returns String object.&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p style="font-weight: bold; color: rgb(153, 51, 0);"&gt;String equality &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String class overrides the equals() method of  the Object class. It compares the content of the two string object and returns  the boolean value accordingly.&lt;/span&gt; &lt;/p&gt;  &lt;p style="font-weight: bold; color: rgb(153, 51, 0);"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="font-weight: bold; color: rgb(153, 51, 0);"&gt;For example,&lt;/p&gt;&lt;p style="font-weight: bold; color: rgb(153, 51, 0);"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String str1=”Hello”;&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String str2=”Hello”;&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String str3=new String(”Hello”) //Using  constructor.&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;If(str1 == str2)&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;System.out.println(“Equal 1”);&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Else&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;System.out.println(“Not Equal 1”);&lt;/span&gt;  &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;If(str1 == str3)&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;System.out.println(“Equal 2”);&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Else&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;System.out.println(“I am constructed using  constructor, hence&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;not interned”);&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;If( str1.equals(str3) )&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;System.out.println(“Equal 3”);&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Else&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;System.out.println(“Not Equal 3”);&lt;/span&gt;  &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;The output would be,&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Equal 1&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Not Equal 2&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Equal 3&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-weight: bold;"&gt;Note that &lt;/span&gt;== compares the references not the  actual contents of the String object; Where as equals method compares actual  contents of two String objects.&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String class also provides another method  equalsIgnoreCase() which ignores the case of contents while comparing.&lt;/span&gt;  &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Apart from these methods String class also  provides compareTo methods.&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int compareTo(String str2)&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;This method compares two Strings and returns  an int value. It returns value 0, if this string is equal to the string argument  a value less than 0, if this string is less than the string argument&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;a value greater than 0, if this string is  greater than the string argument&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;int compareTo(Object object)&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;This method behaves exactly like the first  method if the argument object is actually a String object; otherwise, it throws  a ClassCastException.&lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-1941550710145962839?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/1941550710145962839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=1941550710145962839' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/1941550710145962839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/1941550710145962839'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/string-in-java_04.html' title='STRING IN JAVA'/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-4121784743312712593</id><published>2008-04-04T05:02:00.000-07:00</published><updated>2008-04-04T05:05:50.002-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='String in Java-1'/><title type='text'>String in Java</title><content type='html'>&lt;p&gt;&lt;b&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="font-size: 180%; font-family: verdana;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Handling character strings in Java is  supported through two final classes: String and &lt;a href="http://techiestage.blogspot.com/"&gt;&lt;span style="color: rgb(153, 102, 51);"&gt;StringBuffer&lt;/span&gt;&lt;/a&gt;. The String class  implements immutable character strings, which are read-only once the string has  been created and initialized, whereas the StringBuffer class implements dynamic  character strings. All string literals in Java programs, are implemented as  instances of String class. Strings in Java are 16-bit Unicode.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Note : In JDK 1.5+ you can use StringBuilder,  which works exactly like StringBuffer, but it is faster and not  thread-safe&lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;The easiest way of creating a String object  is using a string literal:&lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String str1 = "I cant be changed once  created!";&lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;A string literal is a reference to a String  object. Since a string literal is a reference, it can be manipulated like any  other String reference. i.e. it can be used to invoke methods of String  class.&lt;/span&gt; &lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(204, 102, 0);"&gt;&lt;a href="http://techiestage.blogspot.com/"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="font-weight: bold; color: rgb(204, 102, 0);"&gt;&lt;a href="http://techiestage.blogspot.com/"&gt;For example,&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Int myLength = “Hello world”.length();&lt;/span&gt;  &lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;The Java language provides special support  for the string concatenation operator ( + ), which has been overloaded for  Strings objects. String concatenation is implemented through the StringBuffer  class and its append method.&lt;/span&gt; &lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(153, 102, 51);"&gt;&lt;a href="http://techiestage.blogspot.com/"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="font-weight: bold; color: rgb(153, 102, 51);"&gt;&lt;a href="http://techiestage.blogspot.com/"&gt;For example,&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String finalString = “Hello” + “World”&lt;/span&gt;  &lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Would be executed as&lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String finalString = new  StringBuffer().append(“Hello”).append(“World”).toString();&lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;The Java compiler optimizes handling of  string literals. Only one String object is shared by all string having same  character sequence. Such strings are said to be interned, meaning that they  share a unique String object. The String class maintains a private pool where  such strings are interned.&lt;/span&gt; &lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(153, 51, 0);"&gt;&lt;a href="http://techiestage.blogspot.com/"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="font-weight: bold; color: rgb(153, 51, 0);"&gt;&lt;a href="http://techiestage.blogspot.com/"&gt;For example,&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String str1=”Hello”;&lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;String str2=”Hello”;&lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;If(str1 == str2)&lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;System.out.println(“Equal”);&lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Would print Equal when run.&lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Since the String objects are immutable. Any  operation performed on one String reference will never have any effect on other  references denoting the same object.&lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-4121784743312712593?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/4121784743312712593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=4121784743312712593' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/4121784743312712593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/4121784743312712593'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/string-in-java.html' title='String in Java'/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-4690880407940657075</id><published>2008-04-04T04:58:00.000-07:00</published><updated>2008-04-04T05:00:24.693-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Expressions'/><title type='text'>Variables and Expressions</title><content type='html'>&lt;h3 style="color: rgb(204, 0, 0);"&gt;Expressions&lt;/h3&gt;&lt;br /&gt;Of course you can do more in  using &lt;a href="http://javanetinfo.blogspot.com/"&gt;&lt;span style="font-weight: bold;"&gt;vaiables&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 102, 51);"&gt;For example: &lt;/span&gt;You can write some math formula here like the  excerpt below:  &lt;pre&gt;&lt;br /&gt;long E;&lt;br /&gt;int m, c;&lt;br /&gt;&lt;br /&gt;m = 5;&lt;br /&gt;c = 3000;&lt;br /&gt;E = m * c * c;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;  Hey,  that's the famous E = mc&lt;sup&gt;2&lt;/sup&gt; formula! You bet! :-) Of course you can do  more complex equation with Java. These kind of equations will later be called  &lt;a href="http://javanetinfo.blogspot.com/"&gt;&lt;b&gt;expressions&lt;/b&gt;&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt; &lt;p&gt;Keep in mind that Java doesn't have the &lt;tt&gt;^&lt;/tt&gt; operator like BASIC. The  power sign for Java will be discussed later. &lt;/p&gt;   &lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="font-weight: bold; color: rgb(153, 51, 0);"&gt;Oh yes, in case you wonder this line:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;  &lt;pre&gt;      System.out.println("Hi, my name is "+name);&lt;br /&gt;     System.out.println("I am "+age+" years old.");&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;  Well,  to print out variables onto the screen, simply put the plus sign after the text  quotes you want to display, like the first lane in the above example. In the  second line, suppose you want to continue with some more texts, you may add the  plus sign, and again put some texts. Don't forget to wrap up the text with  double quotes as well. If you just want to print out the variables, then you can  do like this:  &lt;pre&gt;System.out.println(myvariable);&lt;/pre&gt;  Hmm... pretty simple, eh?  &lt;h3 style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 style="color: rgb(204, 0, 0);"&gt;Summary&lt;/h3&gt;  To sum up, after following this  lesson, you should understand the meaning of variables and how to use them, and  how to apply expressions in Java. You should understand program scopes and how  it affect variables. Of course, here you also learn how to print out your nice  variables.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-4690880407940657075?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/4690880407940657075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=4690880407940657075' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/4690880407940657075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/4690880407940657075'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/variables-and-expressions.html' title='Variables and Expressions'/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-5623782796325467977</id><published>2008-04-04T04:56:00.000-07:00</published><updated>2008-04-04T04:58:23.034-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Variables'/><title type='text'>Variable and Expressions</title><content type='html'>&lt;p&gt;&lt;b&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="font-size: 180%; font-family: verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;  &lt;/p&gt;&lt;h3 style="color: rgb(153, 0, 0);"&gt;Variables&lt;/h3&gt;What is a variable anyway? You can consider a variable as a  holder for a certain value. There are two kinds of variables: &lt;b&gt;Simple  variable&lt;/b&gt;, which is to be discussed soon, and &lt;b&gt;complex variable&lt;/b&gt;. The  difference between the two is that simple variables can only store one scalar  value, while the complex ones can store more. If you don't understand what  scalar means, don't worry about it. You will understand that anyway later.  &lt;p&gt;How to declare a variable in Java? The variable is declared in the following  format: &lt;tt&gt;&lt;type&gt;&lt;variable_name&gt;;&lt;/variable_name&gt;&lt;/type&gt;&lt;/tt&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="font-weight: bold;"&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;Let's look at the following  example(&lt;/span&gt;&lt;tt style="color: rgb(0, 102, 0);"&gt;Variables1.java&lt;/tt&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;):&lt;/span&gt;&lt;/p&gt;&lt;p style="font-weight: bold;"&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/p&gt;&lt;pre&gt;class Variables1 {&lt;br /&gt;  public static void main(String[] args)&lt;br /&gt;  {&lt;br /&gt;      int age;         // &lt;-- These are the variables:&lt;br /&gt;      String name;     // variable age of type integer&lt;br /&gt;                       // and variable name of type string&lt;br /&gt;&lt;br /&gt;      age = 20;&lt;br /&gt;      name = "John Doe";&lt;br /&gt;&lt;br /&gt;      System.out.println("Hi, my name is "+name);&lt;br /&gt;      System.out.println("I am "+age+" years old.");&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;You  can examine there are two variables: &lt;tt&gt;age&lt;/tt&gt; and &lt;tt&gt;name&lt;/tt&gt;. Of course  you can declare more than two variables. If you want to declare two or more  variables of the same type, you can combine the declaration as follows: &lt;pre&gt;int var1, var2, var3;&lt;/pre&gt;Well, that declaration says that we declare  three variables: &lt;tt&gt;var1&lt;/tt&gt;, &lt;tt&gt;var2&lt;/tt&gt;, and &lt;tt&gt;var3&lt;/tt&gt;. Be careful and  keep in mind that Java is case sensitive, so pay attention to capital letters as  well. Otherwise your program may not work.  &lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;To use variable, i.e. to make the variable store a value, simply put the  equal sign after the variable name like the line &lt;tt&gt;age = 20;&lt;/tt&gt; above. Of  course, you will be able to use variables &lt;a href="http://javanetinfo.blogspot.com"&gt;&lt;b&gt;ONLY AFTER&lt;/b&gt; &lt;/a&gt;you declare them.  However, it is not necessarily to have the variable declaration on the top of  your program like the example above. You can declare them anywhere as long as  before you using them. &lt;/p&gt; &lt;p&gt;There are some basic &lt;b&gt;data types&lt;/b&gt; you should know. Note that this is not  the basic in the technical sense, however, I just point out several data types  that is necessary for you to know first. &lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;tt&gt;int &lt;/tt&gt;is the one that store integer values. Its limit is between  about -2 billion to about +2 billion. Pretty much for simple applications.  &lt;/li&gt;&lt;li&gt;&lt;tt&gt;long &lt;/tt&gt;is the one you need if &lt;tt&gt;int&lt;/tt&gt; is not sufficient for you.   &lt;/li&gt;&lt;li&gt;&lt;tt&gt;float &lt;/tt&gt;is the one that store fractional values like 0.5 and so on.  It's practical limit is huge... don't ask me how big it is... :-)  &lt;/li&gt;&lt;li&gt;&lt;tt&gt;String &lt;/tt&gt;is the one that store sentences and words. So, the best use  for this data type is like to input names, addresses, and so on.  &lt;/li&gt;&lt;li&gt;&lt;tt&gt;char &lt;/tt&gt;is the one that store only one character, either it is a  letter, a space, or a single punctuation mark, and so on. &lt;/li&gt;&lt;/ul&gt;Keep in mind  that in Java, we must acknowledge the scopes of the program in declaring  variables. What is the scope? Well, don't bother on the technical details...  simply consider that the scope is anything between the curly braces &lt;tt&gt;{ ...  }&lt;/tt&gt;. The outer curly braces is called the &lt;b&gt;outer&lt;/b&gt; scope, and the inner  curly braces is called &lt;b&gt;inner&lt;/b&gt; scope. Of course later you would have a lot  more complex braces. If you declare variables in the outer scopes, they are  visible (i.e. usable) by the program lines inside the inner scopes. However, if  you declare variables in the inner scope, you cannot expect the outer scopes to  see it. For the example see the illustration below: &lt;pre&gt;{&lt;br /&gt; :  // Scope A&lt;br /&gt; :  // Suppose variable i is declared here&lt;br /&gt; :&lt;br /&gt;    {&lt;br /&gt;       :&lt;br /&gt;       : // Scope B&lt;br /&gt;       : // Suppose variable j is declared here&lt;br /&gt;          {&lt;br /&gt;             : // Scope C&lt;br /&gt;             : // Suppose variable k is declared here&lt;br /&gt;          }&lt;br /&gt;       :&lt;br /&gt;       : // Scope B continued&lt;br /&gt;       :  // Suppose variable l is declared here&lt;br /&gt;          {&lt;br /&gt;             : // Scope D&lt;br /&gt;             : // Suppose variable m is declared here&lt;br /&gt;          }&lt;br /&gt;       : // Scope B continued&lt;br /&gt;    }&lt;br /&gt; :&lt;br /&gt; : // Scope A continued&lt;br /&gt; : // Suppose variable n is declared here&lt;br /&gt;    {&lt;br /&gt;        : // Scope F&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;If  you create the variable on the scope A, it will visible on all the scope below  it. Like in the case of variable &lt;tt&gt;i&lt;/tt&gt; above, it is visible through all  scopes. In the case of variable &lt;tt&gt;j&lt;/tt&gt;, it is only visible for scope  &lt;tt&gt;C&lt;/tt&gt;, &lt;tt&gt;D,&lt;/tt&gt; and the rest of scope &lt;tt&gt;B&lt;/tt&gt;, but not scope  &lt;tt&gt;A&lt;/tt&gt; and &lt;tt&gt;F&lt;/tt&gt;. In the case of variable &lt;tt&gt;k&lt;/tt&gt;, only scope  &lt;tt&gt;C&lt;/tt&gt; can use it, not even scope &lt;tt&gt;D&lt;/tt&gt;. The same case is variable  &lt;tt&gt;m&lt;/tt&gt;, which can only be used by scope &lt;tt&gt;D&lt;/tt&gt;. For the case of variable  &lt;tt&gt;l&lt;/tt&gt; in scope &lt;tt&gt;B&lt;/tt&gt;, it can only be used by the rest of scope  &lt;tt&gt;B&lt;/tt&gt; and scope &lt;tt&gt;D&lt;/tt&gt;. Scope &lt;tt&gt;C&lt;/tt&gt; cannot use it because the  variable is declared &lt;u&gt;below&lt;/u&gt; scope &lt;tt&gt;C&lt;/tt&gt;. Same case is variable  &lt;tt&gt;n&lt;/tt&gt;, which can only be used by the rest of scope &lt;tt&gt;A&lt;/tt&gt; and scope  &lt;tt&gt;F&lt;/tt&gt;, but not scope &lt;tt&gt;B&lt;/tt&gt; since the variable is declared below  &lt;tt&gt;B&lt;/tt&gt;.  &lt;p&gt;This scope concept is very important to keep in mind. I'd rather to explain  it to you pretty early so that you won't find much difficulties later,  especially in dealing with methods. &lt;/p&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-5623782796325467977?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/5623782796325467977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=5623782796325467977' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/5623782796325467977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/5623782796325467977'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/variable-and-expressions.html' title='Variable and Expressions'/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-4297831340958541248</id><published>2008-04-04T04:51:00.000-07:00</published><updated>2008-04-04T04:55:19.959-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Extensible Markup Language'/><title type='text'>XML (Extensible Markup Language)</title><content type='html'>&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;1. Introduction&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;XML (Extensible  Markup Language)&lt;/span&gt; is a markup language that is used as a standard format  for data. Since XML is structured, platform independent, textual information it  is chosen as the best choice for data exchange in Web applications. XML serves  the purpose as the tool for data exchange between the disparate applications in  our project operating on different platforms. In our project IBM’s XML4J parser  for XML has been used for parsing XML documents since it is totally written in  Java and hence compatible with the architecture of our project. Our application  creates an XML document with credit card information.&lt;br /&gt;&lt;br /&gt;The credit card XML  document is validated against a Document Type Definition, for all Creditcard  information exchange, by a third party application like a dummy banking  application. If the XML document is found to be valid, the Banking application  retrieves data from the XML document and prints it out in HTML  format.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0); font-weight: bold;"&gt;&lt;br /&gt;2. Writing XML document through  a Servlet&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;2.1 The user Interface&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The data, which is to be  written into an &lt;a href="http://javanetinfo.blogspot.com/"&gt;XML&lt;/a&gt; document is furnished by the user in a screen, meant for the  data entry. The Screen is a JSP page that has text fields for entering Credit  card Information like&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;· Credit card Name&lt;br /&gt;&lt;br /&gt;· Name on the Credit card&lt;br /&gt;&lt;br /&gt;·  Creditcard Number&lt;br /&gt;&lt;br /&gt;· Expiration Month&lt;br /&gt;&lt;br /&gt;· Expiration Year&lt;br /&gt;&lt;br /&gt;The user  enters the data and presses “Next” button to move ahead in the Registration  process (This Screen is a part of New User Registration in our project). But the  validity of the data, the user has furnished, need to be validated for verifying  the authenticity of the Information provided. Hence the Creditcard Information  is sent to a Banking Application. First of all, Let us see how the data entered  by the user is put into an XML document.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 51, 0);"&gt;2.2 Writing the XML  Document&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The data entered from the page above are posted to a Servlet,  CreditcardServlet.class file, the code for which is given below. The comments  inserted between the code explain the functionality of the  Servlet.&lt;br /&gt;&lt;br /&gt;CreditcardServlet&lt;br /&gt;/****************************************************************************************&lt;br /&gt;*  Class : CreditcardServlet&lt;br /&gt;*&lt;br /&gt;* Author : Lakshmanan .K&lt;br /&gt;*&lt;br /&gt;*  Functionality : This class gets credit card data posted from the&lt;br /&gt;Creditcard  details entry screen&lt;br /&gt;and writes the data into an XML  file.&lt;br /&gt;*************************************************************************************/&lt;br /&gt;&lt;br /&gt;/************************************&lt;br /&gt;Import  the required packages for the  servlet&lt;br /&gt;*************************************/&lt;br /&gt;import java.io.*;&lt;br /&gt;import  java.text.*;&lt;br /&gt;import java.util.*;&lt;br /&gt;import javax.servlet.*;&lt;br /&gt;import  javax.servlet.http.*;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class CreditcardServlet extends  HttpServlet {&lt;br /&gt;&lt;br /&gt;public void doGet(HttpServletRequest  request,&lt;br /&gt;HttpServletResponse response)&lt;br /&gt;throws IOException,  ServletException&lt;br /&gt;{&lt;br /&gt;/*******Get the data from Creditcard Entry  Details******/&lt;br /&gt;/******* Gets data for Creditcard Type  **************/&lt;br /&gt;String type = request.getParameter  ("creditCardType");&lt;br /&gt;&lt;br /&gt;/******* Gets data for Creditcard Name  **************/&lt;br /&gt;String name = request.getParameter  ("creditCardName");&lt;br /&gt;&lt;br /&gt;/******* Gets data for Creditcard Number  **************/&lt;br /&gt;String cardNumber = request.getParameter  ("creditCardNumber");&lt;br /&gt;&lt;br /&gt;/******* Gets data for Expiration month of the card  **************/&lt;br /&gt;String month = request.getParameter  ("expirationMonth");&lt;br /&gt;&lt;br /&gt;/******* Gets data for Expiration year of the card  **************/&lt;br /&gt;String year = request.getParameter  ("expirationYear");&lt;br /&gt;&lt;br /&gt;/*******Writes the data posted from the JSP&lt;br /&gt;Page  into an XML file ************/&lt;br /&gt;&lt;br /&gt;/******* Create a new output file  ************/&lt;br /&gt;File outputFile= new File  ("examples/CREDITCARD.xml");&lt;br /&gt;&lt;br /&gt;/******* Create a new output stream  ************/&lt;br /&gt;FileOutputStream fos= new  FileOutputStream(outputFile);&lt;br /&gt;&lt;br /&gt;/******* The string “s” holds all the  contents of the XML document&lt;br /&gt;The XML document is written with conformance to  a DTD, the Document&lt;br /&gt;Type definition for the XML document. The discussion  about the DTD is&lt;br /&gt;Given at the end of the Servlet code  *********************/&lt;br /&gt;String s= new String ("\n"+&lt;br /&gt;/***** DTD Declaration  *****/&lt;br /&gt;"\n"+&lt;br /&gt;/***** Root element for the XML Document  *******/&lt;br /&gt;"\n"+&lt;br /&gt;/***** USER tag which encapsulates all the other&lt;br /&gt;credit  card information for a single user *****/&lt;br /&gt;"\n"+&lt;br /&gt;&lt;br /&gt;/*** Card type data  put in between CARDTYPE XML tags ***/&lt;br /&gt;""+type+"\n"+&lt;br /&gt;&lt;br /&gt;/*** Card name  data put in between CARDNAME XML tags ***/&lt;br /&gt;""+name+"\n"+&lt;br /&gt;&lt;br /&gt;/*** Card  Number data put in between CARDNUMBER XML tags  ***/&lt;br /&gt;""+cardNumber+"\n"+&lt;br /&gt;&lt;br /&gt;/*** Expiration month data put in between  EXPIRATIONMONTH XML tags ***/&lt;br /&gt;""+month+"\n"+&lt;br /&gt;&lt;br /&gt;/*** Expiration year data  put in between EXPIRATIONYEAR XML tags ***/&lt;br /&gt;""+year+"\n"+&lt;br /&gt;&lt;br /&gt;/*** End the  user element tag ***/&lt;br /&gt;"\n"+&lt;br /&gt;&lt;br /&gt;/*** End the Root element CREDITCARD tag  ***/&lt;br /&gt;"");&lt;br /&gt;&lt;br /&gt;/***** New string reader initialized *****/&lt;br /&gt;StringReader  sr= new StringReader(s);&lt;br /&gt;int c;&lt;br /&gt;/***** Ouputstream writes the string into  the file *****/&lt;br /&gt;while((c=sr.read())!=-1)&lt;br /&gt;fos.write(c);&lt;br /&gt;&lt;br /&gt;//calls the  next page which gives links to the XML document created and&lt;br /&gt;//and the XML to  HTML functionality  getServletConfig().getServletContext().getRequestDispatcher("/jsp/auction/XMLCreated.jsp").forward(request,  response);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void doPost(HttpServletRequest  request,&lt;br /&gt;HttpServletResponse response)&lt;br /&gt;throws IOException,  ServletException&lt;br /&gt;{&lt;br /&gt;doGet(request, response);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;Return  servlet information&lt;br /&gt;&lt;br /&gt;@return message about this servlet&lt;br /&gt;*/&lt;br /&gt;public  String getServletInfo(){&lt;br /&gt;return "CreditcardServlet";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The servlet , as explained clearly in the comments, writes the posted data into  an XML document. While the XML document is written, it is taken care that the  document confirms to the Document Type Definition for Credit card XML  documents.&lt;br /&gt;&lt;br /&gt;The XML document has to be validated against a standard to  verify its validity and make it shareable with disparate applications. The  DOCTYPE declaration in the XML document refers to a Document Type Definition  that is stored in a specific URL.&lt;br /&gt;&lt;br /&gt;An XML document is valid if its content  conforms to the rules in its DTD. A DTD is a grammar that describes what tags  and attributes are valid in an XML document and in what context they are valid.  The Document type declaration can make reference to an external DTD or include  the DTD internally.&lt;br /&gt;&lt;br /&gt;The Document Type Definition (DTD) written  exclusively for this credit card information sharing application is given  below.&lt;br /&gt;&lt;br /&gt;CREDITCARD.dtd&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The Document Type Definition is kept in a URL common to the Applications, which  share the data. The Document type definition can be In-line too, i.e. it can be  part of the XML document itself. The DTD starts with the XML declaration  statement. Then it defines the Root element, which encapsulates all other  elements. Subsequently all other elements are defined, the content of the  elements, their attributes, the other elements which they encapsulate,  etc.,&lt;br /&gt;&lt;br /&gt;Let us see how the XML document created by the Creditcard servlet looks  like&lt;br /&gt;&lt;br /&gt;The picture above shows the XML file created, in IE 5.0 Browser. IE  5.0 has an in-built XML parser which does the validation against the document  type definition for that XML document and displays the tree structure XML  document. If the XML document is not well-formed, i.e. the document is not  syntactically correct, or if the XML document is not valid, i.e. it does not  confirm with the Document Type Definition, the Parser throws out an error and  the IE browser does not display the XML document. It simply displays the error  message.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-4297831340958541248?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/4297831340958541248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=4297831340958541248' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/4297831340958541248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/4297831340958541248'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/xml-extensible-markup-language.html' title='XML (Extensible Markup Language)'/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-829291748707459794</id><published>2008-04-04T04:49:00.000-07:00</published><updated>2008-04-04T04:51:22.703-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Wrapper Classes'/><title type='text'>Wrapper Classes</title><content type='html'>&lt;span style="color: rgb(204, 102, 0);"&gt;&lt;strong&gt;What are Wrapper  Classes?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Describe the wrapper classes in Java.Wrapper  classes are classes that allow primitive types to be accessed as  objects.&lt;br /&gt;&lt;br /&gt;Wrapper class is wrapper around a primitive data  type.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;&lt;strong&gt;&lt;em&gt;Following table lists the primitive types and  the corresponding wrapper  classes:&lt;br /&gt;&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;Primitive&lt;br /&gt;&lt;br /&gt;Wrapper&lt;br /&gt;&lt;br /&gt;Boolean&lt;br /&gt;&lt;br /&gt;java.lang.Boolean&lt;br /&gt;&lt;br /&gt;Byte&lt;br /&gt;&lt;br /&gt;java.lang.Byte&lt;br /&gt;&lt;br /&gt;Char&lt;br /&gt;&lt;br /&gt;java.lang.Character&lt;br /&gt;&lt;br /&gt;double&lt;br /&gt;&lt;br /&gt;java.lang.Double&lt;br /&gt;&lt;br /&gt;Float&lt;br /&gt;&lt;br /&gt;java.lang.Float&lt;br /&gt;&lt;br /&gt;Intjava.lang.Integer&lt;br /&gt;&lt;br /&gt;Longjava.lang.Long&lt;br /&gt;&lt;br /&gt;Shortjava.lang.Short&lt;br /&gt;&lt;br /&gt;Void&lt;br /&gt;&lt;br /&gt;java.lang.Void&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-829291748707459794?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/829291748707459794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=829291748707459794' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/829291748707459794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/829291748707459794'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/04/wrapper-classes.html' title='Wrapper Classes'/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-8660406694142291328</id><published>2008-03-31T23:01:00.001-07:00</published><updated>2008-03-31T23:02:42.842-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='History of Java-2'/><title type='text'>History of Java</title><content type='html'>&lt;p style="color: rgb(51, 51, 255);"&gt;But C++ was still complex with things like  pointers, memory leak and multiple inheritence. The pointer concept was taken  from C and it was very messy! The pointer is special type of variable that  points to other variables. Since there was no guidelines as to how to use these  pointers, it was very easy loose track of them.&lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(51, 51, 255);"&gt;In a typical two thousand lines  program, one would frequently end up with hundredes of pointers pointing to  thousands, some of them are pointers and some just plain variables. Needless to  say this made a large program extremely difficult to read and when the  programmer left for another company, they would have no other choice than to  just throw away his program! It was sometimes necessary to do this even when the  programmer was around and very much alive.&lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(51, 51, 255);"&gt;This is because the pointers he  created inside his program had taken a life of their own and defy every attempt  to predict how the program should behave. Memory management was also another  weak point of C and C++. The programmer was responsible for cleaning up the  memory their program would allocate and use. Failure to do so will result in a  crash of the whole computer.&lt;/p&gt;&lt;br /&gt; &lt;p style="color: rgb(51, 51, 255);"&gt;Multiple inheritence, though sparingly used,  was another feature of C++ which made a programmer's life miserable. It,  however, had its use, especially in job interviews. This one question, they  thought, helped them separate the wheat from the chaff. &lt;/p&gt;  &lt;p style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(51, 51, 255);"&gt;But C++ still had some nice and simple  features, like inheritence, encapsulation, etc. They are something one can  describe in plain english, something one can explain to a layman. So the creator  of java decided to take the good features of inherience, encapsulation, and  polymorphism from C++, while discarding the bad features such as multiple  inherience, pointers etc. The memory management was improved in java where the  programmer will not be held responsible for memory management. They can clean up  after themselves if they want to get extra credit, but they do not need to.  Needless to say all these was great news to the tourists in Indonesia!&lt;/p&gt;&lt;p style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p style="color: rgb(51, 51, 255);"&gt;Java introduced lot of clarity in notations  too. For example, in C++ they would say class doctor:person to mean doctor is  derived from person. It is obviously very cryptic. The same situation can be  expressed in java as class doctor extends person , which is much easier to  understand. But there are few awkward stuff in java too especially when someone  says class bum extends person (my last bum joke)!&lt;/p&gt;&lt;p style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p style="color: rgb(51, 51, 255);"&gt;Java made an important contribution in the  graphical user interface (GUI) area. C++ was really lacking in expertise here.  They visual C++, but worked only on windows environment. But it did not work in  UNIX systems or mackintoshes. Just like other features of java, this was also  supposed to be platform independent. This was further necessary because one can  put some little GUI on a web page which can be views over the internet. And one  cannot control what kind of computers other will have.&lt;/p&gt;&lt;p style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p style="color: rgb(51, 51, 255);"&gt;After a while, it was necessary to call  programs from one computer to another computer. To do this, they created J2EE. I  am not sure how they came up with the name J2EE. The 'J' of J2EE, of course,  means "Java", and I can be reasonably sure '2' stands for 'To'. But I do not  know what the 'EE' part is all about, probably some kind of extension. Or at  this point they ran out of names to think of. So they decided to have one of  those just another vague acronyms.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-8660406694142291328?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/8660406694142291328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=8660406694142291328' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/8660406694142291328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/8660406694142291328'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/03/history-of-java.html' title='History of Java'/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7480207249380608993.post-7429857642075674505</id><published>2008-03-30T00:20:00.000-07:00</published><updated>2008-03-31T23:01:13.568-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='History of Java-1'/><title type='text'>History of Java</title><content type='html'>&lt;p&gt;&lt;b&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="font-size: 180%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style="font-family: Arial;"&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="font-size: 180%;"&gt;History of  Java&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(51, 51, 255);"&gt;The java programming language is becoming more  and more popular each day. It is the language without which one cannot even hope  to a land a job these days. But has somebody even wondered how this language  came about? There are many stories about, many books have been written. Here is  my version (not approved by Sun Microsystems).&lt;/p&gt;&lt;p style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="color: rgb(51, 51, 255);"&gt;The java programming language originated in  Indonesia. It was meant to be used by the tourists that visit that country each  year. Why would tourists want to use computer? Well, these are no ordinary  tourists. They are rich tourists. Have they not been rich, they would not travel  half way around the world to visit this place. Most people would be content to  see just what is available near by. For example, if you are a texan living in  Dallas, you will visit the stockyards or may be the trinity river park. If you  live in New Orleans area, you would see st. mary's bayou. Once in your lifetime,  one will probably visit Hawaii or Niagara.&lt;/p&gt;&lt;p style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(51, 51, 255);"&gt; But going to Indonesia and its  islands, Bali, Java, etc is not for the ordinary people. Anyway, coming back to  the question why these tourists need to use computer programs. They go there not  just to have fun and also get some work done in a fun atmosphere as these people  are very important people. &lt;/p&gt; &lt;p style="color: rgb(51, 51, 255);"&gt;From the very start java was supposed to be  computer independent. That means if you write a program in java in one computer,  it should run in all computers. This was necessary because tourists bring all  kinds of computers with them. Some bring Windows machine, some Apple mackintosh.  Some of the affluent ones bring Sun server workstations or even a super  computer. &lt;/p&gt; &lt;p style="color: rgb(51, 51, 255);"&gt;Before starting to create java they also sought  to see if there have similar stuff done already. Even though they could find  none, they found they can use lots of feature from some existing laguages.&lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(51, 51, 255);"&gt;One  such language they found was C++. C++ was an advancement over the language  called C. In fact, ideas of C++ was already hidden in C. In that language, one  can increment a variable, say i, by applying the ++ operator e.g. i++. This  would increase the value of the variable i by one. If i had a value of 5, it  would make it 6, etc. What a vision! &lt;/p&gt; &lt;p style="color: rgb(51, 51, 255);"&gt;Anyway, coming back to C++, it made an  important advancement over C by introducing the idea of a class. To understand  class, one has to undestand structure which was already used in C. The structure  is a group of variables. For example, you have a name, an address, age etc. for  any person.&lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(51, 51, 255);"&gt;In stead of using them separately, in C one can group them together  and call it a person. The creator of C++ said there is no need to expose these  variables (name, address, etc) to the outside world. They said these details  should be hidden from the outside world. They called this concept encapsulation.&lt;/p&gt;&lt;p style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt; &lt;/p&gt; &lt;p style="color: rgb(51, 51, 255);"&gt;Another important contribution of C++ was the  concept of inheritence. This concept can be best explained by example. Let's go  back to the example of the person. A person is very general concept. There can  be many different kinds of persons, e.g doctors, lawyers, teachers, or just a  bum! But each of these people have a name, an address, age etc.&lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(51, 51, 255);"&gt;Even a bum has  all these. The creator of C++ thought one can define a base class call person  and other classes can be derived from it. In plain english, this would mean, a  doctor is special kind of person, lawyer is another special kind of person. Now  the common attributes of all these kinds of people can be put in the person  class and special attributes can be put in the derived classes, e.g. hospital  for the doctor, court for the lawyer, and nothing for the bum. &lt;/p&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;&gt;&gt;Next&gt;&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7480207249380608993-7429857642075674505?l=javanetinfo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javanetinfo.blogspot.com/feeds/7429857642075674505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7480207249380608993&amp;postID=7429857642075674505' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/7429857642075674505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7480207249380608993/posts/default/7429857642075674505'/><link rel='alternate' type='text/html' href='http://javanetinfo.blogspot.com/2008/03/j2ee-interview-questions.html' title='History of Java'/><author><name>Its For Techies</name><uri>http://www.blogger.com/profile/04854561330824512840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
