Wednesday, March 27, 2013

Spring Framework - MethodReplacer Example in spring


Spring framework with AOP show many magic.One of them is Method Replacer .In this activity the called method is replaced by another method. To understand clearly have a good example-
Directory Structure-

Tuesday, March 26, 2013

Spring Framework - Example of Database Connectivity with DataSource


After lot of basic tutorials and topics now we start database connectivity .In spring framework DataSource in used to define the database configuration.In XML configuration file use DriverManagerDataSource class is used to set the database configuration like driver,pool,username and password.so understand clearly here below is a simple example-
Directory Structure-
                                                           

Monday, March 25, 2013

Spring Framework- Execption handling in AOP


Hureeeee!!!!!  Today in spring framework we learn some intresting with AOP, so today topic is Execption handling. AOP contain a method proceed() . If this method is proceed with exception then it pass the controll of the program to the catch block, In That type examples we can also used @AfterThrowing , @AfterReturning ,@Around . here we use @Around annotation to follow the AOP. So here below is the example --


Spring Framework - Example to use @Before annotation with args() in AOP


Here In AOP, we discuss that how use @Before(args()).Here args() is contain the name of arguments with pass to the function and also can use that argument.Now see a example to understand that-

Monday, March 18, 2013

Spring Framework-Example to use JoinPoint in AOP


Hello Friends, After discussing the pointcuts in last post Now discuss on Joinpoint . A Joinpoint is a point in the execution of the application where an aspect can be plugged in. this point could be a method being called Here is a example to understands the use of pointcuts-

Sunday, March 17, 2013

Spring Framework- Example to Use Pointcuts in AOP


In Aspect Oriented Programming (AOP) Advice define the what and when we call . The Pointcuts define where.A pointcut definition matches one or more jointpoints .Here discuss a simple example to use pointcut -

Directory Structure-


Saturday, March 16, 2013

Spring Framework- Simple Aspect Oriented Programming Example


                     Aspect Oriented Programming basically provide alternative way to achive the inheritance and the delegation.In AOP define the comman fuctionality in one place,but you can define where and how this functionlity is applied.  The basic example of the aspect oriented programming is describe here-

Directory Structure-

Tuesday, November 6, 2012

JSP Tutorials


Lets learn JSP step by step with easy tutorials and examples. To get all tutorials click on below link-

Click to get JSP tutorials.

How to jsp is process in web application ?


Here we discuss how a jsp page is processed in web application when it is requested by the users-



1. First time JSP page is loaded by the JSP container which is also called jsp engine(Where the JSPs complied) .Here the Jsp generated and complied java code which is called  servlet code . This code is loaded in servlet engine. This process is occurs on translation time . It is important to note that this occurs only the first time when jsp is requested.

What are the differences between jsp and servlet ?


 Both techniques are used to handle the web request in java or creating dynamic content with web pages-

Servlets- servlets executed on server and acting as a middle layer between clients and lower level applications.servlets contain the html code in java program. servlets are well suited to deciding how to handle client requests and invoke them but are not well suited for generating contents.Here markup code is harder to implement or maintain in web application. Developers need more experience of java to written servlets.

JSP- Jsp designed and developed less like programs and more like web pages.Generating html is much easier than servlets. Java code is written in html program or in html code.Jsp can use java bean with specified scope(Session,Request).

What is JSP ?


JSP stands for java server pages. JSP is server sided language which execute only server .The goal of the JSP specification is , creation and management of dynamic web pages. it provide more convenient way than servlets.JSP pages combine static markup like HTML,XML with scripting tags. The main thing is that each server page is translated into servlet the first time invoked.

              Version of JSP 1.0  released in September 1999 and JSP 1.2 released in December 1999.

Monday, November 5, 2012

XML parsing in java


XML is a good thing to cntaint database and other information. Java use parsers to read and write the xml data so here we learn how we can use xml in our java application.Here provided step by step tutorials with example to understand the functionality of XML with java.

Lets click here to learn XML and XML parsing in java.

Sunday, November 4, 2012

What is XML ?


Markup language that define a set of rules for encoding documents in a form that is both human-readable and machine-readable.
• It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications.
 • Can be embedded with all types of oop language with parsing.
 Benefits-
 1. Simple
 2. Self description
3. Contains machine readable context information
 4. Facilitates the aggregation of data
5. Can embed multiple datatypes and existing data.

How to insert a record in table using hibernate.


Hibernate is a ORM.To insert the record in table basically a object is inserted which contain the all attribute of that record field. for insertion create a bean class of that types variable and apply getter and setter property.now initialize a object of that class inject the values and save the object after it the table is updated and record is inserted.

To see the code click here.

Saturday, November 3, 2012

How to write hibernate code in java application


To use hibernate first setup the environment of hibernate .After that need to create some files in application as-

1. Hibernate.cfg.xml file contain database configuration,connection pool,user,username,password and other sql information. the main thing is that we can not change file name the name always as it is.

<hibernate-configuration>
<session-factory>
  <property name="hibernate.connection.driver_class">
     com.mysql.jdbc.Driver</property>
  <property name="hibernate.connection.url">
jdbc:mysql://localhost:3306/hibern</property>
  <property name="hibernate.connection.username">root</property>
  <property name="hibernate.connection.password">root</property>
  <property name="hibernate.connection.pool_size">10</property>
  <property name="show_sql">true</property>
  <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
  <property name="hibernate.hbm2ddl.auto">update</property>
  <!-- Mapping files -->
  <mapping resource="createtable.hbm.xml">
 </mapping></session-factory>
  </hibernate-configuration>

How to set Hibernate environment in java application


To provide the ORM in java application need to implement the hibernate. To implement the hibernate need the jars or libraries which is provided by hibernate download these jar and add these jar in application and use the benefits of hibernate.

To download the Hibernate jars click on below link-

http://sourceforge.net/projects/hibernate/files/hibernate3/3.6.10.Final/hibernate-distribution-3.6.10.Final-dist.tar.gz/download

After download that library. add these jars in project. now application is ready to use hibernate.

Friday, November 2, 2012

What is Hibernate ?


Hibernate is an object-relational mapping (ORM) library for the Java language, providing a framework for mapping an object-oriented domain model to a traditional relational database. Hibernate solves object-relational impedance mismatch problems by replacing direct persistence-related database accesses with high-level object handling functions.
Hibernate is free software that is distributed under the GNU Lesser General Public License. Hibernate's primary feature is mapping from Java classes to database tables (and from Java data types to SQL data types). Hibernate also provides data query and retrieval facilities. It also generates the SQL calls and attempts to relieve the developer from manual result set handling and object conversion and keep the application portable to all supported SQL databases with little performance overhead



Thursday, July 26, 2012

Hibernate Tutorials


Lets learn Hibernate with fun. Here provide step by step tutorials to learn Core Hibernate or Hibernate+Spring ,with simple  and easily understandable example .
visit to see contains of Hibernate-http://www.technicaltoday.com/p/hibernate.html

What is ORM ?


ORM stands for Object Relation Mapping.The term Object Relation Mapping refers the technique to map the data from an object model representation to a relation data model.ORM provide the mapping for java classes with hibernate and it also provides data query and retrieval facilities.It remove the overhead of manually data handling in SQL and JDBC.

Now days Hibernate which is provided for java classes use that technique.   

Monday, June 25, 2012

Spring Framework Tutorials


Lets learn spring framework with fun. Here provide step by step tutorials to learn spring framework,with simple  and easily understandable example .
visit to see contain of spring framework  -http://www.technicaltoday.com/p/spring.html


 

Site Status

Man Behind Technical Today

Hello, I am Navin Bansal. I am a student of MCA in Rajsthan Institute of Engineering and Technology and owner of this blog. I share my view and ideas among people.