Link to home
Start Free TrialLog in
Avatar of adam391
adam391

asked on

XSLT and mysql connection problem STILL

I have the following code


<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  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="http://www.web3d.org/specifications/x3d-3.0.dtd"/>
      
      <!-- 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" />
     </xsl:if>
      
      
      <!-- 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.

Avatar of adam391
adam391

ASKER

the error message i get is No suitable driver
ASKER CERTIFIED SOLUTION
Avatar of BobSiemens
BobSiemens

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial