Database services allow to create pvmanager services based on database queries.
Each service represents a database and each method represents a query. The query results are automatically mapped to VTable, based on the metadata coming from the database driver.
Here is an example of an XML file describing a jdbc service:
<?xml version="1.0" encoding="UTF-8"?>
<jdbcService ver="1" name="jdbcSample" description="A test service">
<method name="query" description="A test query">
<query>SELECT * FROM Data</query>
<result name="result" description="The query result"/>
<method name="insert" description="A test insert query">
<query>INSERT INTO `test`.`Data` (`Name`, `Index`, `Value`) VALUES (?, ?, ?)</query>
<argument name="name" description="The name" type="VString"/>
<argument name="index" description="The index" type="VNumber"/>
<argument name="value" description="The value" type="VNumber"/>
Each service method correspon to one command, with specific mappings. A service is a collection of different mehods.
||Version is required to be "1". Name and description of the
service are required
||Database url for the JDBC
driver. The correct driver must have been initialized. The syntax is
driver dependent. Consult JDBC documentation.
||List of methods must be provided
||Each method must have a name and a description
||The query passed to the database driver. It can contain parameters marked as '?'. Parameters are distinguished by position.
||Arguments are optional, but they must match the number of '?' specified in the query. Each argument must have a name, a description and a type. Supported type include: VString, VNumber.|
must include a name and a description. If the result is present, the
query is executed expecting a result, and the result is mapped to a