java jar file creation with manifest file
jar cfm Parser.jar META-INF/MANIFEST.MF com/*
To create sesion obj
Httpsession sesobj=request.getSession();
Scenario 1: when new is used to instantiate obj
String str=new String("hihello");
String str1="hi"+"hello";
String str2="hihello";
if(str.equals(str2))
System.out.println("str equals str2");
if(str==str2)
System.out.println("str == str2 ");
if(str.equals(str1))
System.out.println("str equals str1");
if(str==str1)
System.out.println("str == str1 is equal");
o/p:
str equals str2
str equals str1
Scenario 2:
String str="hihello";
String str1="hi"+"hello";
String str2="hihello";
if(str.equals(str2))
System.out.println("str equals str2");
if(str==str2)
System.out.println("str == str2 ");
if(str.equals(str1))
System.out.println("str equals str1");
if(str==str1)
System.out.println("str == str1 is equal");
o/p:
str equals str2
str == str2
str equals str1
str == str1 is equal
hascode:
by overriding hashCode() method we can give our own integer no to particular obj
and by overriding equals() we can compare objects
Hibernate :
load() returns value from cache
it ll not hit db every time
get() returns value from db
every time it ll hit service
Spring:
IOC
To create and maintain objects by spring not manually
default scope is singleton
7 modules in spring:
AOP,Jdbc and Dao, Web module, MVC ,IOC,Core,App Context
App context in spring :
supports internationalization,
contains info abt service beans.
BeanFactory:
creates obj for particular beans by reading xml file
Autowiring :
|||ly autodetect are there
Bean config in xml:
Collection of beans
Obj of 1 bean passed to other bean
Sample:
jar cfm Parser.jar META-INF/MANIFEST.MF com/*
To create sesion obj
Httpsession sesobj=request.getSession();
Scenario 1: when new is used to instantiate obj
String str=new String("hihello");
String str1="hi"+"hello";
String str2="hihello";
if(str.equals(str2))
System.out.println("str equals str2");
if(str==str2)
System.out.println("str == str2 ");
if(str.equals(str1))
System.out.println("str equals str1");
if(str==str1)
System.out.println("str == str1 is equal");
o/p:
str equals str2
str equals str1
Scenario 2:
String str="hihello";
String str1="hi"+"hello";
String str2="hihello";
if(str.equals(str2))
System.out.println("str equals str2");
if(str==str2)
System.out.println("str == str2 ");
if(str.equals(str1))
System.out.println("str equals str1");
if(str==str1)
System.out.println("str == str1 is equal");
o/p:
str equals str2
str == str2
str equals str1
str == str1 is equal
hascode:
by overriding hashCode() method we can give our own integer no to particular obj
and by overriding equals() we can compare objects
Hibernate :
load() returns value from cache
it ll not hit db every time
get() returns value from db
every time it ll hit service
Spring:
IOC
To create and maintain objects by spring not manually
default scope is singleton
7 modules in spring:
AOP,Jdbc and Dao, Web module, MVC ,IOC,Core,App Context
App context in spring :
supports internationalization,
contains info abt service beans.
BeanFactory:
creates obj for particular beans by reading xml file
Autowiring :
|||ly autodetect are there
Bean config in xml:
Collection of beans
Obj of 1 bean passed to other bean
Sample:
Spring JDBC:
Jdbctemplate.save
.update
.delete
Spring mvc:
RequestAttribut.Get orPost
then, BindingResult BO|VOBean class obj
Hibernate:
ORM f/w
Sophisticated cache
1 level cache ---single user
2 level cache --- multi user,
has native query .
IBatis
JDBC f/w,
returns resultset obj,
obj maps sql in table
no native query