Autowiring a bean manually with Spring

Autowiring a bean manually with Spring
When creating a functional test that uses Spring and a resource, such as DB2, it's helpful to have a common context file which defines my ConnectionFactory to the database. But I need a way to inject that factory into my DAO. In general, I try not to...

Groovy Copybook Slurper

Groovy Copybook Slurper
In order to call CICS from Java, we've traditionally used RDz to generate a J2C bean via an Ant script. But I don't have RDz anymore (it doesn't support Groovy and always running older versions of Eclipse), so my only alternative was to use...

Generating Lots Values From A DB2 Sequence Object

Generating Lots Values From A DB2 Sequence Object
I was working on a Groovy script that inserts lots of data into a database, but I needed to generate a new key from a sequence object and keep track of the old one. So I need to invoke NEXTVAL for each key, but considering how many thousands of records...

Accessing Numeric Value Somewhere in a DB2 Column

Accessing Numeric Value Somewhere in a DB2 Column
We recently had some inconsistent data in our database that required a pretty special query. The column contained what should have been a three byte marketing territory number, but depending on what application/user entered the data, the value could...

Groovy Overload (of Operators)

Groovy Overload (of Operators)
I was recently working on a pretty long class which mapped a web-service response to a set of 'activity codes' in our Java application. The class ends up mapping some 60+ different codes based on various scenarios, and appends some extra data for some....

Groovy Tabular Data DSL

Groovy Tabular Data DSL
After using Spock, I became really interested in the tabular input of data into my services, not just into my test. The project I'm working on has a lot of transaction data with various associated properties. So transaction type 1, has fee type A associated...

Generate COBOL Copybook Output From DB2 Using JCL

Generate COBOL Copybook Output From DB2 Using JCL
Several of my last few posts have involved data manipulation, and for the most part I've been using Groovy. However, what I really like about Groovy is writing less code, and there are times when other tools, JCL in this case, can help me write even...

COBOL Data Type File Formatting

COBOL Data Type File Formatting
Since a lot of existing COBOL jobs take flat files as input, and produce flat files, I've been doing some experimenting with data manipulation in COBOL friendly formats. Much of the formatting is pretty straight forward, if you have a variable defined...

Groovy Method References

Groovy Method References
I was listening to a podcast recently about Eclipse tooling for Java 8 and heard them talking about method references, and one of my co-workers mentioned it as a feature in Groovy. I recently ran across a problem which seemed particular well suited for...

Groovy LazyMap - Caching Map

Groovy LazyMap - Caching Map
I was working on a Groovy class recently which involved putting a series of closures into a map to do some processing when invoked, but I realized that I didn't really want to run the closures each time they were accessed, once they ran the first time,...

FixedLengthSlurper for Groovy Fixed Length File Parsing

FixedLengthSlurper for Groovy Fixed Length File Parsing
Since I work in a company that relies heavily on COBOL processing, we have a lot of fixed length files in our batch environment and occasionally I end up interacting with these files in Java. Traditionally we've used an IBM proprietary product to generate...

Pivot Database Rows Into A Single Column

Pivot Database Rows Into A Single Column
There are times when a result single record is desired instead of multiple rows, for instance when joining a main table again multiple records in a child table. Say that I have an email and recipients table as follows EMAILS -------------------------------------------------- ID...

Printing Tabular Data

Printing Tabular Data
Sometimes when I'm running tests, or pulling information from a database, I want to see the results in table so that it's easy to parse through the information and see what's there. For instance, let's say that I wanted to see the following information...
Page 1 of 41234Next »