Java, Software Development

Java – Closing JDBC Database Resources with try-with-resources

This post demonstrates how to use Java JDBC API with try-with-resources database resources in the following order – ResultSet, Statement, and Connection. The try-with-resources is a new exception handling mechanism

Read More...

Java, Java Tutorial, Software Development

Chapter 7: Java Classes And Access Modifiers – Review

Java classes and their variables and methods can use access modifiers – private, public, protected, and package-level (no keyword). These access modifiers set the classes’ visibility, constructors, and instance or

Read More...

Java, Software Development

Java – Block main thread until another Thread completes

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.

Read More...

Java, Software Development

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

Read More...

Java, Software Development

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

Read More...

Java, Software Development

Using JPoller

JPoller is a general purpose Java component to poll directories and asynchronously notify client code of incoming files.

Read More...

Java, Software Development

Generate Java classes from WSDL files using cxf-codegen-plugin

This post demonstrates how to generate Java classes from WSDL files using cfx-codegen-plugin. This means we require Maven for this purpose.

Read More...

Java, Software Development, Tomcat

Java Web Application BASIC Authentication in Tomcat

The fastest way to configure authentication in Tomcat is Basic Authentication. However, it is one of the weakest forms of authentication and we should not use it in real-life applications.

Read More...

Java, Software Development

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

Read More...

Java, Software Development

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.

Read More...