This article explains the MySQL 8.0.22 timezone bug that causes timestamp discrepancies up to 13 hours, details JDBC driver parameters like serverTimezone, connectionTimeZone, preserveInstants, and forceConnectionTimeZoneToSession, and provides seven best practices for correct timezone configuration in Java applications.
This tutorial demonstrates configuring and using Alibaba's Druid connection pool in Java applications, covering Maven dependencies, properties configuration, basic connection retrieval, a reusable helper class with query and execute methods, and JUnit test cases for CRUD operations.
The article benchmarks multiple approaches for inserting 300,000 records into MySQL, showing that naive single inserts take over 4 hours, while optimized batched inserts using MyBatis or JDBC with proper batch sizes (1000–5000) and transaction management achieve 13–24 seconds, and summarizes key optimization strategies.
This tutorial demonstrates Spring's JdbcTemplate and NamedParameterJdbcTemplate for database CRUD operations, covering Maven setup, Druid connection pooling, configuration classes, DAO implementations with both positional and named parameters, service layer, and JUnit tests, recommending NamedParameterJdbcTemplate for production use.
This tutorial walks through configuring MyBatis with XML for database operations, covering Maven dependencies, project structure, core configuration files, mapper interfaces, dynamic SQL, and JUnit testing with a complete employee CRUD example.
This article details integrating Dameng DM8 database with Easysearch 2.4.0 via Logstash 9.0 for full-text search, covering version compatibility fixes, JDBC driver configuration, logical deletion handling, timestamp boundary issues, IK analyzer alignment for Chinese text, and benchmark results showing 17x faster queries with consistent recall versus LIKE.
This guide demonstrates integrating Passkey/WebAuthn authentication into a Spring Boot application using Spring Security 7.1's built-in support, covering dependency setup, security configuration, frontend JavaScript implementation for credential registration and authentication, database persistence with JDBC repositories, and a migration strategy that retains password login while adding Passkey as a second factor.
This article analyzes MySQL Connector/J's timezone handling changes from 5.1 to 8.x, details the official bug #30962953 affecting versions 8.0.0-8.0.22, explains key parameters like serverTimezone and preserveInstants, and provides best practices for correct timestamp storage and retrieval.
This article details MySQL Connector/J's timezone handling bug in versions 8.0.0-8.0.22, explains key JDBC parameters like serverTimezone and preserveInstants, and provides best-practice configurations to avoid timestamp shifts and zero-date errors when upgrading from MySQL 5.1.
The article explains how the traditional find‑by‑id‑then‑save pattern causes two database round‑trips and concurrency bugs, and shows that Spring Data 4.1’s single‑statement Upsert (JdbcAggregateTemplate.upsert) lets the database decide INSERT or UPDATE in one SQL, reducing latency and race conditions while outlining its limitations and ideal use cases.
This article explores CosId's two ID generation modes—local computation (Snowflake) and segment allocation (SegmentId, SegmentChainId)—with detailed configuration for JDBC, Redis, ZooKeeper, MongoDB, and Proxy backends, plus Spring Boot, MyBatis, and ShardingSphere integration examples.
This article compares Spring Data JDBC and Spring Data R2DBC for Spring Boot 3.x/4.x projects, detailing setup, Maven dependencies, configuration, entity definitions, repository and service implementations, transaction handling, performance trade‑offs, and provides a hybrid approach that wraps JDBC calls in reactive Monos for WebFlux, helping developers decide which persistence layer best fits their reactive architecture.
The article walks through setting up a MySQL fake server, crafting a malicious JDBC URL with autoDeserialize and query interceptors, demonstrating how the MySQL JDBC driver automatically deserializes BLOB data via ObjectInputStream, and traces the call chain to show how arbitrary code can be executed during connection initialization.
Even with less than 30 QPS and normal DB CPU, a connection pool can run out in two hours because connections are held too long—often due to leaks, long‑running transactions, or async misuse—so the root cause must be traced back to the application code rather than just slow SQL.
This article introduces six Spring Boot approaches for JDBC data access—including JdbcTemplate, NamedParameterJdbcTemplate, JdbcClient, SimpleJdbcInsert/Call, Spring Data JDBC repositories, and JdbcAggregateTemplate—each illustrated with code samples and usage notes for Spring Boot 3.5.0.
The article compares several ways of inserting 300,000 MySQL rows—single‑row loops, an un‑batched MyBatis attempt that hits the max_allowed_packet limit, and a tuned batch strategy that commits every 1,000 rows—showing how the optimized batch reduces the runtime from hours to just 13 seconds and summarizing best‑practice tips.
This article explains how to replace Spring AI's default in‑memory ChatMemory with a JDBC‑backed implementation that stores conversation history in a MySQL table, covering component changes, schema design, auto‑configuration, and best‑practice configuration details.
A newcomer swapped MyBatis for MyBatis‑Plus in an old Java project, which caused a runtime exception about unsupported java.time.LocalDateTime conversion; the root cause was a MyBatis version change and an outdated MySQL JDBC driver, fixed by upgrading the driver.
This article explains why HikariCP is the default Spring Boot connection pool, details the required dependencies, walks through essential configuration parameters, shows how to use HikariTemplate, monitor pool metrics, avoid common pitfalls, and compares HikariCP with other popular pools.
This article walks through a real‑world data‑migration case where 100,000 rows were moved from an old system to a new one, showing how naive per‑row inserts took five minutes and how a series of optimizations—batch SQL, JDBC batch mode, and multithreaded parallelism—reduced the runtime to just three seconds, while also covering common pitfalls and the final high‑performance implementation.
The article walks through three concrete optimizations—batch SQL, JDBC batch mode with rewriteBatchedStatements, and multithreaded parallel inserts—that shrink a 100,000‑row MyBatis insertion from five minutes to three seconds, while highlighting configuration details, performance gains, and common pitfalls.
The article walks through turning a naïve MyBatis loop that took five minutes to insert 100,000 rows into a high‑performance solution that finishes in three seconds by applying batch SQL, JDBC batch mode with rewriteBatchedStatements, and multithreaded parallel execution, while highlighting pitfalls and best‑practice configurations.
The article details a step‑by‑step migration from MyBatis 3.5.0 to MyBatis‑Plus 3.1.1, explains why the conversion error for java.time.LocalDateTime appears after the switch, shows how to trace the root cause through stack traces, upgrades the mysql‑connector‑java to 5.1.37 (and later 5.1.42) to resolve the issue, and shares broader lessons about component upgrades and unexpected bugs.
The author measured six realistic Spring Boot scenarios on PostgreSQL with over 40,000 records, comparing Spring Data JPA and native JDBC, and found JDBC to be 4‑460× faster for batch inserts, updates, deletes and complex statistics, while JPA remains adequate for small‑scale CRUD operations.
The article examines how MySQL’s JDBC driver has been slow to adopt Java’s virtual thread (Loom) support compared with Oracle, PostgreSQL, MariaDB and SQL Server drivers, explains the technical reasons behind the delay, offers a workaround by replacing synchronized with ReentrantLock, and recommends upgrading to the 9.x driver for optimal performance and security.
This article measures the time required to establish and close a MySQL JDBC connection, showing that a single connection can consume over 200 ms, and explains why connection pooling is essential for high‑traffic web applications.
This article explains the challenges of manual JDBC transaction handling, introduces Spring's unified transaction API with PlatformTransactionManager, TransactionDefinition, and TransactionStatus, demonstrates code examples for programmatic and declarative transactions, and discusses common pitfalls such as non‑public methods, self‑invocation, and exception handling.
This article examines the @Transactional annotation in Spring Boot, explains its proper and improper use, and presents extensive performance tests using JPA, JDBC, and EntityManager that reveal surprising cases where transactions improve query throughput.
This article demonstrates how to insert 300,000 rows into a MySQL table using MyBatis and JDBC, compares naïve single‑batch and per‑row approaches, presents optimized batch‑processing code with configurable batch sizes and wait times, and shares practical performance‑tuning tips such as index handling and connection‑pool configuration.
This article compares five major Java database access technologies—JDBC, Hibernate, Spring Data JPA, JOOQ, and MyBatis—detailing their code examples, strengths, weaknesses, and ideal use cases, while also offering a downloadable Spring Boot 3 case collection PDF for hands‑on practice.
This article explains why a Java application using the Kingbase JDBC driver may encounter SocketTimeoutException during reads, analyzes the underlying socket timeout settings in both the driver and Druid connection pool, and provides a step‑by‑step solution to correctly configure timeouts and avoid repeated failures.
This article evaluates the efficiency of inserting massive data into MySQL using Java, comparing three strategies—MyBatis without transactions, plain JDBC with and without transactions, and JDBC batch processing—showing that batch processing combined with transactions yields the fastest insertion speed for hundreds of millions of rows.
This guide walks you through converting a SpringBoot + MyBatisPlus project from MySQL to PostgreSQL, covering driver setup, JDBC configuration changes, common SQL syntax pitfalls, and provides helper scripts for bulk column adjustments and default value settings.
This guide walks you through using JetBrains DataGrip on AlmaLinux to connect to a PostgreSQL server, then demonstrates step‑by‑step how to insert, modify, and delete records via the graphical interface and optional SQL console, highlighting key settings and safety tips.
This article walks through optimizing a 60,000‑row XML‑to‑MySQL import by profiling the environment, measuring baseline performance, and applying JDBC batch rewriting, write aggregation, and asynchronous writes with LMAX Disruptor, ultimately reducing execution time from 300 seconds to about four seconds while keeping memory usage reasonable.
This article analyzes the poor performance of MyBatis‑Plus saveBatch, compares it with single inserts, manual SQL batching, and JDBC executeBatch, and shows how enabling the rewriteBatchedStatements flag can dramatically improve batch insert speed.
This article provides a comprehensive walkthrough of JDBC for MySQL, covering driver loading, connection creation, statement and prepared statement objects, SQL execution with examples, batch processing, and performance considerations for test engineers using Java.
This article demonstrates how to use the H2 database with Java 1.8, covering embedded (file and memory) modes, server modes (Web, TCP, PG), mixed mode configurations, required dependencies, and provides complete JUnit test code examples for creating, accessing, and managing tables.
This article explains why JDBC breaks Java’s parent delegation model, describing how the SPI mechanism combined with the thread‑context class loader enables dynamic loading of third‑party drivers, preserving core advantages while allowing flexible driver discovery and loading.
This article investigates MySQL's recommendation against using UUID or random Snowflake IDs as primary keys by creating three tables with different key strategies, running Spring Boot/JDBC performance tests, analyzing index structures, and concluding that auto‑increment keys offer superior insertion efficiency and fewer drawbacks.
Benchmarking three MySQL tables—auto_increment, UUID, and random long keys—shows that sequential auto_increment inserts are fastest, random keys are slower, and UUIDs dramatically lag due to random I/O and fragmentation, so use auto_increment for most workloads and reserve UUIDs only for required global uniqueness.
This guide walks you through using JMeter's CSV Data Set Config, built‑in functions, JDBC driver setup, and response assertions to perform multi‑data load testing, validate database queries, and enhance test coverage and accuracy.
This article introduces Java's Service Provider Interface (SPI) mechanism, explaining its role in decoupling interface definitions from implementations, with examples in JDBC, Spring Boot, and Dubbo.
This article announces a Spring Boot 3 case collection with 100 permanent examples and then provides a comprehensive guide on recording SQL statements in Spring Boot applications via JDBC, JPA, MyBatis and the datasource‑proxy library, including configuration snippets, code samples and visual output illustrations.
This guide explains the need for JDBC connection pools, compares popular pools like HikariCP and Druid, and provides step‑by‑step configurations for both custom property files and Spring Boot auto‑configuration, helping you efficiently manage database connections in Java applications.
This article walks through optimizing a Java‑based XML‑to‑MySQL import, showing how to cut processing time from 300 seconds to just 4 seconds by enabling JDBC batch writes, using rewriteBatchedStatements, applying async writes with Disruptor, and tuning MySQL settings.
By switching from a naïve per‑record insert to JDBC batch writes with rewriteBatchedStatements and then off‑loading those batches to multiple consumer threads via a LMAX Disruptor ring buffer, the XML‑to‑MySQL import of 60,000 rows dropped from roughly 300 seconds to about 4 seconds while keeping memory usage modest.
This article explains the fundamentals of transaction handling in Spring Boot, covering both programmatic approaches with PlatformTransactionManager and TransactionTemplate and declarative management using @Transactional, while detailing common pitfalls, propagation and isolation settings, and providing concrete code examples.
This article explains why JDBC access to OceanBase (Oracle mode) LOB columns can trigger an ORA-06502 "no data found" error, analyzes the driver’s readFromServer implementation, and shows how disabling the useLobLocatorV2 option eliminates the exception.
The article explains how JDBC’s setQueryTimeout and Spring’s transaction timeout work, reveals why SQL statements can become indefinitely blocked in the socket read phase, and provides practical configuration steps—including driver URL parameters—to prevent such blocking in MySQL, SQL Server, and Oracle environments.
This article investigates MySQL's recommendation to avoid UUID or random Snowflake IDs as primary keys, comparing auto‑increment, UUID, and random long keys through Java/JDBC performance tests, analyzing their insertion speed, index structure impact, and the trade‑offs of each approach.
This article explains how to dramatically improve MyBatis-Plus batch insertion speed—up to 2000%—by enabling rewriteBatchedStatements, pre‑generating primary keys to handle foreign‑key relationships, applying proper JDBC batch settings, and using asynchronous multithreaded insertion with optimized connection‑pool and executor configurations.
This article explains the purpose of Java's parent‑delegation class‑loading mechanism, describes its three built‑in loaders, shows how custom loaders can override it, and explores common situations—such as JNDI, JDBC, Tomcat, and OSGi—where developers intentionally break the delegation for flexibility and modularity.
This article explains why the OBOracle "set transaction read only" command provides repeatable‑read semantics, evaluates the behavior of the JDBC conn.setReadOnly(true) setting, and shows how to achieve true repeatable‑read isolation by enabling the oracleChangeReadOnlyToRepeatableRead option in the OceanBase client.
This article explains the core concepts of connection‑pool technology, details the architectural choices behind HikariCP such as dual HikariPool instances, FastList, custom ConcurrentBag, ThreadLocal caching, and byte‑code generation, and walks through the key source code that makes the pool exceptionally fast.
This article demonstrates how to efficiently insert 300,000 rows into a MySQL table by using MyBatis batch operations, JDBC batch processing, and various performance optimizations such as batch size tuning, transaction management, and connection pooling.
This guide explains how to set up JDBC drivers, construct connection URLs, use PreparedStatement instead of Statement, iterate ResultSet safely, manage resources with try‑with‑resources, handle transactions, employ connection pools, and properly process SQLExceptions for robust Java database applications.
This article demonstrates how to insert 300,000 rows into a MySQL table using MyBatis and JDBC, compares direct batch insertion, row‑by‑row insertion, and optimized batch strategies, and provides performance measurements and practical tips for efficient large‑scale data loading.
This article demonstrates how to insert 300,000 rows into a MySQL table efficiently by defining a User entity, configuring MyBatis and JDBC, comparing direct batch insertion, row‑by‑row insertion, and optimized batch strategies with configurable batch sizes and wait times, and provides performance results and best‑practice recommendations.
This article explains the purpose of Java's parent delegation class‑loader mechanism, describes its three built‑in loaders, and details common scenarios—such as JNDI, JDBC, Tomcat, and OSGi—where developers intentionally break the delegation to achieve flexibility and isolation.
This article evaluates MySQL single‑thread write performance by testing three insertion methods—continuous while‑loop inserts, JDBC batch processing, and multi‑row INSERT statements—detailing setup, code examples, and measured rows per minute to reveal their relative throughput and stability.
This article presents a comprehensive performance test of inserting massive amounts of randomly generated person records into MySQL, comparing three strategies—MyBatis lightweight insertion, direct JDBC handling, and JDBC batch processing—both with and without transactions, and concludes that combining batch processing with transactions yields the fastest insertion speed for large‑scale data loads.
The article walks through a performance test of inserting over 100,000 rows with many columns, showing how a naïve loop takes about 80 seconds while JDBC batch, manual transaction control, and MyBatis/MyBatis‑Plus batch APIs can reduce the time to roughly one second.
The article shows how to efficiently load 300,000 MySQL rows in Java by comparing MyBatis and plain-JDBC batch inserts, demonstrating that batching 1,000‑5,000 records per transaction with proper transaction control, connection pooling, and MySQL tuning reduces insertion time from hours to seconds.
This article introduces Alibaba's Druid JDBC connection pool, walks through a basic Java usage example, details essential configuration parameters, and demonstrates a multithreaded concurrency test to evaluate performance and stability in MySQL environments.
This article demonstrates how to insert 300,000 rows into a MySQL table using MyBatis and JDBC, compares bulk batch insertion with per‑row looping, discusses packet size limits, transaction handling, performance metrics, and provides practical code snippets and optimization tips for efficient large‑scale data loading.
The article explains that Java database connection pools rely on blocking I/O and JDBC design rather than IO multiplexing, detailing the technical, architectural, and ecosystem reasons why multiplexed DB access is uncommon despite its potential performance benefits.
Although IO multiplexing can boost performance, most Java applications continue to use connection pools like c3p0 or Tomcat because JDBC is blocking, DB protocols require multiple sessions, and integrating NIO drivers into existing web containers adds significant complexity and ecosystem constraints.
This article demonstrates various methods for inserting 300,000 rows into a MySQL database using Java, including direct batch insertion with MyBatis, row‑by‑row insertion, and optimized batch strategies for both MyBatis and JDBC, along with performance results and practical tips.
This guide demonstrates how to set up a SpringBoot environment, create a MySQL table, define a JavaBean, and perform efficient batch inserts using JdbcTemplate, BatchPreparedStatementSetter, NamedParameterJdbcTemplate, SimpleJdbcInsert, and MappingSqlQuery, with complete code examples for each technique.
This article explains how to efficiently insert massive amounts of data (over 100,000 rows) into a MySQL table by comparing plain JDBC single‑row inserts, JDBC batch inserts, MyBatis/MyBatis‑Plus foreach dynamic SQL, and the built‑in MyBatis‑Plus saveBatch method, while highlighting configuration tips and performance results.
This article explains essential SQL concepts and common pitfalls—such as overusing SELECT *, choosing appropriate data types, respecting column order, handling NULL differences, leveraging database processing, using connection pools, and applying batch operations—to help developers write efficient, cost‑effective queries and advance their careers.
The article explains Java's PreparedStatement interface, highlighting its performance, security, and batch processing benefits, and provides a complete example of inserting multiple user records efficiently, while also discussing practical considerations such as batch size, transaction handling, error management, and optimization tips.
This article demonstrates how Spring 6.1’s new fluent JdbcClient API simplifies JDBC operations—showing environment setup, table creation, data‑source configuration, various placeholder and named‑parameter queries, custom result mapping, and CUD actions—while comparing it to the traditional JdbcTemplate approach.
This article explains the limitations of using JDBC for true streaming reads in Spark and Flink, demonstrates failed attempts with MySQL, shows workarounds that revert to batch processing, and recommends Flink CDC as the practical solution for incremental MySQL ingestion.
This article examines how MySQL's JDBC driver manages ResultSet resource release, the internal close mechanisms, and the concurrency limitations of Statement objects, illustrated with code excerpts and a Groovy virtual‑thread demo that reveals runtime exceptions when ResultSets are accessed after implicit closure.
This article walks through the step‑by‑step evolution from raw JDBC to the MyBatis framework, explaining why JDBC should be wrapped, how MyBatis improves connection handling, SQL management, dynamic statements, result mapping, caching, and overall architecture with concrete code examples.
This article explains why using MyBatis‑Plus saveBatch for bulk inserts can cause 5‑6 second delays, analyzes the underlying per‑row INSERT behavior, and shows how adding rewriteBatchedStatements=true to the JDBC URL dramatically reduces execution time to a few hundred milliseconds.
This article experimentally compares three Java‑based insertion strategies—MyBatis without transaction, plain JDBC with and without transaction, and JDBC batch processing—with and without transactions, measuring how they affect the time required to insert tens of millions of rows into MySQL.
This article explains how JDBC evolves into MyBatis, why JDBC should be wrapped into a persistence framework, and examines MyBatis's architecture, initialization process, and design‑pattern usage, providing code examples and optimization steps for developers.
This article demonstrates multiple approaches—including direct MyBatis batch, per‑row insertion, and JDBC batch processing—to insert 300,000 user records into a MySQL table, compares their performance, and provides practical optimization tips such as batch size tuning, waiting intervals, index handling, and connection‑pool configuration.
This article walks through the step‑by‑step JDBC query process, explains why wrapping JDBC in a framework like MyBatis is beneficial, analyzes MyBatis’s core components and execution flow, and presents five practical optimizations—from connection pooling to dynamic SQL and result caching—to improve Java backend performance.
This guide introduces Lealone, a Java open‑source high‑performance relational database for OLTP, outlines its key features, provides step‑by‑step instructions for downloading, starting, and using the server and client, shows JDBC CRUD examples, GUI client setup, and links to the author's technical blogs and source notes.
This article explains how JDBC operations evolve into the MyBatis persistence framework, covering JDBC's seven-step query process, MyBatis's design components, initialization workflow, builder patterns, and includes practical Java code examples for each stage.
This article demonstrates how to insert 300,000 rows into a MySQL table efficiently by defining entity, mapper and configuration files, comparing direct batch insertion, row‑by‑row insertion, and optimized batch strategies with MyBatis and JDBC, and summarizing performance results and best‑practice tips.
This article walks through the step‑by‑step evolution from raw JDBC queries to the MyBatis persistence layer, highlighting why JDBC should be wrapped, the design improvements MyBatis introduces, core components, execution flow, initialization mechanisms, and related design patterns, all illustrated with code snippets and diagrams.
This article presents a systematic performance test of inserting massive data into MySQL, comparing three strategies—MyBatis lightweight insertion, direct JDBC (with and without transactions), and JDBC batch processing—showing how transaction handling and batch execution dramatically affect insertion speed.
This article explains how JDBC evolves into MyBatis, detailing the seven-step JDBC query process, the motivations for encapsulating JDBC, MyBatis architecture, core components, initialization mechanisms, design patterns, and code examples, while offering optimization strategies for connection handling, SQL management, and result mapping.
This article explains how to insert 300,000 rows into a MySQL table efficiently by defining a User entity, configuring MyBatis mappers, and comparing three approaches—direct bulk insert, per‑row loop insert, and batch insert with configurable batch sizes—while also providing JDBC equivalents and performance tips.
This article demonstrates multiple ways to insert 300,000 rows into a MySQL table using MyBatis and JDBC, compares batch, loop, and single‑record approaches, analyzes execution time and resource usage, and provides practical optimization tips for high‑throughput data loading.
This article demonstrates how to insert 300,000 rows into a MySQL table using MyBatis and plain JDBC, compares direct batch insertion, per‑row insertion, and staged batch processing, and provides practical performance tips such as batch size, waiting intervals, index handling, and connection‑pool configuration.
This guide introduces DBeaver, a free Java‑based database management tool, covering its cross‑platform installation, JDBC connectivity to numerous relational and NoSQL databases, step‑by‑step connection setup, driver management, and how to generate ER diagrams from existing schemas.
This article demonstrates multiple approaches—including MyBatis batch inserts, per‑row inserts, and JDBC batch processing—to efficiently load 300,000 user records into a MySQL table, compares their performance, and provides practical optimization tips such as batch size, waiting intervals, and index handling.
The article explains that database connection pools remain based on blocking I/O because JDBC was designed for BIO, managing session state per connection, and the ecosystem lacks a unified non‑blocking driver, making IO multiplexing technically possible but practically complex and rarely needed.
Although IO multiplexing can improve performance, Java applications typically use traditional connection pools like c3p0 or Tomcat because JDBC is built on blocking I/O, DB sessions require separate connections, and integrating NIO would complicate program architecture, making connection pools the pragmatic, mature solution.
This article demonstrates multiple strategies for inserting 300,000 rows into a MySQL table using MyBatis and JDBC, comparing batch‑insert, single‑row loops, packet size limits, transaction handling, and performance tuning techniques such as batch size, waiting intervals, and index management.
This article investigates the poor performance of MyBatis‑Plus batch inserts, compares several insertion strategies—including single inserts, saveBatch, manual SQL concatenation, and JDBC executeBatch—measures their execution times, and shows how enabling the rewriteBatchedStatements driver option dramatically improves throughput.
This guide walks you through downloading and installing the free, open‑source DBeaver tool, configuring connections to various databases such as PostgreSQL and Oracle via JDBC, testing those connections, and using the built‑in ER diagram feature to visualize database schemas.
This guide introduces DBeaver, a free Java‑based database management tool, covering its cross‑platform installation, how to create connections for databases like PostgreSQL via JDBC, and how to generate ER diagrams from existing schemas, all illustrated with step‑by‑step screenshots.