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
returned as an IAspectResultSet. This can
be automatically converted into an XML document with the
ResultSetToXML Transreptor.
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 ffcpl:/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&password=mypassword
</jdbcConnection>
</rdbms>
</config>
For more details on the configuration see the
Mod DB Guide
.