A preliminary attempt of mybatis

Fairy-KunKun 2022-05-14 14:37:35 阅读数:53

preliminaryattemptmybatis

Prepare a demand for everyone .

demand : Use mybatis The framework realizes the addition of departments .

Prepare a new database

 

Building framework (jar package + The configuration file )

Jar Where did the bag come from ?maven

The configuration file can be copied from the manual

Import mybatis Of jar Package coordinates

<dependency>

  <groupId>org.mybatis</groupId>

  <artifactId>mybatis</artifactId>

  <version>3.5.9</version>

</dependency>

Mysql Driver package :

      <dependency>

          <groupId>mysql</groupId>

          <artifactId>mysql-connector-java</artifactId>

          <version>5.1.24</version>

          <scope>runtime</scope>

      </dependency>

The configuration file

stay resources Define a xml file :Configuration.xml

Test connectivity ,mybatis Can and mysql Establishing a connection .

You can only verify that there is no problem with the framework , Testing is also required CRUD

版权声明:本文为[Fairy-KunKun]所创,转载请带上原文链接,感谢。 https://javamana.com/2022/134/202205141429154720.html