sqlBatch
Perform SQL Batch operations on a RDBMS
Index > Books > Declarative Development Guide > Reference Library > Accessor Listing > sqlBatch

Rate this page:
Really useful
Satisfactory
Not helpful
Confusing
Incorrect
Unsure
Extra comments:


Module

urn:org:ten60:netkernel:mod:db

Definition

Active URI Base

active:sqlBatch

Format

<instr>
  <type>sqlBatch</type>
  <operand>
    <batch>
      <sql>SELECT id:=id FROM table WHERE name='Hetty';</sql>
      <sql>UPDATE table SET name='Ethan' WHERE id=@id;</sql>
    </batch>
  </operand>
  <configuration>/myconfiguration/configRDBMS.xml</configuration>
  <target>var:result</target>
</instr>

Syntax

ArgumentRulesDescription
typeMandatory sqlBatch
operandMandatory the <sql> query document
configurationOptional optional configuration document
targetMandatory Fragment OKa result document

The sqlBatch accessor performs batched SQL operations on an RDBMS using a JDBC connection. The operations are provided in the operand as a canonical <batch> document containing one ore more <sql> elements (see example above). The result is a document providing the operation index and number of rows updated by the update.

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:port/mydatabase?user=myusername&amp;password=mypassword </jdbcConnection>
  </rdbms>
</config>
© 2003-2005, 1060 Research Limited. 1060 registered trademark, NetKernel trademark of 1060 Research Limited.