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 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 min read
ZIP AND GZIP / NOTES</>↗
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 min read
JDBC / NOTES</>↗
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 min read
JDBC / NOTES</>↗
JDBC30 Oct 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 min read
JDBC / NOTES</>↗
JDBC29 Oct 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 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.