KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > transactions > CustomerInfoService


1 package transactions;
2
3 import dinamica.*;
4
5 /**
6  * SOAP webservice that return customer record
7  * represented as a Dinamica disconnected recordset
8  * <br><br>
9  * Creation date: 13/05/2005
10  * (c) 2005 Martin Cordova<br>
11  * This code is released under the LGPL license<br>
12  * Dinamica Framework - http://www.martincordova.com<br>
13  * @author Martin Cordova (dinamica@martincordova.com)
14  */

15 public class CustomerInfoService extends GenericTransaction implements
16         ICustomerInfo
17 {
18
19     /* (non-Javadoc)
20      * @see transactions.ICustomerInfo#getCustomer(java.lang.String)
21      */

22     public Recordset getCustomer(String JavaDoc custID) throws Throwable JavaDoc
23     {
24         
25         //assemble SQL command
26
String JavaDoc sql = StringUtil.replace(getLocalResource("get-customer.sql"),"${custID}", custID);
27         
28         // connect and get recordset
29
Recordset rs = dbGet("jdbc/dinamica", sql);
30         
31         // test for error
32
if (rs.getRecordCount()<1)
33             throw new Throwable JavaDoc("Customer not found.");
34         
35         return rs;
36     }
37
38 }
39
Popular Tags