sqlQuery
Make SQL Query on RDBMS and return XMLized result set.
Release Notes
attachGoldenThread
cast
copy
cutGoldenThread
cwu
delete
dpml
dump
entrypoint
exists
expire
fls
guid
hotRestart
HTTPCookie
HTTPRedirect
isUnix
locationToXPath
lock/unlock
log
loglevel
luceneIndex
luceneSearch
mapper
mapper-export
md5
mls
netkernel:*
new
Orchextra
org.ten60.util.aspell
org.ten60.util.image.SVG2PNG
org.ten60.util.image.Text2PNG
org.ten60.util.image.xchart
plainTextToXHTML
regex
relativizeURI
requestWithArgs
resolveURI
serialize
sleep
sqlBatch
sqlBooleanQuery
SQLEncodeElement
SQLEscapeXML
sqlQuery
sqlUpdate
stm
stopWatch
StringToCanonicalString
throw
toRelaxNG
trace
validateDTD
validateRNG
validateSchematron
validateXSD
xacml
xform
XHREFlinker
XHTMLredirect
XHTMLTidy
xinclude
xmltidy
xpatheval
xpur
xquery
xrl
xsign
xslfo-fop
xslfo-fop
xslt
xverify
License
Change History
NetKernel History
Acknowledgements

sqlQuery

Accessor to perform SQL query on RDBMS

Module

urn:org:ten60:netkernel:mod:db

Definition

Format

<instr>
  <type>sqlQuery</type>
  <operand>
    <sql>SELECT * FROM table;</sql>
  </operand>
  <configuration>/myconfiguration/configRDBMS.xml</configuration>
  <target>var:resultsetDocument</target>
</instr>

Syntax

ElementRulesDescription
typeMandatory sqlQuery
operandMandatory the <sql> query document
configurationOptional optional configuration document
targetMandatory Fragment OKan XMLized results set document

The sqlQuery accessor performs an SQL query on an RDBMS using a JDBC connection. The query is provided in the operand as a canonical <sql> document (see example above). The result set is automatically converted into an XML document with root node <results>. Each row of the result set is a first child element <row>. Each column value will be returned as an element with a text value of the result. It is important that the column names returned in the result set are valid XML element names.

If there are no results a canonical null document is returned.

Like the underlying JDBC interface, sqlQuery cannot be used to update a document, use sqlUpdate or sqlBatch.

Configuration

By default the configuration will be read from ffpcl:/etc/ConfigRDBMS.xml. The document provides a driver and connection URI (see example below). Alternatively,the configuration can be provided in an optional <configuration> argument - this may be either a URI to a config document or a literal configuration document.

<config>
  <rdbms>
    <jdbcDriver>com.mysql.jdbc.Driver</jdbcDriver>
    <jdbcConnection> jdbc:mysql://localhost/mydatabase?user=myusername&amp;password=mypassword </jdbcConnection>
  </rdbms>
</config>

1060® NetKernelTM Documentation
(C) 2003-2004 1060 Research Limited

Send Feedback

© 2003,2004, 1060® Research Limited
1060 registered trademark, NetKernel trademark of 1060 Research Limited