java - mybatis hibernet, difference, jdbc of

mybatis is responsible for the database and the framework of the interaction (DAO (data access object)).

 

Interactive database method:

1. jdbc: java comes with the most primitive method, call the connection method (database ip, account password, query, etc. are parameters), then splicing sql statement operation

Coupling too (need to amend all relevant java code to modify the database, sql statement and configuration of class in java class), so give up

 

2. hibernet: by object-relational mapping (Object Relational Mapping, referred to as the ORM), directly mapped to a database table Class class, field-one correspondence. Database operated by the operating method of the classes and class used hibernet provided.

Black box operation, sql statement is packaged, complex business logic associated with multiple tables and queries it will be very flexible. But also learn hibernet own "sql", but a big workload.

 

3.mybatis: connection profile database, easy maintenance, in addition to the database connection and sql statements, other all done automatically.

Combines the advantages of both of the above, the development of convenient, low coupling, can be customized sql.

 

Guess you like

Origin www.cnblogs.com/clamp7724/p/11925829.html