Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 

Multi-MyBatis-Demo

This is a simple Spring Boot project to demonstrate how to configure MyBatis with multiple mappers pointing to different databases.

It basically contains the configuration files that set up two different connections to two different databases (an in-memory H2 instance and and in-memory HSQLDB instance), creates two datasources and configures two different mappers where each one uses a different database from the other. I added a simple controller that queries each database with vendor specifig SQL to display the name and the version of the database to demonstrate that each mapper points fo a different database.

After you build and run this project, this is the result you should get when you point your browser to http://localhost:8080/test_mappers:

enter image description here

This project was created as a hands-down demonstration of the tip explained in the blog entry "Spring Boot, MyBatis, multiple datasources and multiple mappers, all together holding hands"

About

A simple project to demonstrate how to configure multiple mappers attacking multiple databases using Spring Boot and MyBatis

Resources

License

Releases

No releases published

Packages

No packages published

Languages