Archive | Java
Steps to use hibernate into an application
1. Load the Hibernate Into Configuration File: -
Configuration conf = new Configuration ();
Conf. Configure (“anyname.cfg.xml”);
2. Parse The Loaded Xml And Generate SessionFactory: -
SessionFactory factory = conf. buildSessionFactory ();
3. Open a Session from SessionFactory: -
It internally opens a connection
Session ses = factory. openSession ()
Hibernate Over JDBC
Limitations of JDBC:-
1. Connection management is complex.
2. If the database schema modified after JDBC application is developed then again we need to reopen and we need to modify the JDBC application. It means debugging of JDBC application is complex.
3. JDBC only transfers data between an application and database in the form of text but not in the form of object.
(more…)
Yep.... I couldn't have said it better myself......