Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
PILIHAN EDITOR
Java

Memahami Java Stream: olah koleksi dengan lebih ringkas

Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.

D Tim Diary Coding · 1 menit baca
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

JDBC / CATATAN</>
JDBC22 Mar 2026

How do I use DatabaseMetaData to inspect schema in JDBC?

You use java.sql.DatabaseMetaData by: Opening a Connection Calling conn.getMetaData() Querying catalogs/schemas/tables/columns/keys/indexes via the DatabaseMetaData “getXxx” methods (they mostly return ResultSets) Reading those result sets like normal query results Below are the most common inspection tasks and the JDBC calls that power them. 1) Get the DatabaseMetaData package org.kodejava.jdbc; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.Dr...

Wayan · 5 menit baca
JDBC / CATATAN</>
JDBC26 Feb 2026

How do I handle database timeouts in JDBC?

In JDBC, “database timeouts” can mean a few different things, and you handle each at a different layer. The most practical approach is to set timeouts deliberately and then catch the right exception types so you can decide whether to retry, fail fast, or surface a user-friendly error. 1) Connection timeout (can’t connect / handshake […]

Wayan · 5 menit baca
JDBC / CATATAN</>
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 menit baca
JDBC / CATATAN</>
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 menit baca
JDBC / CATATAN</>
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 menit baca
JDBC / CATATAN</>
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 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

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

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.