Given a simple Java application with a Thread object, we want to block the main thread until the Thread object completes its execution. The main thread is where the Thread object is created and its start method invoked.
SFTP in Batch Mode Hangs Using Runtime.exec() in Java
When we have applications that call native commands via java.lang.Runtime.exec(), be wary of the invocations. It could potentially output an overwhelmingly large number of texts to the standard output—for example, the sftp command in Linux. Therefore, causing the codes to hang.
Invoking JavaScript from within an Applet
If you did not know that you can invoke JavaScript from within an Applet, chances are you would port most JavaScript codes to Java or, worse, resort to some exotic coding. Otherwise, you would reuse the existing codes. This post
Using JPoller
JPoller is a general purpose Java component to poll directories and asynchronously notify client code of incoming files.
Find Out the Differences between Two Objects in Java
This post demonstrates how to identify and list the differences between two objects using a set of classes and interfaces from Apache Commons Lang. Classes, Intefaces, and pom.xml The classes and interfaces to be used for this post are as
EJB2.0 with OpenEJB: Session Bean and the Remote Client
This is the second part of the blog I wrote about EJB2.0 with OpenEJB. On the first part, we created a stateless session bean and deployed it in OpenEJB. On this part, we write, and test a simple Java class that remotely uses the deployed session bean.
Understanding How Java Works With Files
The Java java.io.File (File class for short) connects Java and the Operating System to read from and write to files. It can represent either a file or a directory. How files and directories are organized in the file system depends
How to connect Java to PostgreSQL using JDBC
This is a simple post that shows how to connect Java to PostgreSQL using JDBC. Although most Java developers do not use this technique anymore, frameworks still do, and the codes are abstracted away from us. Meanwhile, some may still
Spring Boot Call Stored Procedure With Spring Data @Procedure
Although most applications use SQL statements, we may need to call stored procedures instead. For instance, we could reuse existing stored procedures instead of crafting new codes. As a result, we do not need to create new test cases, and
Write Out XML Tags in Java using Lambda
Missed writing out an XML element end tag in your Java codes? You’re not alone. It is acceptable for small XML documents because spotting the erring codes is relatively easy. However, things may get very frustrating when writing huge XML