Navigation

RSS 2.0 New Entries Syndication Feed Atom 0.3 New Entries Syndication Feed

Show blog menu v

 

General

Use it

Documentation

Support

Sibling projects

RIFE powered

Valid XHTML 1.0 Transitional

Valid CSS!

Blogs : Latest entries

avatar
< Previous page 
Speaking at TSSJS 2008 Europe in Prague

Next month I'll be speaking at TheServerSide.com Java Symposium.

The topics I will cover are:

I've done both sessions before and they're pretty solid now.

The 'Boldly go...' one has been a huge success at JavaOne as it was booked completely full and I did a repeat session on Friday that still had quite good attendance.

See you in Prague!

speaking at TSSJS 2008

posted by Geert Bevin in Java on May 21, 2008 12:41 PM : 0 comments [permalink]
 
Closing several JDBC statements cleanly

It's been a while since I wrote some raw JDBC code. I didn't remember that it was so tedious to manually close a series of PreparedStatement objects and make sure that any exception was properly handled and reported.

Note that the ARM blocks or BGGA closures proposals don't make this easier since this cleanup should be done after the prepared statements have been used for a while in various other methods, it doesn't automatically have to be done at the end of a lexical scope.

This is what I came up with.

Of course, you could write an alternative implementation that creates some kind of repository for the prepared statements in a map and then provide a method that closes them all by going over the entries of the map while preserving the exceptions in a similar manner. Any other suggestions or comments for this to be done better?

private PreparedStatement psStmt1;
private PreparedStatement psStmt2;
private PreparedStatement psStmt3;
 
public void cleanup() throws SQLException {
  SQLException exception = null;
  if (psStmt1 != null) {
    try {
      psStmt1.close();
    } catch (SQLException e) {
      exception = e;
    } finally {
      psStmt1 = null;
    }
  }
 
  if (psStmt2 != null) {
    try {
      psStmt2.close();
    } catch (SQLException e) {
      if (exception != null) e.setNextException(exception);
      exception = e;
    } finally {
      psStmt2 = null;
    }
  }
 
  if (psStmt3 != null) {
    try {
      psStmt3.close();
    } catch (SQLException e) {
      if (exception != null) e.setNextException(exception);
      exception = e;
    } finally {
      psStmt3 = null;
    }
  }
 
  if (exception != null) {
    throw exception;
  }
}
posted by Geert Bevin in Java on Jan 30, 2008 6:11 PM : 5 comments [permalink]
 
Java Champions interviews at JavaPolis 2007

At JavaPolis 2007, Aaron Houston the coordinator of the Sun Java Champions program, recorded a whole collection of short interviews with the Java Champions that were present at the conference (2-8 mins).

If you're wondering what the Java Champions are up to, or even who or what they are, this is a easy and quick way to find out.

The interviews can be found on the Java Champions homepage and will eventually move to the library section.

You can listen to my interview directly here (6 min 12 MB):

https://java-champions.dev.java.net/mp3/JP07-geert-bevin.mp3

posted by Geert Bevin in Java on Jan 4, 2008 7:20 PM : 0 comments [permalink]
 
I got featured on the Sun Developer Network

The Java Champions program has already opened many doors for me and today an interview that Steven Meloan took with me has been published on the Sun Developer Network. I would never have dreamed of this a year ago, these are very exciting times :)

If you're interested, you can read it here.

posted by Geert Bevin in Java on Dec 15, 2006 12:19 AM : 2 comments [permalink]
 
Late night JavaPolis quote
Yanto says:
"Kito, can I abuse you?"

D'oh!
posted by Geert Bevin in Java on Dec 13, 2006 11:33 AM : 1 comment [permalink]
 

< Previous page 
 
 
 
Google
rifers.org web