Java资源分享网 - 专业的Java学习网站 学Java,上Java资源分享网
mybatis-3.5.7Mybatis帮助文档 PDF 下载
匿名网友发布于:2024-06-14 10:20:41
(侵权举报)
(假如点击没反应,多刷新两次就OK!)

mybatis-3.5.7Mybatis帮助文档 PDF 下载 图1

 

 

资料内容:

 

2 Getting Started
.......................................................................................................................................
2.1 Getting started
2.1.1 Installation
To use MyBatis you just need to include the mybatis-x.x.x.jar file in the classpath.
If you are using Maven just add the following dependency to your pom.xml:

 

<dependency>
 <groupId>org.mybatis</groupId>
 <artifactId>mybatis</artifactId>
 <version>x.x.x</version>
</dependency>

 

2.1.2 Building SqlSessionFactory from XML
Every MyBatis application centers around an instance of SqlSessionFactory. A SqlSessionFactory
instance can be acquired by using the SqlSessionFactoryBuilder. SqlSessionFactoryBuilder can build
a SqlSessionFactory instance from an XML configuration file, or from a custom prepared instance of
the Configuration class.
Building a SqlSessionFactory instance from an XML file is very simple. It is recommended that you
use a classpath resource for this configuration, but you could use any InputStream instance, including
one created from a literal file path or a file:// URL. MyBatis includes a utility class, called Resources,
that contains a number of methods that make it simpler to load resources from the classpath and other
locations