On 06/03/2012 18:03, Alan.Scott wrote:
>> I would suggest, as your first step, see if this code works when you
>> execute it outside a Saxon environment. Depending on the result, that
>> will tell us what to try next.
>> You don't say which Saxon version you are using, but I don't think there
>> has been any significant change in this area for a while.
> Thanks for your reply. I generated a simple java class based on the code you
> provided. I added a System.out to show if the connection was closed, the
> driver version, and the Saxon version.
> Results:
> Connection.isClosed: false
> metadata.getDriverVersion: mysql-connector-java-3.1.4-beta ( $Date:
> 2004/08/12 20:28:29 $, $Revision: 1.27.4.42 $ )
> Saxon Version: 9.1.0.3
> Saxon Schema-aware: SA 9.1.0.3
Sorry, I'm not quite sure what you are telling me here. Are you saying
that connecting with these parameters succeeded?
I'd like to take a look at the exact Java code that succeeded and the
exact XSLT code that is failing, including the way you invoke it and
supply parameters, to see if I can see any way the parameters passed to
the JDBC code differ in the two cases.
I've gone back to the old 9.1 code, and it is a bit different. It reads
like this:
try {
// the following hack is necessary to load JDBC drivers
Class.forName(dbDriverString);
connection = DriverManager.getConnection(dbString,
userString, pwdString);
} catch (Exception ex) {
dynamicError("JDBC Connection Failure: " +
ex.getMessage(), SaxonErrorCode.SXSQ0003, context);
}
So the "JDBC Connection Failure" message could in fact be a failure to
load the driver class. Is there any possibility that you are supplying
the driver class name incorrectly, with "/" rather than "." as a
separator? What message do you get if you deliberately supply the driver
class name incorrectly?
(Even if you don't want to move forward beyond the 9.1 release, you
should be using 9.1.0.8 rather than 9.1.0.3. But I doubt very much it
will affect this issue.)
Michael Kay
Saxonica
>
> Executing my style sheet still gives this error:
> Error on line 11 of customLoader.xslt:
> SXSQ0003: JDBC Connection Failure: com/mysql/jdbc/Driver
> in variable connection
> (file:/c:/tools/qa/run/resources/xml/customLoader.xslt#10)
> at xsl:apply-templates
> (file:/c:/tools/qa/run/resources/xml/customLoader.xslt#23)
> processing /Report/Tests[1]/Test[1]
> dbLoad() error: JDBC Connection Failure: com/mysql/jdbc/Driver // this is
> from the calling java code.
>
> Do you have any other suggestions I might try.
> Regards,
> Alan
|