- JBoss Tattletale 1.1
- JavaMelody
- Hudson
Friday, 15 October 2010
Pass by Reference or Pass by Value?
The best explanation of how Java deals with
- Pass By Reference and
- Pass by Value
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);
}
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);
}
Subscribe to:
Posts (Atom)