Java

Programmatically overwritting the Database Connection of a Crystal Report File from Java

Recently I’ve had the “pleasure” of decommissioning existing applications in lieu of new systems coming online and as part of the process there was the need to Export Crystal Reports for Archival to ensure no loss of data. During this process the main stumbling block I experienced was how to overwrite the jndi DataSource defined

// Java //
Read More

Performing Batch processing with iBATIS and Spring

When utilizing the iBATIS framework you define your SQL Maps to perform the basic CRUD functionality and additional business logic for an individual item. Very often you will be only updating single objects at a time and this is great, but what happens on those occasions where you find yourself processing hundreds of objects at

Dynamically generating the Java Classpath within a shell script

One of the main maintenance issues with running a Java application from a shell script is keeping your classpath up-to-date with the new and updated jars. To make things more difficult you can’t specify a folder as the classpath as it doesn’t include the jars in it only .class files. However through the use of

Processing – an interesting tool for visualizing data and artistic creation through code.

Processing is an open source programming language that has been around since 2001, and has steadily become a comprehensive alternative to proprietary software for the creation of images, motion graphics and teaching aid to students. This Java based language and environment allows you to quickly and easily create mesmerizing graphics in 2D and 3D that

Code Snippets: How to use the deprecated and link javadoc tags

Over the lifespan of a software’s code source you will inevitably have to rename functions and properties of classes and maybe even remove them all together. This is not a major issue on simple projects but when your project is used by multiple applications then you may find that you need to keep these deprecated

The Constant Interface Antipattern – How not to define constants

When working in applications that utilize a lot of variables I often come across interfaces containing nothing but constants. Instead of creating a class containing the constants the developers choose to define them in an interface that can be implemented by a class so that constants don’t need to be qualified to a class in

Java Code Snippets: Performing a Single line or Inline if else statement

For some reason I have the utmost trouble remembering how to do a single line or inline if else statement. This article is mainly for myself so hopefully I will remember the next time I want to do an inline if else statement. The usual format for performing an if else statement is: if( $val1

How to define Dynamic SQL queries by using iBATIS Persistance Framework

How many times have you found yourself defining multiple find or search methods for obtaining data in your Web Applications. For example for a Users table you may have a findByName, findById, FindByEmail, and etc. Utilizing the iBATIS framework and SQL Maps we can have all these sql statements condensed into a single dynamic select

// Java // SQL //
Read More

Tips & Tricks: How to iterate over a collection using the for loop.

Most Java programmers are aware of how to initialize and use an iterator utilizing the basic while loop. In most cases developers will iterate over a collection for every element in it using the follow generic code: Iterator lIter = myList.iterator(); while(lIter.hasNext()) { … // some logic } However it is surprising how many developers

Java Tips & Tricks: Splitting a String on the Pipe “|” Delimeter

Recently I came across the issue in java where the split command I was executing was returning an array split on every character and not the | character as I had specified. String[] subStrings = myString.split( “|” ); The reason for this functionality is that the | character represent a character delimeter. To split the