Skip to main content

Posts

Showing posts from January, 2006

Are the Intel iMacs as good as Apple Claim?

A few weeks ago when the new Apple iMacs were released, there was a flurry of activity in the blog space about whether the new iMacs are the perfect machine for Java or not. Since then, I’ve see articles that compare the Intel iMacs to their PowerPC brothers but not any articles comparing them from a developer point of view. So, does anyone have one of these new machines? Do they run Java better than the PowerPC counterparts?

Sun Java Studio Enterprise

Thanks to this post on The Pragmatic Architect I’ve downloaded Sun’s Java Studio Enterprise with the intention of using it for UML modelling. I’ve only played with it so far, but it looks like a comprehensive UML modelling package. I’ll post some more notes when I’ve used it further.

New Microsoft 2005 (2000) JDBC Driver Released

The new Microsoft SQL Server 2005 driver has been released and can be downloaded from here. The new driver is a type 4 driver that has been completely written from scratch and supports SQL Server 2000 as well as 2005. Accoring to MS, its been tested against Weblogic, Websphere, JBoss and Sun AS. Currently I’m using the jTDS drivers for connection to SQL Server and they seem pretty reliable. Its probably a bit early for any comparisons (the new driver was only released yeaterday), but if anyone knows any, please post a link in the comments.

NetBeans support for Subversion

Its good to see that a Subversion project web page has been created on the NetBeans web site. The aim of this project is to deliver good Subversion client support to NetBeans similar to that of the new CVS support . Accoring to the web page, the project is currently in its planning stage with the goal of having a prototype in May 2006. More details of this can be found at http://subversion.netbeans.org/teepee/ I hope the project team looks at TortoiseSVN and gets a bit of inspiration from this product. This has got to be one of the best SVN front ends available (Windows only I’m afraid).

Enumerating Ant targets programatically

In my previous blog post, I provided some sample code showing how to execute ant targets programatically from Java. This code showed how to execute the default ant target. Enumerating the targets is a similarly easy process. The code below shows how to iterate through all the ant targets within an ant build file. Project p = new Project(); // Setup Project p Hashtable table = p.getTargets(); Set set = table.keySet(); Iterator iter = set.iterator(); while (iter.hasNext()) { System.out.println("Target:"+(String)iter.next()); }

Executing Ant tasks programatically

Executing ant tasks programatically via Java is fairly straightforward as shown in the following code sample. To compile and run the following code, ensure you have ant.jar, xercesImpl.jar, xml-apis.jar and ant-launcher.jar (all from the ant lib directory) on your claspath. /* * AntRunner.java */ import java.io.File; import org.apache.tools.ant.DefaultLogger; import org.apache.tools.ant.Project; import org.apache.tools.ant.ProjectHelper; import org.apache.tools.ant.taskdefs.Ant; public class AntRunner { public AntRunner() { } public static void main(String args[]) throws Exception { File buildFile = new File("/path/to/build.xml"); Project p = new Project(); p.setUserProperty("ant.file", buildFile.getAbsolutePath()); p.init(); ProjectHelper helper = ProjectHelper.getProjectHelper(); p.addReference("ant.projectHelper", helper); helper.parse(p, buildFile); ...