...
Code Block |
---|
<queryset name="BIRT" dateFormat="yyyy-MM-dd" xmlDateFormat="yyyy-MM-dd" xmlTimeStampFormat="MM/dd/yyyy"> <resource-def> <url>jdbc:mysql://localhost/ClassicModels</url> <driver>com.mysql.jdbc.Driver</driver> <user>root</user> <password/> </resource-def> <query name="allCustomers"> <retrieve> <!-- maps to HTTP GET --> <statement> SELECT customerNumber,customerName from Customers order by customerName </statement> </retrieve> </query> <query name="customerByNumber" autocreate="true"> <retrieve> <!-- maps to HTTP GET --> <statement> SELECT * from Customers where customerNumber={cnum} </statement> </retrieve> </query> </queryset> |
Code Block |
---|
<queryset name="BIRT" dateFormat="yyyy-MM-dd" xmlDateFormat="yyyy-MM-dd" xmlTimeStampFormat="MM/dd/yyyy"> <resource-def> <url>jdbc:odbc:ClassicModels</url> <driver>sun.jdbc.odbc.JdbcOdbcDriver</driver> <user/> <password/> </resource-def> ... </queryset> |
...
When the form is submitted, will issue an HTTP PUT request to the above URL sending the customerCreditLimit XML document in the payload. The database connector will map this to the <update> operation of the customerCreditLimit query that we defined above, will use the data in the XML document to resolve the query (replace {creditLimit} and {cnum} in the query with the actual values from the XML document) and perform the UPDATE.
<query name="customerByNumber“>
<retrieve>
<!-- maps to HTTP GET -->
<statement>
SELECT * from Customers where customerNumber={cnum}
</statement>
</retrieve>
</query>