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.

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
JDBC / NOTES</>↗
JDBC25 Oct 2006

How do I retrieve values from ResultSet?

Here is another example on how to read data from a ResultSet returned by executing an SQL query in a database. We start by creating a connection to the database. Creates a PreparedStatement to execute a query to get some data from the books table. After executing the PreparedStatement we will have a ResultSet object. […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API21 Oct 2006

How do I know the minimum and maximum number in an array?

package org.kodejava.util; import java.util.Arrays; import java.util.Collections; public class ArrayMinMax { public static void main(String[] args) { // Creates an array of integer numbers in it. Integer[] numbers = {8, 2, 6, 7, 0, 1, 4, 9, 5, 3}; // To get the minimum or maximum value from the array we can // use the Collections.min() […]

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.