I know that Hibernate implements ORM (Object Relational Mapping), what type of mapping does JDBC implement? Does it implement DAO? I don’t totally understand how/if DAO is related to JDBC…?
I know that Hibernate implements ORM (Object Relational Mapping), what type of mapping does
Share
DAO isn’t a mapping. DAO stands for Data Access Object. It look something like this:
For DAO, JDBC is just an implementation detail.
Hibernate could be another one.
JPA could be another one (in case you’re migrating an existing legacy app to JPA; for new apps, it would be a bit weird as JPA is by itself actually the DAO, with e.g. Hibernate and EclipseLink as available implementations).
It allows you for switching of
UserDAOimplementation without changing the business code which is using the DAO (only if you’re properly coding against the interface, of course).For JDBC you’ll only need to write a lot of lines to find/save/delete the desired information while with Hibernate it’s a matter of only a few lines. Hiberenate as being an ORM takes exactly that nasty JDBC work from your hands, regardless of whether you’re using a DAO or not.
See also: