SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

JDBC / NOTES</>↗
JDBC11 Feb 2026

How do I use connection pooling in JDBC with HikariCP?

To use connection pooling in plain JDBC with HikariCP, the main shift is: stop using DriverManager.getConnection(…) everywhere create one DataSource (the pool) at startup whenever you need a DB connection, call dataSource.getConnection() always close resources with try-with-resources (closing returns the connection to the pool, it does not kill the physical connection) 1) Create a pooled […]

Wayan · 3 min read
JDBC / NOTES</>↗
JDBC20 Jan 2026

How do I use savepoints in JDBC transactions?

Savepoints in JDBC provide fine-grained control over transactions by allowing you to roll back to a specific point within a transaction rather than undoing everything. This is particularly useful for handling optional operations or partial failures. Key Steps to Use Savepoints Disable Auto-commit: Savepoints only work within a manual transaction. Set a Savepoint: Use connection.setSavepoint() […]

Wayan · 3 min read
JDBC / NOTES</>↗
JDBC19 Jan 2026

How do I use transactions in JDBC?

Using transactions in JDBC is essential when you need to ensure that a group of SQL statements either all succeed or all fail together (maintaining Atomicity). By default, a JDBC Connection is in auto-commit mode, meaning every single SQL statement is treated as its own transaction and committed immediately. To manage transactions manually, follow these […]

Wayan · 2 min read
JDBC / NOTES</>↗
JDBC19 Jan 2026

How do I set fetch size for large queries?

To set the fetch size for large queries in Java using JDBC, you use the setFetchSize(int rows) method on a Statement or PreparedStatement object. This gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed. This is particularly useful for large […]

Wayan · 2 min read
JDBC / NOTES</>↗
JDBC18 Jan 2026

How do I use auto-generated keys in JDBC?

To use auto-generated keys in JDBC (like an AUTO_INCREMENT primary key), you need to follow a three-step process: notify the statement you want the keys, execute the update, and then retrieve them from a special ResultSet. Here is a practical example using PreparedStatement: 1. Prepare the Statement When creating your PreparedStatement, you must pass the […]

Wayan · 2 min read
JDBC / NOTES</>↗
JDBC18 Jan 2026

How do I batch insert data with JDBC?

To batch insert data with JDBC, you typically use the addBatch() and executeBatch() methods. This is much more efficient than executing individual INSERT statements because it reduces the number of round-trips between your application and the database. The most common and secure way to do this is with a PreparedStatement. Batch Insert with PreparedStatement Using […]

Wayan · 2 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.