Pages

Wednesday, May 8, 2013


Advantages of hibernates:
·         Hibernate supports InheritanceAssociationsCollections
·         In hibernate if we save the derived class object,  then its base class object will also be stored into the database, it means hibernate supporting inheritance
·         Hibernate supports relationships like One-To-Many,One-To-One, Many-To-Many-to-Many, Many-To-One
·         This will also supports collections like List,Set,Map (Only new collections)
·         In jdbc all exceptions are checked exceptions, so we must write code in try, catch and throws, but in hibernate we only have Un-checked exceptions, so no need to write try, catch, or no need to write throws.  Actually in hibernate we have the translator which converts checked to Un-checked 
·         Hibernate has capability to generate primary keys automatically while we are storing the records into database
·         Hibernate has its own query language, i.e hibernate query language which is database independent
·         So if we change the database, then also our application will works as HQL is database independent
·         HQL contains database independent commands
·         While we are inserting any record, if we don’t have any particular table in the database, JDBC will rises an error like “View not exist”, and throws exception, but in case of hibernate, if it not found any table in the database this will create the table for us ;)
·         Hibernate supports caching mechanism by this, the number of round trips between an application and the database will be reduced, by using this caching technique an application performance will be increased automatically.
·         Hibernate supports annotations, apart from XML
·         Hibernate provided Dialect classes, so we no need to write sql queries in hibernate, instead we use the methods provided by that API.
·         Getting pagination in hibernate is quite simple.



Benefits of Using Spring Framework

·         Spring is Lightweight container
·         No App Server Dependent – like EJB JNDI Calls
·         Objects are created Lazily , Singleton - configuration
·         Components can added Declaratively
·         Initialization of properties is easy – no need to read from properties file
·         Declarative transaction, security and logging service – AOP


Unchecked 
·         ArrayIndexOutOfBoundsException
·         ClassCastException 
·         IllegalArgumentException 
·         IllegalStateException 
·         NullPointerException 
·         NumberFormatException 
·         AssertionError 
·         ExceptionInInitializerError 
·         StackOverflowError 
·         NoClassDefFoundError 

Checked 
·         Exception 
·         IOException 
·         FileNotFoundException 
·         ParseException 
·         ClassNotFoundException 
·         CloneNotSupportedException
·         InstantiationException 
·         InterruptedException
·         NoSuchMethodException
·         NoSuchFieldException












AJAX
AJAX = Asynchronous JavaScript and XML
AJAX is a technique for creating fast and dynamic web pages.
AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page.

AJAX










xmlhttp.open("GET","ajax_info.txt",true);
xmlhttp.send();
Method
Description
open(method,url,async)
Specifies the type of request, the URL, and if the request should be handled asynchronously or not.

method: the type of request: GET or POST
url: the location of the file on the server
async: true (asynchronous) or false (synchronous)
send(string)
Sends the request off to the server.

string: Only used for POST requests


Method
Description
setRequestHeader(header,value)
Adds HTTP headers to the request.

header: specifies the header name
value: specifies the header value

Property
Description
responseText
get the response data as a string
responseXML
get the response data as XML data

Property
Description
onreadystatechange
Stores a function (or the name of a function) to be called automatically each time the readyState property changes
readyState
Holds the status of the XMLHttpRequest. Changes from 0 to 4:
0: request not initialized
1: server connection established
2: request received
3: processing request
4: request finished and response is ready
status
200: "OK"
404: Page not found

No comments:

Post a Comment