2. Hibernate and JDBC differences between Hibernate and JDBC main differences are as follows:
1. Hibernate are the subject of lightweight JDBC package, it is an independent object persistence framework, and the App Server, and EJB Nothing contact inevitable. Hibernate can use JDBC can be used in any occasion, from a certain sense, Hibernate in any occasions to replace the JDBC.
2. Hibernate and JDBC are closely related to a framework, so Hibernate and JDBC driver compatibility, and databases must have a relationship, but Java and the use of its procedures, and there is no relationship between the App Server does not exist compatibility problems .
3. Hibernate is used as a substitute for the emergence of JDBC, and can not be used to make a direct comparison and Entity Bean.
3. Hibernate multi-table related query Hibernate query to multiple tables, the query results are a number of the Cartesian product form, or referred to as the "cross" connection. For example: from Student, Book from Student as stu, Book as boo from Student stu, Book boo Note: Student let the query and the Book of all student and book form are the corresponding class name, it must be the first name and first name in the same category , including the upper and lower case letters. Alias lowercase the first letter should be subject to the rules is a good habit, which Java local variables on the naming convention is consistent.







