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.

HIBERNATE / CATATAN</>
Hibernate16 Sep 2007

How do I store object in Hibernate?

This example shows you how to store or save Hibernate object to database. The basic steps in creating application in Hibernate will be: Creates the POJO Create hibernate mapping file Register the mapping file in hibernate configuration Create a simple service class to store the object In this example we’ll create a class called Label, […]

Wayan · 4 menit baca
HIBERNATE / CATATAN</>
Hibernate14 Sep 2007

How do I create Hibernate’s SessionFactory?

When creating an application the use Hibernate to manage our application persistence object we’ll need a SessionFactory. This factory creates or open a session to talk to a database. To create a SessionFactory we can define the configuration in hibernate.properties, hibernate.cfg.xml or create it programmatically. In this example we’ll use the hibernate.cfg.xml configuration file, which […]

Wayan · 4 menit baca
CORE API / CATATAN</>
Core API12 Sep 2007

How do I convert milliseconds value to date?

package org.kodejava.util; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; public class MillisecondsToDate { public static void main(String[] args) { // Create a DateFormatter object for displaying date information. DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss.SSS"); // Get date and time information in milliseconds long now = System.currentTimeMillis(); // Create a calendar object that will convert the date […]

Wayan · 1 menit baca
MAIL / CATATAN</>
Mail11 Sep 2007

How do I send an email with attachment?

In this example we create a small program to send email with a file attachment. To send message with attachment we need to create an email with javax.mail.Multipart object which basically will contain the email text message and then add a file to the second block, which both of them is an object of javax.mail.internet.MimeBodyPart. […]

Wayan · 3 menit baca
CORE API / CATATAN</>
Core API07 Sep 2007

How do I split a string using Scanner class?

Instead of using the StringTokenizer class or the String.split() method we can use the java.util.Scanner class to split a string. package org.kodejava.util; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class ScannerTokenDemo { public static void main(String[] args) { // This file contains some data as follows: // a, b, c, d // e, f, g, […]

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

How do I read file line by line using java.util.Scanner class?

Here is a compact way to read file line by line using the java.util.Scanner class. package org.kodejava.util; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class ScannerReadFile { public static void main(String[] args) { // Create an instance of File for data.txt file. File file = new File("README.md"); try { // Create a new Scanner object […]

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.