Configuring Database Connections in Spring Boot with MyBatis

Method 1: Using @Value for Property Injection Step 1: Define a properties file (e.g., jdbc.properties) jdbc.driverClassName=com.mysql.cj.jdbc.Driver jdbc.url=jdbc:mysql://127.0.0.1:3306/leyou jdbc.username=root jdbc.password=123456 Step 2: Create a configuration class using @Value package com.caicia.config; import com.alibaba.druid.pool.Druid ...

Posted on Sun, 28 Jun 2026 16:57:31 +0000 by shatteredroses

Understanding Druid Database Connection Pool Internals and Configuration

Database connection pooling is a foundational optimization in modern Java applications, especially within Spring Boot ecosystems. Misconfigurations or misunderstandings of pool behavior frequently lead to subtle production issues — such as stale connections, timeouts, or resource exhaustion — even among seasoned developers. Why Connection Pools ...

Posted on Wed, 24 Jun 2026 18:04:01 +0000 by bcamp1973

Spring Boot with MyBatis Transaction Management Setup

Maven Dependencies Add the following dependencies to you're pom.xml: <!-- MyBatis integration for Spring Boot --> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.3.1</version> </dependency> <!-- MySQL ...

Posted on Sun, 07 Jun 2026 16:41:13 +0000 by frost

Spring Boot Persistence with MyBatis

MyBatis is a lightweight SQL-mapping framweork that removes most JDBC boiler-plate while still giving full control over SQL. The following walkthrough shows how to integrate it into a Spring Boot project and perform common CRUD operations. Project bootstrap and data source configuration Create a new Spring Boot project with the spring-boot- ...

Posted on Wed, 20 May 2026 08:09:11 +0000 by AceE

Configuring JDBC and Druid Data Sources in Spring Boot

Project Dependencies for Standard JDBC To configure a data source using Spring Boot's default JDBC support, typically backed by Tomcat JDBC, include the folllowing dependencies in your Maven pom.xml file. This configuration also integrates MyBatis for database mapping. <dependencies> <dependency> <groupId>org.sprin ...

Posted on Fri, 15 May 2026 07:30:52 +0000 by guttyguppy