Difference Between Similar Terms and Objects

Difference Between JDBC and Hibernate

computerJDBC vs. Hibernate

Java Database Connectivity (also known as JDBC) is an API specifically built for the Java programming language. It defines how a client is able to access a database by providing methods for querying and updating data in a database. It is oriented more specifically towards relational databases. It was first introduced to the market as a part of the Java 2 Platform, Standard Edition, version 1.1 (or J2SE). It was bundled together with a reference implementation JDBC to ODBC bridge, enabling connections with the API to any ODBC accessible data source in the JVM host environment.

Hibernate is an object oriented mapping library (or ORM library) specifically built for the Java language. It provides a framework for mapping an object oriented domain model to a traditional relational database. It also solves object relational impedance mismatch problems –that is, problems in which a relational database management system (or RDBMS) is being used by a program written in an object oriented programming language or style. It accomplishes this by replacing direct persistence related database accesses with high level handling functions. It is free, open source software and is distributed under the GNU Lesser General Public License.

JDBC works by allowing a variety of implementations to exist and used by the same application. It provides a mechanism by which the correct Java packages are dynamically loaded and registered with the JDBC Driver Manager –which is used as a connection factory, of sorts, that creates JDBC connections. These connections support the creation and execution of statements. They may be update statements (the SQLs CREATE, INSERT, UPDATE, and DELETE, for example). They may also be query statements such as SELECT. A JDBC connection may also invoke stored procedures –that is, those procedures that are stored in the database data dictionary.

Hibernate primarily functions to map from Java classes to database tables, as well as from Java data types to SQL data types. It also provides data query and retrieval facilities. It is able to generate SQL calls, thus relieving the developer from manual result set handling and object conversion. This keeps the application portable to all SQL databases that are supported through the library. It maps Java classes to the database tables by configuring an XML file (in which Hibernate is able to generate skeletal source code for the persistence classes) or using Java Annotation (which makes the former action moot). Hibernate also supports mapping of custom value types, which makes three specific scenarios possible: overriding the default SQL type, chosen by Hibernate when mapping a column to a property; mapping Java Enum to columns as though they were regular properties; and mapping a single property to multiple columns.

Summary:

1. JDBC is an API that defines how a client can access a database; Hibernate is an ORM library that provides a framework for mapping an object oriented domain model to a traditional relational database.

2. JDBC allows various implementations to exist and by used by the same application; Hibernate maps from Java classes to database tables.


Search DifferenceBetween.net :

Custom Search


Help us improve. Rate this post! 1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 3.00 out of 5)
Loading...

Email This Post Email This Post : If you like this article or our site. Please spread the word. Share it with your friends/family.



Leave a Response

Please note: comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

Articles on DifferenceBetween.net are general information, and are not intended to substitute for professional advice. The information is "AS IS", "WITH ALL FAULTS". User assumes all risk of use, damage, or injury. You agree that we have no liability for any damages.


See more about : , ,
Protected by Copyscape Plagiarism Finder