This message usually means that the JDBC driver class cannot be found.
Please check whether the class "oracle.jdbc.driver.OracleDriver" is
actually on your classpath.

Morris Kwan
XSLT Development
IBM Toronto Lab
Tel: (905)413-3729
Email: [EMAIL PROTECTED]



                                                                                
                                                   
                      Jinhua Fan                                                
                                                   
                      <[EMAIL PROTECTED]>          To:       "'[EMAIL 
PROTECTED]'" <[EMAIL PROTECTED]>           
                                               cc:                              
                                                   
                      01/27/2003 03:16         Subject:  Xalan SQL Extension DB 
Connection Question                                
                      PM                                                        
                                                   
                                                                                
                                                   
                                                                                
                                                   



I am new to XALAN SQL Extension.  I read about the SQL extension and want
to
try it is a style sheet.

I got "Invalid Driver Name Specified!" error message when try to query the
db.  Could any one help me to identify where the problem is. The DbUser and
password are both fine.

Thank you.

****************************************************************************

********

The following is the snippet of the style sheet that I used.

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                         xmlns:java="http://xml.apache.org/xslt/java";
                         version="1.0"
                         xmlns:sql="org.apache.xalan.lib.sql.XConnection"
                         extension-element-prefixes="sql">

    <xsl:output method="xml" indent="yes"/>

    <xsl:param name="driver" select="'oracle.jdbc.driver.OracleDriver'"/>
    <xsl:param name="dbUrl"
select="'jdbc:oracle:thin:@servername:####:instanceName'"/>


    <!-- define a query -->
    <xsl:param name="pquery" select="'SELECT * FROM mytable '"/>



    <xsl:template match="/">
        <!-- connect to db -->
        <xsl:variable name = "dbobj" select = "sql:new($driver, $dbUrl,
'userName', 'password')" />

        <xsl:element name="ROWSET">
                ... ...

            <xsl:for-each select="/DataSet/DataRow" >

                         ... ...

                <!-- query the data -->
                <xsl:variable name="resultSet" select='sql:query($dbobj,
$pquery )'/>

                <!-- Error Checking, it is stored in the connection since
$resultSet will be either data or null -->
                <xsl:if test="not($resultSet)" >
                       <xsl:message >Error in query</xsl:message>
                    <xsl:copy-of select="sql:getError($dbobj)/ext-error" />
                </xsl:if>

            </xsl:for-each>
        </xsl:element>

        <!-- Close the connection -->
        <xsl:value-of select="sql:close($dbobj)"/>
    </xsl:template>
</xsl:stylesheet>



Reply via email to