Friday 15 October 2010

Java Tooling

A list of tools I like to use:
  • JBoss Tattletale 1.1
  • JavaMelody
  • Hudson

Pass by Reference or Pass by Value?

The best explanation of how Java deals with

  • Pass By Reference and
  • Pass by Value
I've read in a long time.

http://www.yoda.arachsys.com/java/passing.html

Friday 8 October 2010

Showing your Microsoft SQL JDBC Driver Version

I wanted to find out which Microsoft MS SQL JDBC Driver I was using, without tearing open .jar files and reverse engineering stuff. Here's some Java Reflexion that does what I wanted.
try {
    Class cls = Class.forName("com.microsoft.sqlserver.jdbc.SQLJdbcVersion");
    Field fieldlist[] = cls.getDeclaredFields();
    for (Field fld: fieldlist) 
    {
        fld.setAccessible(true);
        out.append("<tr><td>" + fld.getName() + ":" + fld.getInt(cls)+ 
            "</td></tr>");
    }
}
catch (Throwable e) 
{
    log.error("problem getting sql driver version", e);
}