Hi, Juraj
You may want to double check your environment and make sure that the
jdbc-driver jar file is inside %mySQL_Home%/bin directory. And the param
$database should be case sensitive, right? :
<xsl:param name="datasource" select="'jdbc:mySQL://localhost:3306/test'"/>
Christine Li
XSLT Development
IBM Toronto Lab
Tel: (905)413-2601
Email: [EMAIL PROTECTED]
[EMAIL PROTECTED]
-systems.com
To
01/16/2004 10:29 [EMAIL PROTECTED]
AM cc
Subject
Connection problems with xalan -
sql extension
Hello,
I want to use the sql extension from xalan to read some data from my mysql
database. I have some problems while creating the connection. I get this
message:
<message>No suitable driver</message>
The Driver is registered in my classpath. I am using:
mysql: 4.0.14
java: 1.4
xalan: xalan-j_2_5_2
jbbc-driver: mysql-connector-java-3.0.10-stable-bin.jar
Sheet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:sql="org.apache.xalan.lib.sql.XConnection"
extension-element-prefixes="sql"
>
<xsl:output method="html" indent="yes"/>
<!-- parameter setting to connect to MySQL -->
<xsl:param name="driver" select="'com.mysql.jdbc.Driver'"/>
<!--<xsl:param name="driver" select="'org.gjt.mm.mysql.Driver'"/>-->
<xsl:param name="datasource" select="'jdbc:mysql://localhost:3306/test'"/>
<xsl:param name="query" select="'SELECT * FROM testtabelle'"/>
<xsl:param name="username" select="'root'"/>
<xsl:param name="passwd" select="''"/>
<xsl:template match="/">
<xsl:variable name="db" select="sql:new($driver, $datasource)"/>
<xsl:if test="not(sql:connect($db, $driver, $datasource,
$username, $passwd))" >
<xsl:message>Error Connecting to the
Database</xsl:message>
<xsl:copy-of select="sql:getError($db)/ext-error" />
</xsl:if>
Has some an idea what I am doing wrong?
Thanks,
Juraj