SupportWriter space ↗
A JOURNAL ABOUT TECHNOLOGY

Learn something new.
Write. Share.

A space to connect knowledge, one line of code a day.
Discover tutorials, ideas, and notes from a learning journey.

1967 notes & counting ↙
EDITOR’S PICK ↗
Pentesting

Planning Your First Web Application Pentest: Scope, Safety, and Evidence

Build a focused web pentest plan with clear authorization, realistic objectives, controlled testing, and evidence that developers can use.

D Putu Adi Guna Permana · 3 min read
FOR YOUR CURIOSITY

Latest notes.

CORE API / NOTES</>↗
Core API07 Oct 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 min read
CORE API / NOTES</>↗
Core API04 Oct 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 min read
CORE API / NOTES</>↗
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 min read
HIBERNATE / NOTES</>↗
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 min read
HIBERNATE / NOTES</>↗
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 min read
HIBERNATE / NOTES</>↗
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 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.