SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

CORE API / NOTES</>↗
Core API19 Jan 2008

How do I get package name of a class?

To get the package name of a class we can use the getClass().getPackage() method of the inspected object. package org.kodejava.lang; import java.util.Date; public class GetPackageName { public static void main(String[] args) { // Create an instance of Date class, and then obtain the class package // name. Date date = new Date(); Package pack = […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API18 Jan 2008

How do I get super class of an object?

To get the super class of an object we can call the object’s getClass() method. After getting the class type of the object we call the getSuperclass() method to get the superclass. Let’s see the code snippet below. package org.kodejava.lang; public class ObtainingSuperClass { public static void main(String[] args) { // Create an instance of […]

Wayan · 1 min read
REGEX / NOTES</>↗
Regex15 Jan 2008

How do I split up string using regular expression?

This code snippet uses the java.util.regex.Pattern.split() method to split-up input string separated by commas or whitespaces (spaces, tabs, new lines, carriage returns, form feeds). package org.kodejava.regex; import java.util.regex.Pattern; public class RegexSplitExample { public static void main(String[] args) { // Pattern for finding commas, whitespaces (spaces, tabs, new lines, // carriage returns, form feeds). String pattern […]

Wayan · 1 min read
JDBC / NOTES</>↗
JDBC10 Jan 2008

How do I get a list of stored procedure names?

package org.kodejava.jdbc; import java.sql.*; public class StoredProcedureListExample { 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 conn = DriverManager.getConnection(URL, USERNAME, PASSWORD)) { DatabaseMetaData metadata = conn.getMetaData(); ResultSet result = metadata.getProcedures("kodejava", "...

Wayan · 1 min read
JDBC / NOTES</>↗
JDBC07 Jan 2008

How do I read CLOBs data from database?

package org.kodejava.jdbc; import java.io.File; import java.io.FileWriter; import java.io.Reader; import java.nio.charset.StandardCharsets; import java.sql.*; public class ClobReadDemo { 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 conn = DriverManager.getConnection(URL, USERNAME, PASSWORD)) { Stri...

Wayan · 2 min read
JDBC / NOTES</>↗
JDBC02 Jan 2008

How do I store CLOBs data into database?

package org.kodejava.jdbc; import java.io.File; import java.io.FileReader; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; public class ClobInsertDemo { 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 conn = DriverManager.getC...

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.