Add them to your site:
ACCU: professionalism in programming ACCU: professionalism in programming
ACCU London February 2009 Meeting

Thursday 19th February 2009, 18:30

Paul Grenyer: Boiler-Plating Database Resource Cleanup in Java

Java is a garbage collected language. If garbage collection is meant to help clean up memory, why hasn't something been developed to help objects release resources? Java has finalizers, but as Joshua Bloch points out in 'Effective Java', finalizers cannot be relied upon. Proper cleanup of resources is left to the developer whose only real friend is 'finally'.

Paul Grenyer covered database resource cleanup using the 'Finally for Each Release' pattern in the January 2009 edition of CVu. To familiarise the audience with the problems and the scale of unnecessary code that must be written repeatedly, Paul will first get them to help him write some JDBC code to execute an update statement, and then expand it to execute and process the result set from a select statement.

Paul will use the 'Execute Around Method' pattern to show that most of that code only needs to be written once. Along the way he'll briefly discuss the pros and cons of checked exceptions versus runtime exceptions, and touch on inheritance versus composition in Java. The audience should have a reasonable understanding of Java, including features such as generics and anonymous classes.

About the Speaker

Paul has been programming in one form or another for over 20 years. After several years using C++ and a brief period using C#, Paul has now ended up somewhere he hoped he'd never be, programming in Java, and finding he really quite likes it. After time in industries such as marking machinery, direct mail, mobile phones, investment banking and Internet TV, Paul is currently working for an exciting new insurance industry based start-up in Norwich. He has been an ACCU member since 2001, a regular contributor to its publications (including the new Desert Island Books column), creator of the mentored developers, and a committee member for most of that time. When he's not programming or getting used to married life and being a step parent, Paul thoroughly enjoys science fiction, heavy metal, reading and cycling.