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.

MYBATIS / NOTES</>↗
MyBatis08 Jun 2011

How do I create an SqlSessionFactory object in MyBatis?

The example below shows you how to create MyBatis SqlSessionFactory object using an XML configuration. The steps required is to create the configuration file. This file basically contains the connection information to the database and MyBatis configuration such as typeAliases and the mappers. The next steps is to read the configuration file using a org.apache.ibatis.io.Resources […]

Wayan · 4 min read
MYBATIS / NOTES</>↗
MyBatis08 Jun 2011

How do I create MyBatis SqlSession object?

To create an SqlSession you can use the SqlSessionFactory class openSession() method. This method offers some overloaded method that can configure the property of the session. For example, we can configure the auto-commit-mode and the transaction-isolation-level for the session. package org.kodejava.mybatis; import org.apache.ibatis.io.Resources; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.S...

Wayan · 4 min read
APACHE COMMONS / NOTES</>↗
Apache Commons01 Jun 2011

How do I capitalize each word in a string?

This example show you how to capitalize a string. We use methods from WordUtils class provided by the Apache commons-text;. We can use the WordUtils.capitalize(str) or WordUtils.capitalizeFully(str). Let’s see an example below: package org.kodejava.commons.text; import org.apache.commons.text.WordUtils; public class WordCapitalize { public static void main(String[] args) { // Capitalizes all the whitespace separated words in a […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API27 May 2011

How do I create a thread synchronized block?

The objective of thread synchronization is to ensure that when several threads want access to a single resource, only one thread can access it at any given time. You can manage synchronization of your program at method level (synchronized method) or at block level (synchronized block). To make a block of code synchronized you can […]

Wayan · 2 min read
REFLECTION / NOTES</>↗
Reflection12 Dec 2010

How do I get the component type of array?

The Class.getComponentType() method call returns the Class representing the component type of array. If this class does not represent an array class this method returns null reference instead. package org.kodejava.lang.reflect; public class ComponentTypeDemo { public static void main(String[] args) { String[] words = {"and", "the"}; int[][] matrix = {{1, 1}, {2, 1}}; Double number = […]

Wayan · 1 min read
REFLECTION / NOTES</>↗
Reflection12 Dec 2010

How do I determine if a class object represents an array class?

For checking if a class object is representing an array class we can use the isArray() method call of the Class object. This method returns true if the checked object represents an array class and false otherwise. package org.kodejava.lang.reflect; public class IsArrayDemo { public static void main(String[] args) { int[][] matrix = {{1, 1}, {2, […]

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.