Analysis updated 2026-06-21
Connect a Java Spring Boot app to a MySQL or PostgreSQL database using custom SQL queries defined in XML mapper files.
Replace hand-written JDBC boilerplate in a Java project with MyBatis mapper interfaces and annotations.
Use MyBatis in an Android app to query a local SQLite database with full control over the SQL.
Handle complex reporting queries or existing stored procedures in a Java app without giving up control to an auto-generating ORM.
| mybatis/mybatis-3 | didi/dokit | opendataloader-project/opendataloader-pdf | |
|---|---|---|---|
| Stars | 20,417 | 20,417 | 20,479 |
| Language | Java | Java | Java |
| Setup difficulty | moderate | moderate | moderate |
| Complexity | 3/5 | 3/5 | 3/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires a running relational database and a Java project with Maven or Gradle.
MyBatis is a Java framework that makes it easier for applications to talk to a relational database (like MySQL or PostgreSQL). Most Java apps need some way to save and retrieve data from a database, and doing this manually by writing raw SQL queries and then hand-converting the results into Java objects is tedious and error-prone. MyBatis sits in the middle and handles that translation work. The core idea is a "SQL mapper": you write your SQL queries yourself (in XML files or as Java annotations on your code), and MyBatis automatically maps the results back to Java objects and vice versa. This is a deliberate contrast with "full ORM" tools like Hibernate, which try to hide SQL entirely. MyBatis keeps you in control of your SQL while removing the boilerplate of manually wiring query results to objects. It also handles connection management, parameter binding, and result-set parsing for you. You would reach for MyBatis when you want fine-grained control over your database queries, common in teams with complex reporting needs, existing stored procedures, or performance-sensitive workloads where auto-generated SQL from a full ORM would be inefficient. It is particularly popular in enterprise Java and Android development, and is especially widely used in the Chinese tech industry. The framework requires Java and is distributed as a standard Maven/Gradle dependency, making it straightforward to drop into any existing Java project.
A Java framework that lets you write your own SQL queries and automatically maps the results to Java objects, removing database boilerplate without hiding SQL from you.
Mainly Java. The stack also includes Java, XML, Maven.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.