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.

CORE API / NOTES</>↗
Core API05 Jan 2007

How do I iterate each character of a string?

The following example show you how to iterate each character of a string using the java.text.CharacterIterator and java.text.StringCharacterIterator to count the number of vowels and consonants in the string. package org.kodejava.text; import java.text.CharacterIterator; import java.text.StringCharacterIterator; public class StringCharacterIteratorExample { private static final String text = "The quick brown fox jumps over the lazy dog"; public […]

Wayan · 1 min read
JDBC / NOTES</>↗
JDBC01 Jan 2007

How do I disable auto-commit mode in JDBC?

The code snippet below shows you how to disable auto-commit operation when executing JDBC commands or queries. package org.kodejava.jdbc; import java.sql.*; public class AutoCommitSettingExample { private static final String URL = "jdbc:mysql://localhost/kodejava"; private static final String USERNAME = "kodejava"; private static final String PASSWORD = "s3cr*t"; public static void main(String[] args) { // DO: Get […]

Wayan · 2 min read
SERVLET / NOTES</>↗
Servlet28 Dec 2006

How do I read text file in Servlet?

This example show you how to read a text file in a servlet. Using the ServletContext.getResourceAsStream() method will enable you to read a file whether the web application is deployed in an exploded format or in a war file archive. The following servlet read the configuration.properties file from the /WEB-INF directory in our web application. […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API28 Dec 2006

How do I create a scheduled task using timer?

This example show you how to create a simple class for scheduling a task using Timer and TimerTask class. package org.kodejava.util; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Timer; import java.util.TimerTask; public class TimerExample extends TimerTask { private final DateFormat formatter = new SimpleDateFormat("hh:mm:ss a"); public static void main(String[] args) { // Create an instance […]

Wayan · 1 min read
SERVLET / NOTES</>↗
Servlet23 Dec 2006

How do I share object or data between users in web application?

In a web application there are different type of scope where we can store object or data. There are a page, request, session and application scope. To share data between users of the web application we can put a shared object in application scope which can be done by calling setAttribute() method of the ServletContext. […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API22 Dec 2006

How do I format a date-time value?

In the DateFormat class there are some predefined constants that we can use to format a date time value. Here is an example of it. package org.kodejava.text; import java.text.DateFormat; import java.util.Date; public class DefaultDateFormatExample { public static void main(String[] args) { Date date = new Date(); // Format date in a short format String today […]

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.