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 API12 Jun 2010

How do I create port scanner program?

In this example you’ll see how to create a simple port scanner program to check the open ports for the specified host name. package org.kodejava.net; import java.io.IOException; import java.net.InetAddress; import java.net.Socket; public class PortScanner { public static void main(String[] args) throws Exception { String host = "localhost"; InetAddress inetAddress = InetAddress.getByName(host); String hostName = inetAddress.getHostName(); […]

Wayan · 1 min read
JDBC / NOTES</>↗
JDBC09 Jun 2010

How do I get the maximum number of concurrent connections?

This example shows you how to get the maximum number of concurrent connections to a database that are possible. To get this information, we use the DatabaseMetaData.getMaxConnections() method call. If the return value is zero, it means that there is no limit or the limit is unknown. package org.kodejava.jdbc; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.SQLException; […]

Wayan · 2 min read
JDBC / NOTES</>↗
JDBC07 Jun 2010

How do I check whether a driver is JDBC compliant?

package org.kodejava.jdbc; import java.sql.Driver; import java.sql.DriverManager; import java.sql.SQLException; public class JDBCCompliant { private static final String URL = "jdbc:mysql://localhost/kodejava"; public static void main(String[] args) { try { Driver driver = DriverManager.getDriver(URL); // Check if the driver is a genuine JDBC compliant driver. if (driver.jdbcCompliant()) { System.out.println("A genuine JDBC compliant driver"); } else { System.out.println("Not...

Wayan · 1 min read
JDBC / NOTES</>↗
JDBC07 Jun 2010

How do I get JDBC driver property information?

The example below shows you how to get the information about the possible properties for the corresponding JDBC driver. package org.kodejava.jdbc; import java.sql.*; public class DriverPropertyInfoDemo { private static final String URL = "jdbc:mysql://localhost/kodejava"; public static void main(String[] args) { try { // Gets information about the possible properties for this // driver. Driver driver […]

Wayan · 2 min read
JDBC / NOTES</>↗
JDBC03 Jun 2010

How do I check if the OUT parameter value is null?

This example show you how to use the CallableStatement.wasNull() method call to see if the last OUT parameter has a value of SQL NULL. package org.kodejava.jdbc; import java.math.BigDecimal; import java.sql.Connection; import java.sql.CallableStatement; import java.sql.DriverManager; import java.sql.Types; import java.sql.SQLException; public class WasNullExample { private static final String URL = "jdbc:mysql://localhost/kodejava"; private static final String USERNAME = […]

Wayan · 2 min read
BASIC / NOTES</>↗
Basic02 Jun 2010

How do I convert double value into int value?

To convert double value into an int value we can use type casting or using the Double.intValue() method call. The code snippet below show you how to do it. package org.kodejava.basic; public class DoubleToInt { public static void main(String[] args) { Double numberA = 49.99; System.out.println("numberA = " + numberA); // Converting Double value to […]

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.