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 API05 Nov 2006

How do I convert string to an integer or number?

package org.kodejava.lang; public class StringToInteger { public static void main(String[] args) { // Some random selected number, could representing a decimal, // hexadecimal or octal number. String myLuckyNumber = "13"; // We convert a string to an integer by invoking parseInt() method // of the Integer class. int number = Integer.parseInt(myLuckyNumber); System.out.println("My lucky number is: […]

Wayan · 1 menit baca
ZIP AND GZIP / CATATAN</>
Zip and GZIP03 Nov 2006

How do I create a zip file?

package org.kodejava.util.zip; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; public class ZippingFileExample { public static void main(String[] args) { String source = "data.txt"; String target = "data.zip"; try (ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(target)); InputStream is = ZippingFileExample.class.getResourceAsStream("/" + source)) { if...

Wayan · 1 menit baca
JDBC / CATATAN</>
JDBC02 Nov 2006

How do I get all table names from a database?

package org.kodejava.jdbc; import java.sql.*; public class GettingTableListExample { 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, USERNAME, PASSWORD)) { // Gets the metadata of the database DatabaseMetaData metaData = connection.getMetaData(); String[]...

Wayan · 1 menit baca
JDBC / CATATAN</>
JDBC30 Okt 2006

How do I drop table from a database?

This example is to show you how to delete or drop a table from your database. Basically we just send a DROP TABLE command and specify the table name to be deleted to the database. The example below show you how to do it in MySQL database. package org.kodejava.jdbc; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; […]

Wayan · 2 menit baca
JDBC / CATATAN</>
JDBC29 Okt 2006

How do I create a table in a database?

In this example you can see how to create a table in MySQL database. We create a table called book with the following fields, id, isbn, title, published_year and price. We start by creating a connection to the database and execute the create table query. package org.kodejava.jdbc; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; […]

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.