Archive for the ‘Java’ Category

How to change the default version of JDK on the Mac

May 4, 2008


Mac Java Preferences
On the Mac, there is an application called Java Preferences. You can use the Spotlight to find it. Launch the Java Preferences and in the Java Application Runtime Settings panel, drag the version of the JDK that you wish to use to the top. Save and restart any terminal applications that you may have had opened and you should be set.

JDBC Query Logging Parameters

February 16, 2008

Every once in while I need to log slow queries using the JDBC logging parameters and it always takes me a while to find this information. So here it is (line breaks for readability):


?profileSQL=true&
slowQueryThresholdMillis=100&
autoSlowLog=true&
explainSlowQueries=true&
gatherPrefMetrics=true&
logSlowQueries=true

Simply add the above parameters to your JDBC connection string.

JVM parameters to enable remote debugging

January 25, 2008

Here are the Java JVM options to enable remote debugging:

-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000