BizTalk Utilities CV ,   Jobs ,   Code library  
 
Home Page
XALAN
javax.xml.transform.sax.TemplatesHandler Class
XALAN Getting Started with XSLTC
The Usage of XALAN
Overview of XALAN - Java
<< WCF, WS, SOAP
XHTML >>

By :Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :03/24/2008
Times viewed :770

 

Xalan: The org.apache.xalan.lib.sql.XConnection Class

Extends: java.lang.Object

Members

Signature

Public methods

void

addParameter(java.lang.String value)

void

addParameterFromElement(Element e)

void

addParameterFromElement(NodeList nl)

void

addParameterWithType(java.lang.String value, java.lang.String Type)

void

clearParameters()

void

close()

void

close(SQLDocument sqldoc)

XBooleanStatic

connect(ExpressionContext exprContext, Element protocolElem)

XBooleanStatic

connect(ExpressionContext exprContext, NodeList list)

XBooleanStatic

connect(ExpressionContext exprContext, java.lang.String ConnPoolName)

XBooleanStatic

connect(ExpressionContext exprContext, java.lang.String driver, java.lang.String dbURL)

XBooleanStatic

connect(ExpressionContext exprContext, java.lang.String driver, java.lang.String dbURL, Element protocolElem)

XBooleanStatic

connect(ExpressionContext exprContext, java.lang.String driver, java.lang.String dbURL, java.lang.String user, java.lang.String password)

void

disableDefaultConnectionPool()

void

disableStreamingMode()

void

enableDefaultConnectionPool()

void

enableStreamingMode()

ConnectionPool

getConnectionPool()

DTM

getError()

java.lang.String

getFeature(java.lang.String feature)

DTM

pquery(ExpressionContext exprContext, java.lang.String queryString)

DTM

pquery(ExpressionContext exprContext, java.lang.String queryString, java.lang.String typeInfo)

DTM

query(ExpressionContext exprContext, java.lang.String queryString)

void

setError(java.lang.Exception excp, ExpressionContext expr)

void

setError(java.lang.Exception excp, SQLDocument doc, java.sql.SQLWarning warn)

void

setFeature(java.lang.String feature, java.lang.String setting)

Overview

This class acts as a extension function to the stylesheet. It helps to retrieve data from database through JDBC. It is accessed by specifying a namespace URI as follows:

    xmlns:sql="http://xml.apache.org/xalan/sql"

 In my examples, I have used Sun’s JDBC-ODBC driver to connect to the database. To connect MySQL, please refer the attached source code. This class is used when for reporting purpose. Sometimes it is required to generate list of employees list from a database table. In such cases, by using a stylesheet you can directly generate reports. But trick is that you need to write your sql queries in your stylesheet. If your database located in remote place then processing time would definitely increase.

Method Overviews

From the stylesheet perspective, XConnection provides 3 extension functions: new(), query(), and close(). Use new() to call one of XConnection constructors, which establishes a JDBC driver connection to a data source and returns an XConnection object. Then use the XConnection object query() method to return a result set in the form of a row-set element. When you have finished working with the row-set, call the XConnection object close() method to terminate the connection.

Example of new()

qew() is used to call one of XConnection constructors, which establishes a JDBC driver connection to a data source and returns an XConnection object.

<xsl:variable name="db" select="sql:new()"/>

Example of query()

query() is used to execute the sql statement and returns the resultset in the form of row-set.

<xsl:variable name="table" select="sql:query($db, $query)"/>

Example of close()

close() is used to close the database connection. While using XConnection, please ensure that you have closed the database connection using the close() method.

<xsl:value-of select="sql:close($db)"/>


Rate this article on a scale of 1 to 10

Your vote :  


 

Recent Jobs

Integration Specialist Needed - Wor
Virtualization Server Infrastructur
A great opportunity to Digital Vide
here is a greate opportunity as a S
A great opportunity as a Network En

View all Jobs (Add yours)
View all CV (Add yours)



Information Online

swimming pool contractor
chicago web site design
reservationless conference calls
Web Hosting
efax
D&g sunglasses
answering service


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP