| 16 September 2002 |
Xalan and MySQL using SQL Extensions
Another time sink but after three days of gnashing my few remaining teeth I've eventually got the Xalan<->SQL connection working using MySQL. I was caught out mainly by the features of Java 1.4. When I first tried the examples in the Xalan SQL directory using a connection to an existing MySQL DB and using the com.mysql.jdbc.Driver I kept getting an error message like "Invalid driver name". After running java org.apache.xalan.xslt.EnvironmentCheck I got a bit of a shock, the instance of Xalan being used was listed as 2.2d, eh? Where did that come from? I'm using, or rather I thought I was using the binary of 2.4 but it was another version that was being being picked up instead. Turns out to that Java 1.4 already has a version of Xalan inside rt.jar, sneaky beggars, you mean all this time I already had Xalan waiting to be used...argh, they keep that quiet! But the problem is that under Java 1.4 the Xalan jars should be inside the /lib/endorsed directory in your Java runtime directory so that they override the 'built-in' versions. So I put xalan.jar, xercesImpl.jar, xml-apis.jar and mysql-connector-java-2.0.14-bin.jar in the endorsed directory. Then back to the code, at least now the driver errors stopped but trying all the xalan examples in the samples/sql directory all I was getting back was one row of results rather than the table. There are mistakes in the HTML docs and the sql samples provided, changing all references from row-set/row to row-set in the examples finally got it working. Jeez what a scunner, it's frustrating to have so little progress and so little to show for the hours I'm putting in. It's so difficult to keep up-to-date all the parts of the jigsaw puzzle that is the configuration of the environment and the OS-specific issues. Bah, writing code is the 'easy' part ;-). 8:32:16 PM© Copyright 2002, Scottish Lass, www.scottishlass.co.uk, Contact: