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</>↗
JDBC23 Feb 2026

How to Detect Deadlocks in JDBC?

Deadlocks in JDBC typically refer to database-level deadlocks, where two or more transactions block each other while waiting for locks on resources (e.g., rows or tables). JDBC itself doesn’t “detect” them proactively; instead, the database server signals them via exceptions. Here’s how to handle detection effectively: 1. Catch and Inspect SQLException Wrap your JDBC operations […]

Wayan · 3 min read
JDBC / NOTES</>↗
JDBC23 Feb 2026

How do I use SQLSTATE error codes in JDBC?

SQLState error codes are a standardized way in JDBC to categorize database errors, making it easier to handle exceptions programmatically. They’re part of the SQLException class and follow the SQL:2003 standard (like “23000” for integrity constraints). Unlike vendor-specific error codes (from getErrorCode()), SQLState is more portable across databases. 1. What is SQLState? It’s a 5-character […]

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

How do I handle SQL exceptions in JDBC for MySQL properly?

For MySQL (mysql-connector-j), “proper” SQLException handling is the same core approach as JDBC in general, plus a few MySQL-specific signals (SQLState + error code) that are worth using for translation/retry decisions. 1) Keep the important diagnostics (MySQL error code + SQLState) MySQL gives you two invaluable fields: e.getErrorCode() → MySQL vendor error code (e.g., 1062 […]

Wayan · 4 min read
JDBC / NOTES</>↗
JDBC18 Feb 2026

How do I handle SQL exceptions in JDBC properly?

Handling SQLException “properly” in JDBC is mostly about (1) not leaking resources, (2) preserving diagnostic detail, (3) rolling back safely, and (4) translating errors into something meaningful at your app boundary. 1) Always close JDBC resources (use try-with-resources) This eliminates most error-handling bugs (leaks and double-closes), and it also handles exceptions thrown during close() by […]

Wayan · 4 min read
JDBC / NOTES</>↗
JDBC12 Feb 2026

How do I configure C3P0 connection pool in JDBC?

To configure c3p0 as a JDBC connection pool, you typically: create a DataSource (usually ComboPooledDataSource) tune pool parameters (min/max pool size, idle time, timeouts, statement cache) use the DataSource everywhere instead of DriverManager.getConnection(…) close Connection/Statement/ResultSet normally (c3p0 returns connections to the pool on close()) Below are the common ways to do it. 1) Programmatic configuration […]

Wayan · 4 min read
JDBC / NOTES</>↗
JDBC12 Feb 2026

How to Configure Apache DBCP Connection Pool in JDBC?

To configure an Apache DBCP connection pool for “plain” JDBC, you typically create a pooled DataSource once at startup, then get connections from it (and always close them to return to the pool). Below are the two most common approaches. 1) Recommended (DBCP2): BasicDataSource (simplest) Create and configure the pool package org.kodejava.jdbc; import org.apache.commons.dbcp2.BasicDataSource; import […]

Wayan · 3 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.