MyBatis-01-MyBatis introduction;

1. What is the framework

a) a frame lazy programmer is encapsulated code, followed by repeated use.
b) framework is actually a semi-finished products, in order to connect to the database, for example, connect to the database driver used, url, user names, passwords must inform the framework.
c) programmers using the framework, they usually inform the framework of the information required in the manner of the configuration file, most will use the profile as xml framework.
d) Therefore, when using the framework developed code, you need to write the configuration file, instead of writing code will be reduced.
e) frameworks are provided by third parties, it is provided jar package. Thus, before using the frame, the frame must be directed to the jar package into the project.
f) a common framework in java
  •  MyBatis, ORM frame, the bottom is encapsulated is jdbc
  •  Spring, is a container
  •  SpringMVC, hierarchical framework
  •  Struts2, function is similar to SpringMVC
  •  Hibernate, function is similar to MyBatis
 
 

II. What is MyBatis framework

  • MyBatis ORM is a framework for a database operation, the package bottom is jdbc performed.
  • MyBatis, formerly known as iBatis, is an open source project under the Apache is now migrated to the on GitHub.
 
 
 
 
 
 

Three. MyBatis environment to build the jar package Detailed

1.1 Creating a project java project

1.2 Import jar package

(1) MyBatis core jar package   
  mybatis-3.2.7.jar
(2) MyBatis dependent jar package
  • asm-3.3.1.jar parsing bytecode packets, is dependent cglib
  • cglib-2.2.2.jar dynamic proxy implementation
  • commons-logging-1.1.1.jar package log
  • javassist-3.17.1-GA.jar packet parsing bytecode
  • log4j-1.2.17.jar package log
  • log4j-api-2.0-rc1.jar log
  • log4j-core-2.0-rc1.jar log
  • slf4j-api-1.7.5.jar log
  • slf4j-log4j12-1.7.5.jar log
(3) driving the jar package database
    mysql-connector-java-5.1.30.jar
 
 

Guess you like

Origin www.cnblogs.com/EricShen/p/11612700.html