Session-01
Hibernate Framework ?
Why we use Hibernate ?
Example-1 JDBC MYSQL SQL SERVER Oracle MYSQL Query SQL SERVER Query ORACLE Query
Result
Example-2 JDBC MYSQL Load DB Driver Get Connection Create Statement SQL Query SQL Result Set Oracle Load DB Driver Get Connection Create Statement SQL Query SQL Result Set
Result
Example-3 MYSQL JDBC CODE FOR MYSQL A.javaA.class ORACLE JDBC CODE FOR ORACLE A.javaA.class Compile Recompile
Result
Solution?
Solution-1 & 2 Hibernate(ORM) MYSQL SQL SERVER Oracle MYSQL Dialect SQL SERVER Dialect ORACLE Dialect HQL
Solution-3 Hibernate Configuration File Hibernate Configuration File A.class Compile MYSQL XML A.class Oracle SQL Server Compile
Pros and Cons of JDBC
Solution... ORM
What is ORM? ORM stands for Object-Relational Mapping (ORM) is a programming technique for converting data between relational databases and object oriented programming languages such as Java, C# etc.
Continue...
Java ORM Frameworks:
Hibernate Overview Hibernate framework simplifies the development of java application to interact with the database. Hibernate is an open source, lightweight ORM tool.
Advantages of Hibernate Framework 1) Opensource and Lightweight 2) Fast performance: The performance of hibernate framework is fast because cache is internally used in hibernate framework. 3) Database Independent query: HQL (Hibernate Query Language) is the object-oriented version of SQL. 4) Au tomatic table creation 5) Simplifies complex join To fetch data form multiple tables is easy in hibernate framework.
Hibernate Architecture There are 4 layers in hibernate architecture :
Elements of Hibernate Architecture Connection Provider
Example