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</>↗
JDBC30 May 2010

How do I call a stored procedure that return a result set?

This example show you how to call a stored procedure that return a result set of the query execution result. package org.kodejava.jdbc; import java.math.BigDecimal; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; public class CallableStatementExample { private static final String URL = "jdbc:mysql://localhost/kodejava"; private static final String USERNAME = "kodejava"; priv...

Wayan · 2 min read
JDBC / NOTES</>↗
JDBC26 May 2010

How do I register out parameter in CallableStatement?

This example show you how to register out parameter for executing a stored procedure using the CallableStatement.registerOutParameter() method call. We must register the out parameters before the query execution. The registerOutParameter() method takes two parameters, the index of the parameter and the sql data type of the out parameter. package org.kodejava.jdbc; import java.sql.*; public class […]

Wayan · 2 min read
BASIC / NOTES</>↗
Basic24 May 2010

How do I use the unary operators?

The unary operators requires only one operand to operate on, it can perform operations such as incrementing or decrementing value by one, negating a value or inverting a value of a boolean expression. The unary operators use the following symbols: Symbol Description + unary plus operator; indicates positive value – unary minus operator; negates a […]

Wayan · 2 min read
BASIC / NOTES</>↗
Basic23 May 2010

How do I use the arithmetic operators?

The following example show you how to use Java arithmetic operators. The operators consist of the multiplicative operators (* for multiplication, / for division), % for remainder of division) and the additive operators (+ for addition,- for subtraction). You’ll also see we are using a combination of a simple assignment operator with the arithmetic operators […]

Wayan · 2 min read
JDBC / NOTES</>↗
JDBC22 May 2010

How do I set the query timeout limit?

The Statement.setQueryTimeout() method set the limit in seconds for query execution time. The execution has no timeout limit when the value is set to zero. package org.kodejava.jdbc; import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; import java.sql.SQLException; import java.sql.DriverManager; public class QueryTimeout { private static final String URL = "jdbc:mysql://localhost/kodejava"; private static final String USERNAME = "kodejava"; […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API22 May 2010

How do I get peak live threads count?

package org.kodejava.lang.management; import java.lang.management.ManagementFactory; import java.lang.management.ThreadMXBean; public class PeakThreadCount { public static void main(String[] args) { // Get the managed bean for the thread system of the Java // virtual machine. ThreadMXBean bean = ManagementFactory.getThreadMXBean(); // Get the peak live thread count since the Java virtual // machine started or peak was reset. int peakThreadCount […]

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