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</>↗
JDBC17 Jan 2026

How do I delete rows with JDBC?

To delete rows from a database using JDBC, you use the executeUpdate() method. This method is used for SQL statements that modify data (like DELETE, INSERT, or UPDATE) and returns an integer representing the number of rows affected. While you can use a simple Statement, it is highly recommended to use a PreparedStatement to prevent […]

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

How do I insert rows with JDBC?

To insert rows into a database using JDBC, you typically use the executeUpdate(String sql) method of a Statement or PreparedStatement object. Here are the two primary ways to do it: 1. Using PreparedStatement (Recommended) This is the standard approach because it prevents SQL Injection and is more efficient for repeated inserts. package org.kodejava.jdbc; import java.sql.Connection; […]

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

How do I update rows with executeUpdate?

In JDBC, the executeUpdate method is used for SQL statements that modify data, such as UPDATE, INSERT, or DELETE. Unlike executeQuery, which returns a ResultSet, executeUpdate returns an int representing the number of rows affected by the operation. Here is how you can update rows using PreparedStatement (the recommended way) and Statement. 1. Using PreparedStatement […]

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

How do I fetch results with ResultSet?

To fetch results using a ResultSet in Java JDBC, you follow a standard pattern of executing a query, iterating through the rows, and extracting data using “getter” methods. Basic Fetching Pattern Execute the Query: Use stmt.executeQuery(sql) (for Statement) or pstmt.executeQuery() (for PreparedStatement). Iterate through Rows: Use a while (rs.next()) loop. The next() method moves the […]

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

How do I use CallableStatement for stored procedures?

Using a CallableStatement in JDBC is the standard way to execute stored procedures. It allows you to handle input parameters (IN), output parameters (OUT), and even result sets returned by the database. Here is a guide on how to use it for different scenarios. 1. Basic Syntax The syntax for calling a stored procedure uses […]

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

How do I use PreparedStatement to prevent SQL injection?

Using PreparedStatement is one of the most effective ways to prevent SQL injection in Java. It works by separating the SQL query structure from the data, ensuring that user input is treated strictly as data and never as part of the executable SQL command. Here is how you use it: 1. The Key Concept: Placeholders […]

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.