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 API20 Dec 2006

How do I format a date into dd/MM/yyyy?

Formatting how data should be displayed on the screen is a common requirement when creating a program or application. Displaying information in a good and concise format can be an added values to the users of the application. In the following code snippet we will learn how to format a date into a certain display […]

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

How do I get my web application real path?

This code helps you to get the physical path where your web application is deployed on the server. It may be useful, so you can for instance read or write files on the server. Please be aware that this method will only work when your web application is deployed in an exploded way, if it […]

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

How do I get the last day of a month?

package org.kodejava.util; import java.text.DateFormatSymbols; import java.util.Calendar; public class LastDayOfMonth { public static void main(String[] args) { // Get a calendar instance Calendar calendar = Calendar.getInstance(); // Get the last date of the current month. To get the last date for a // specific month you can set the calendar month using calendar object // calendar.set(Calendar.MONTH, […]

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

How do I get the last date of a month?

You want to know what is the last date for a current month. The code below show you how to get it. package org.kodejava.util; import java.util.Calendar; public class LastDateOfMonth { public static void main(String[] args) { // Get a calendar instance Calendar calendar = Calendar.getInstance(); // Get the last date of the current month. To […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API14 Dec 2006

How do I convert day-of-the-year to date?

In the following example we want to get the date of the specified day-of-the-year. We can define a calendar for a specific day of the year by setting the java.util.Calendar object DAY_OF_YEAR field using the set() method. The method take the field to be set and a value. package org.kodejava.util; import java.util.Calendar; public class DayOfYearToDate […]

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

How do I use JNDI to get database connection or data source?

package org.kodejava.jndi; import javax.naming.Context; import javax.naming.InitialContext; import javax.servlet.Servlet; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.sql.DataSource; import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import...

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.