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 API07 Okt 2007

How do I read system property as an integer?

The Integer.getInteger() methods allows us to easily read system property and convert it directly to Integer object. This method call the System.getProperty() method and then convert it to integer by calling the Integer.decode() method. package org.kodejava.lang; public class IntegerProperty { public static void main(String[] args) { // Add properties to the system. In this example […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API04 Okt 2007

How do I decode string to integer?

The static Integer.decode() method can be used to convert a string representation of a number into an Integer object. Under the cover this method call the Integer.valueOf(String s, int radix). The string can start with the optional negative sign followed with radix specified such as 0x, 0X, # for hexadecimal value, 0 (zero) for octal […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API29 Sep 2007

How do I get MAC address of a host?

Previously for obtaining a MAC address we need to use a native code as a solution. In JDK 1.6 a new method is added in the java.net.NetworkInterface class, this method is getHardwareAddress(). package org.kodejava.net; import java.net.InetAddress; import java.net.NetworkInterface; import java.net.SocketException; import java.net.UnknownHostException; public class MacAddress { public static void main(String[] args) { try { // […]

Wayan · 1 menit baca
HIBERNATE / CATATAN</>
Hibernate28 Sep 2007

How do I retrieve a list of Hibernate’s persistent objects?

In this example we add the function to read a list of records in our LabelService class. This function will read all Label persistent object from database. You can see the other functions such as saveLabel, getLabel and deleteLabel in the related example section of this example. package org.kodejava.hibernate.service; import org.hibernate.Session; import org.kodejava.hibernate.SessionFactoryHelper; import org.kodejava.hibernate.model.Label; […]

Wayan · 2 menit baca
HIBERNATE / CATATAN</>
Hibernate23 Sep 2007

How do I delete persistent object in Hibernate?

Continuing the previous example How do I get object from database in Hibernate?, we now add the delete function in our LabelService class. package org.kodejava.hibernate.service; import org.hibernate.Session; import org.kodejava.hibernate.SessionFactoryHelper; import org.kodejava.hibernate.model.Label; public class LabelService { public Label getLabel(Long id) { Session session = SessionFactoryHelper.getSessionFactory().getCurrentSession(); session.beginTransaction(); // We g...

Wayan · 2 menit baca
HIBERNATE / CATATAN</>
Hibernate19 Sep 2007

How do I retrieve object from database in Hibernate?

In the How do I store object in Hibernate? example you’ll see how tho store objects into database. In this example we’ll extend the LabelService class and add the capability to get or query object from database. package org.kodejava.hibernate.service; import org.hibernate.Session; import org.kodejava.hibernate.SessionFactoryHelper; import org.kodejava.hibernate.model.Label; public class LabelService { public Label getLabel(Long id) { Session […]

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