Spring-Retry allows us to retry operations when the codes encounter exceptions. How do we limit the retries to specific exceptions only? For instance, we wouldn’t want to retry SOAP Web Service operations. The operations may throw exceptions due to invalid
Log Unencrypted SoapFault Messages in Apache CXF
This post shows how to log unencrypted SoapFault messages from Apache CXF in client applications. These applications use WS-Security for encryption and decryption. Note that this write-up assumes the reader is familiar with the more advanced stuff in SOAP-based web
How to Delete Files in Java without using third-party libraries
This post shows how to delete files in Java. Our codes will not use any third-party library to accomplish the task. Java Requirements We used the following items for this post. Note that the Java codes will still work on
How to use Quartz in a simple Java application
Some applications need some sort of background processes that support some aspect of a business process. This article demonstrates how to use Quartz in a simple Java application.
How to use Hibernate with simple JDBC application
This article demonstrates how to use Hibernate 4.3.x with MySQL 5.6.16 in Java using JDBC.
How to configure Log4j to log to console
Okay, you wrote a lot of Log4j debug statements all over your codebase but do not want them to appear in QA and/or Production environment. How to do that? You need to configure Log4j by modifying log4j.xml. You could also use log4j.properties in place of log4j.xml but some advanced settings can only be set using the latter. Might as well use something that offers greater benefits.
How to Log to Separate Files in Log4j2
You have a batch application that reads, parses interface files (i.e., data files from other sources usually legacy systems), and inserts data into your batch application’s database. All logs are written to a single file. Now, the business starts a
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 that makes it easier to correctly close resources used within
How to connect Java to MySQL using JDBC
This post shows how to connect Java to MySQL using JDBC. Therefore, nothing fancy here. Just JDBC basics. MySQL JDBC Requirements We used the following items for this post. Although we can use newer versions, the Java JDBC codes pretty
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.