XSLT and mysql connection problem STILL

Posted on 2005-04-13
Last Modified: 2012-05-05
I have the following code

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl=""  xmlns:sql="org.apache.xalan.lib.sql.XConnection" extension-element-prefixes="sql">
      <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
      <xsl:output version="1.0"/>
      <xsl:output doctype-public="ISO//Web3D//DTD X3D 3.0//EN"/>
      <xsl:output doctype-system=""/>
      <!-- parameter setting to connect to MySQL -->
<xsl:param name="driver" select="'com.mysql.jdbc.Driver'"/>
<xsl:param name="datasource" select="'jdbc:mySQL://localhost/environment'"/>
<xsl:param name="query" select="'SELECT * FROM sample'"/>
<xsl:param name="username" select="'root'"/>
<xsl:param name="passwd" select="'*****'"/>

<xsl:template match="/">
    <xsl:variable name="db" select="sql:new()"/>
    <!-- Connect to the database with minimal error detection -->
     <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" />
      <!-- 3. Close the connection -->
      <xsl:value-of select="sql:close($db)"/>

I have made sure the password is correct and the database name.

I had this working only yesterday but running the script again it does not work.

Question by:adam391

    Author Comment

    the error message i get is No suitable driver
    LVL 10

    Accepted Solution

    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 ' "/ >

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
    The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API ( has made its way into the popular lexicon of the English language.  A few years ago, …
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now