Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
PILIHAN EDITOR
Java

Memahami Java Stream: olah koleksi dengan lebih ringkas

Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.

D Tim Diary Coding · 1 menit baca
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

CORE API / CATATAN</>
Core API14 Des 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 menit baca
CORE API / CATATAN</>
Core API11 Des 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 menit baca
CORE API / CATATAN</>
Core API07 Des 2006

How can I get current working directory?

A system properties named user.dir can be used if you want to find the current working directory of your Java program. package org.kodejava.io; public class CurrentDirectoryExample { public static void main(String[] args) { // System property key to get current working directory. String USER_DIR_KEY = "user.dir"; String currentDir = System.getProperty(USER_DIR_KEY); System.out.println("Working Directory: " + currentDir); […]

Wayan · 1 menit baca
SERVLET / CATATAN</>
Servlet06 Des 2006

How do I check if parameter is exists in servlet request?

ServletRequest or HttpServletRequest object has a map object that maps parameter name and its value. By accessing this map we can check if a parameter was passed in servlet request. Let’s see the example below. package org.kodejava.servlet; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOExcepti...

Wayan · 1 menit baca
SERVLET / CATATAN</>
Servlet06 Des 2006

How do I get parameter names from servlet request?

This example show you how to obtain parameter name from servlet request. By calling request.getParameterNames() you will get an Enumeration object by iterating this object you can get the parameter names. package org.kodejava.servlet; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; im...

Wayan · 2 menit baca
SERVLET / CATATAN</>
Servlet03 Des 2006

How do I read request parameter from servlet?

When creating an application with Java servlet most of the time we will work with the request and response object. From the request object we can read the parameter submitted by the user’s browser either through an HTTP GET or POST method. Basically what you need to know is when you try to get the […]

Wayan · 3 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.