Mybatis step

Preparation:
table class

Bao jar dao_ru
mybatis-330jar junit-47jar
log4j-1217jar ojdbc14jar

Set up a development environment Mybatis
1. Prepare profile mybatis-config.xml
four elements
2. Mapping file XxxMapper.xml
SQL statement
3. The mapping interface XxxMapper.java
corresponding method
4. Test file
XxxTest.java

implement database operations by fixing step MyBatis
. 1 Gets sqlSession factory object
2. Object acquired sqlSession
3. obtaining the object mapper
4. The method call interface mapper objects, sql statement execution, functional

Guess you like

Origin www.cnblogs.com/Diyo/p/11447118.html