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 API12 Mei 2010

How do I get the uptime of a JVM?

The following code snippet demonstrates how to get the time for how long has the JVM been running. package org.kodejava.lang.management; import java.lang.management.ManagementFactory; import java.lang.management.RuntimeMXBean; public class GetUptime { public static void main(String[] args) { RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean(); // Returns the uptime of the Java virtual machine in // milliseconds. long uptime = bean.getUptime(); System.out.printf("Uptime...

Wayan · 1 menit baca
JDBC / CATATAN</>
JDBC07 Mei 2010

How do I limit MySQL query result?

package org.kodejava.jdbc; import java.sql.DriverManager; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class SqlLimitExample { 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) { try (Connection connection = DriverManager.getConnection(URL,...

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API06 Mei 2010

How do I append and replace content of a StringBuffer?

A StringBuffer is like a String, but can be modified. StringBuffer are safe for use by multiple threads. The methods are synchronized where necessary so that all the operations on any particular instance behave as if they occur in some serial order that is consistent with the order of the method calls made by each […]

Wayan · 2 menit baca
JDBC / CATATAN</>
JDBC05 Mei 2010

How do I set the fetch size of a statement?

Fetch size is the number of rows that should be fetched from the database on a single database network trip. When more rows are needed, another request is sent by the application to the database server. Setting the correct fetch size will help our program to perform better by reducing the network communication generated between […]

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API02 Mei 2010

How do I insert a string to a StringBuffer?

package org.kodejava.lang; public class StringBufferInsert { public static void main(String[] args) { StringBuffer buffer = new StringBuffer("kodeava"); System.out.println("Text before = " + buffer); // |k|o|d|e|a|v|a|…. // 0|1|2|3|4|5|6|7|… // // From the above sequence you can see that the index of the // string is started from 0, so when we insert a string in // […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API02 Mei 2010

How do I remove some characters from a StringBuffer?

The example below show you to remove some elements of the StringBuffer. We can use the delete(int start, int end) method call to remove some characters from the specified start index to end end index. We can also remove a character at the specified index using the deleteCharAt(int index) method call. package org.kodejava.lang; public class […]

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