Java知识分享网 - 轻松学习从此开始!    

Java知识分享网

        
AI编程,程序员挑战年入30~100万高级指南 - 职业规划
SpringBoot+SpringSecurity+Vue权限系统高级实战课程        

IDEA永久激活

Java微信小程序电商实战课程(SpringBoot+VUe)

     

AI人工智能学习大礼包

     

PyCharm永久激活

66套java实战课程无套路领取

     

Cursor+Claude AI编程 1天快速上手视频教程

     
当前位置: 主页 > Java文档 > Java基础相关 >

mybatis-3.5.7Mybatis帮助文档 PDF 下载


时间:2024-06-14 10:20来源:http://www.java1234.com 作者:转载  侵权举报
mybatis-3.5.7Mybatis帮助文档
失效链接处理
mybatis-3.5.7Mybatis帮助文档 PDF 下载
 
 
 
相关截图:

 
主要内容:
 

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

 


 


------分隔线----------------------------


锋哥推荐