Home » Author Archives: Aldo Ziflaj

Author Archives: Aldo Ziflaj

Aldo Ziflaj

Aldo is a student of Computer Engineering and a programming addict. He spares his free time coding, whether mobile, web, or desktop programming. He is also one of the co-founders of Things Lab.

Java PostgreSQL Example

In this article I will discuss about PostgreSQL database and how to use it through Java code. PostgreSQL, or simply Postgres, is an Object-Relational Database Management System (ORDBMS). Its primary function is to store data, securely and supporting best practices, and retrieve it later, as requested by other software applications, be it those on the same computer or those running ...

Read More »

java.sql.BatchUpdateException – How to resolve Batch Update Exception

In this example I will discuss about BatchUpdateException and how to resolve it. This exception is thrown when an error occurs during a batch update operation. It provides (among others) the update counts for all commands that were executed successfully during the batch update. The BatchUpdateException class is a subclass of SQLException, which represents an exception that provides information on ...

Read More »

java.sql.PreparedStatement Example

In this example I will discuss about the PreparedStatement interface and its usage. This interface creates an object that represents a precompiled SQL statement. This object can then be used to efficiently execute this statement multiple times. The PreparedStatement interface extends the Statement interface, which is used for executing a static SQL statement and returning the results it produces. The ...

Read More »

java.sql.ResultSetMetaData Example

In this example I will discuss about ResultSetMetaData interface and its usage. It represents an object that can be used to get information about the types and properties of the columns in a ResultSet object. The ResultSetMetaData extends the Wrapper interface, which is an interface for JDBC classes that provide the ability to retrieve the delegate instance when the instance ...

Read More »

java.lang.ArrayStoreException Example

In this example we will discuss about ArrayStoreException. This exception is thrown when there has been made an attempt to store the wrong type of object into an array of objects. The ArrayStoreException extends RuntimeException, which means that it is an exception thrown at the runtime, so the try-catch block for this exception is not required. ArrayStoreException exists since JDK1.0. ...

Read More »

java.util.regex.PatternSyntaxException Example

In this example we will discuss about java.util.regex.PatternSyntaxException. This exception is thrown when a regex (a regular exception) pattern is not correct, i.e. has syntax errors. The PatternSyntaxException extends IllegalArgumentException, which means that an argument passed to a method is illegal or inappropriate. Just like IllegalArgumentException, PatternSyntaxException is a runtime exception (indirect subclass of RuntimeException). This means that the try-catch ...

Read More »

java.net.Inet4Address Example

In this example we will discuss about Inet4Address and its usage. Inet4Address represents an Internet Protocol version 4 (IPv4) address. Inet4Address is a subclass of InetAddress class, which represents either a 32-bit or 128-bit unsigned number used as an IP, the lower-level protocol on which protocols like UDP and TCP are built. The Inet4Address class exists since JDK1.4.     ...

Read More »

Fibonacci Series in Java Example

In mathematics, the Fibonacci series is a series of numbers, starting from 0 and 1, where every n-th number is the sum of (n-1)-th and (n-2)-th. It is named after Leonardo Fibonacci, an Italian mathematician who is considered as the most talented mathematician of the Middle Ages. He wrote about the series in his book Liber Abaci (Book of Calculation). ...

Read More »

Java Currency Example – Working with money

In this example we will discuss about Currency class and its usage. This class represents a currency based on the ISO 4217 currency codes. The class is designed so that there’s never more than one Currency instance for any given currency. Therefore, there’s no public constructor. You obtain a Currency instance using the getInstance() methods. Currency extends the Object class, ...

Read More »