JDK 7 - Try with Resources

JDK 7 has several enhancements to the try-catch construct. Try with resources allows for ensuring that resources are closed and freed up without the need to explicitly call the close function. Any class implementing java.lang.AutoCloseable can be automatically closed without the need for a finally section in the try block.

The syntax is a [...]

JDK 7 - use Strings in switch statements

JDK 7 adds the ability to use String objects as the case in switch blocks. It’s not exactly an earth shattering addition but I find it quite useful in avoiding long if-then chains. Plus the release docs claim that using a switch is more efficient.

At the bottom of this post is a small [...]

JDK 7 release candidate now available

Build 147 for JDK 7 is now available with the goal of a generally available release later this month. Some good resources are: Oracle’s Java 7 wiki Java 7 project page Get the release from the download page Oracle’s Java SE 7 documentation

As I test out the release I’ll do some posts on [...]

IBM and Oracle finally get together on OpenJDK

This is something I’ve personally hoped would happen eventually. Having all the big players in the space working with the open source community will help to prevent divergence between the open and commercial implementations. Throughout the Sun/Oracle bumps, Java has remained a popular choice for application development and this action should help continue it’s [...]

Combining Derby embedded mode and server mode

Recently there have been several occasions where I have needed an application to use an embedded driver but also needed to allow for the occasional login to the database externally while the application is executing. Derby works wonderfully for this and starting a server within the application is exceedingly simple. Here I will give [...]