You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ri...@apache.org on 2006/04/29 21:37:25 UTC

svn commit: r398228 [1/2] - in /incubator/tuscany/java/samples/bigbank: ./ account/ account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/account/ account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata...

Author: rineholt
Date: Sat Apr 29 12:37:22 2006
New Revision: 398228

URL: http://svn.apache.org/viewcvs?rev=398228&view=rev
Log:
Bigbank integrated with real stock quote service.
Data is persisted with DAS in DERBY.
More work todo ... things were running until this morning update and now receive on the server wrong number of arguments
 looking at the wsdl looks fine.... still investigating
In the process of allow user to do withdrawls/deposits and eventually sell/buy stock 

Added:
    incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataServiceDASImpl.java
    incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdb/
    incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdb/AccountDBInit.java
    incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuote.java
    incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteWebservicexServiceImpl.java
    incubator/tuscany/java/samples/bigbank/account/src/main/resources/DasAccountConfiguration.xml
    incubator/tuscany/java/samples/bigbank/account/src/main/resources/wsdl/AccountService.wsdl
    incubator/tuscany/java/samples/bigbank/account/src/main/resources/wsdl/stockquotes.webservicex.wsdl
    incubator/tuscany/java/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/AccountLoginServiceImpl.java
    incubator/tuscany/java/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/account/StockStatusTag.java
    incubator/tuscany/java/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/ui/FormServlet.java
    incubator/tuscany/java/samples/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl
    incubator/tuscany/java/samples/bigbank/webclient/src/main/webapp/CustomerProfile.jsp
Removed:
    incubator/tuscany/java/samples/bigbank/account/src/main/resources/wsdl/StockQuoteWebService.wsdl
    incubator/tuscany/java/samples/bigbank/customers/
Modified:
    incubator/tuscany/java/samples/bigbank/account/pom.xml
    incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/account/AccountServiceImpl.java
    incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataService.java
    incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataServiceImpl.java
    incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteService.java
    incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteServiceImpl.java
    incubator/tuscany/java/samples/bigbank/account/src/main/resources/sca.module
    incubator/tuscany/java/samples/bigbank/account/src/main/webapp/WEB-INF/web.xml
    incubator/tuscany/java/samples/bigbank/account/src/test/java/org/apache/tuscany/samples/bigbank/account/client/AccountClient.java
    incubator/tuscany/java/samples/bigbank/pom.xml
    incubator/tuscany/java/samples/bigbank/webclient/pom.xml
    incubator/tuscany/java/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/account/AccountServiceComponentImpl.java
    incubator/tuscany/java/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/LoginService.java
    incubator/tuscany/java/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/ProfileService.java
    incubator/tuscany/java/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/ProfileServiceImpl.java
    incubator/tuscany/java/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/SimpleLoginServiceImpl.java
    incubator/tuscany/java/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/account/AccountStatusTag.java
    incubator/tuscany/java/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/ui/LoginServlet.java
    incubator/tuscany/java/samples/bigbank/webclient/src/main/resources/sca.module
    incubator/tuscany/java/samples/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld
    incubator/tuscany/java/samples/bigbank/webclient/src/main/webapp/WEB-INF/web.xml
    incubator/tuscany/java/samples/bigbank/webclient/src/main/webapp/login.html
    incubator/tuscany/java/samples/bigbank/webclient/src/main/webapp/summary.jsp
    incubator/tuscany/java/samples/bigbank/webclient/src/test/java/org/apache/tuscany/samples/bigbank/webclient/client/TestAccountService.java

Modified: incubator/tuscany/java/samples/bigbank/account/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/bigbank/account/pom.xml?rev=398228&r1=398227&r2=398228&view=diff
==============================================================================
--- incubator/tuscany/java/samples/bigbank/account/pom.xml (original)
+++ incubator/tuscany/java/samples/bigbank/account/pom.xml Sat Apr 29 12:37:22 2006
@@ -34,6 +34,45 @@
             <version>${pom.version}</version>
             <scope>provided</scope> <!-- use provided so tuscany infrastructue is not inc. in the war-->
         </dependency>
+        <dependency>
+            <groupId>org.apache.tuscany.das</groupId>
+            <artifactId>tuscany-das-rdb</artifactId>
+            <version>${pom.version}</version>
+            <scope>provided</scope> <!-- use provided so tuscany infrastructue is not inc. in the war-->
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>2.4</version>
+            <scope>provided</scope> <!-- use provided so tuscany infrastructue is not inc. in the war-->
+        </dependency>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derby</artifactId>
+            <version>10.1.2.1</version>
+            <scope>provided</scope> <!-- use provided so tuscany infrastructue is not inc. in the war-->
+        </dependency>
+
+        <dependency>
+          <groupId>stax</groupId>
+          <artifactId>stax-api</artifactId>
+          <version>1.0</version>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>woodstox</groupId>
+            <artifactId>wstx-asl</artifactId>
+            <version>2.8.2</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>ws-commons</groupId>
+            <artifactId>axiom-api</artifactId>
+            <version>0.95</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 
     <build>
@@ -44,7 +83,8 @@
                 <executions>
                     <execution>
                         <configuration>
-                            <schemaFile>${basedir}/src/main/resources/wsdl/AccountService.wsdl</schemaFile>
+                            <!-- schemaFile>${basedir}/src/main/resources/wsdl/AccountService.wsdl</schemaFile -->
+                            <schemaDir>${basedir}/src/main/resources/wsdl</schemaDir>
                             <noNotification>true</noNotification>
                             <noContainer>true</noContainer>
                             <noInterfaces>true</noInterfaces>
@@ -62,8 +102,9 @@
                 <executions>
                     <execution>
                         <configuration>
-                            <wsdlFile>${basedir}/src/main/resources/wsdl/AccountService.wsdl</wsdlFile>
-                            <javaPackage>org.apache.tuscany.samples.bigbank.account.services.account</javaPackage>
+                            <wsdlDir>${basedir}/src/main/resources/wsdl</wsdlDir>
+                            <!-- wsdlFile>${basedir}/src/main/resources/wsdl/AccountService.wsdl</wsdlFile -->
+                            <!-- javaPackage>org.apache.tuscany.samples.bigbank.account.services.account</javaPackage -->
                         </configuration>
                         <goals>
                             <goal>generate</goal>

Modified: incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/account/AccountServiceImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/account/AccountServiceImpl.java?rev=398228&r1=398227&r2=398228&view=diff
==============================================================================
--- incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/account/AccountServiceImpl.java (original)
+++ incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/account/AccountServiceImpl.java Sat Apr 29 12:37:22 2006
@@ -16,22 +16,37 @@
  */
 package org.apache.tuscany.samples.bigbank.account.services.account;
 
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 
-import org.apache.tuscany.samples.bigbank.account.AccountFactory;
-import org.apache.tuscany.samples.bigbank.account.AccountReport;
-import org.apache.tuscany.samples.bigbank.account.AccountSummary;
 import org.apache.tuscany.samples.bigbank.account.services.accountdata.AccountDataService;
-import org.apache.tuscany.samples.bigbank.account.services.accountdata.CheckingAccount;
-import org.apache.tuscany.samples.bigbank.account.services.accountdata.SavingsAccount;
-import org.apache.tuscany.samples.bigbank.account.services.accountdata.StockAccount;
+import org.apache.tuscany.samples.bigbank.account.services.stockquote.StockQuote;
 import org.apache.tuscany.samples.bigbank.account.services.stockquote.StockQuoteService;
+import org.apache.tuscany.sdo.util.SDOUtil;
 import org.osoa.sca.annotations.Property;
 import org.osoa.sca.annotations.Reference;
 import org.osoa.sca.annotations.Service;
 
+import com.bigbank.account.AccountFactory;
+import com.bigbank.account.AccountReport;
+import com.bigbank.account.AccountService;
+import com.bigbank.account.CustomerProfileData;
+import com.bigbank.account.StockSummary;
+
 @Service(interfaces=AccountService.class)
 public class AccountServiceImpl implements AccountService {
+    
+    public static final String CHECKING_ACCOUNT_PREFIX= "134-43-394";
+    public static final String SAVINGS_ACCOUNT_PREFIX= "134-42-623";
+    public static final String ACCOUNT_TYPE_SAVINGS = "savings";
+    public static final String ACCOUNT_TYPE_CHECKINGS = "checkings";
+
+    static {
+        SDOUtil.registerStaticTypes(AccountFactory.class);
+    }
 
     private String currency = "USD";
 
@@ -40,55 +55,116 @@
         this.currency = currency;
     }
 
-    private AccountDataService accountDataService;
 
+    
+    private AccountDataService accountDataService;
     @Reference
     public void setAccountDataService(AccountDataService accountDataService) {
         this.accountDataService = accountDataService;
     }
 
     private StockQuoteService stockQuoteService;
-
     @Reference
     public void setStockQuoteService(StockQuoteService stockQuoteService) {
         this.stockQuoteService = stockQuoteService;
     }
 
+
     public AccountServiceImpl() {
     }
 
+//    public AccountReport getAccountReport2(int customerID) {
+//        
+//        AccountFactory accountFactory=new AccountFactory();
+//
+//        AccountReport accountReport = accountFactory.createAccountReport();
+//        List accountSummaries = accountReport.getAccountSummaries();
+//
+//        CheckingAccount checkingAccount = accountDataService.getCheckingAccount(customerID);
+//        AccountSummary checkingAccountSummary = accountFactory.createAccountSummary();
+//        checkingAccountSummary.setAccountNumber(checkingAccount.getAccountNumber());
+//        checkingAccountSummary.setAccountType("checking");
+//        checkingAccountSummary.setBalance(fromUSDollarToCurrency(checkingAccount.getBalance()));
+//        accountSummaries.add(checkingAccountSummary);
+//
+//        SavingsAccount savingsAccount = accountDataService.getSavingsAccount(customerID);
+//        AccountSummary savingsAccountSummary = accountFactory.createAccountSummary();
+//        savingsAccountSummary.setAccountNumber(savingsAccount.getAccountNumber());
+//        savingsAccountSummary.setAccountType("savings");
+//        savingsAccountSummary.setBalance(fromUSDollarToCurrency(savingsAccount.getBalance()));
+//        accountSummaries.add(savingsAccountSummary);
+//
+//        StockAccount stockAccount = accountDataService.getStockAccount(customerID);
+//        AccountSummary stockAccountSummary = accountFactory.createAccountSummary();
+//        stockAccountSummary.setAccountNumber(stockAccount.getAccountNumber());
+//        stockAccountSummary.setAccountType("stock");
+//        float balance = (stockQuoteService.getQuote(stockAccount.getSymbol())) * stockAccount.getQuantity();
+//        stockAccountSummary.setBalance(fromUSDollarToCurrency(balance));
+//        accountSummaries.add(stockAccountSummary);
+//
+//        return accountReport;
+//    }
+
     @SuppressWarnings("unchecked")
-    public AccountReport getAccountReport(String customerID) {
+    public AccountReport getAccountReport(int customerID) throws RemoteException{
+        
+        try {
+            AccountReport accountReport = accountDataService.getAccountReport(customerID);
+            return updateStockInformation(accountReport);
+        } catch (Exception e) {
+            e.printStackTrace();
+            if (e instanceof RemoteException) throw (RemoteException)e;
+            else throw new RemoteException(e.getClass() + " " +e.getMessage(),e); 
+        }        
+    }
+    
+    private AccountReport updateStockInformation(AccountReport accountReport) throws RemoteException {
+        List<StockSummary> stocks = accountReport.getStockSummaries();
+        if(stocks.size() <1) return accountReport; //nothing todo
+        HashSet<String> owned = new HashSet<String>(stocks.size());
+        for(StockSummary stock : stocks){
+            owned.add(stock.getSymbol());
+        }
+        ArrayList<String> ownedStr= new ArrayList<String>(owned.size()*5);
+        for(String s : owned){
+            
+            ownedStr.add(s);
+        }
+        
+         Map<String, StockQuote> stockInfo = stockQuoteService.getQuotes((String[])ownedStr.toArray(new String[owned.size()]));
+         
+         for(StockSummary stock : stocks){
+            String symbol = stock.getSymbol();
+            StockQuote stockquote= stockInfo.get(symbol);
+            if(stockquote == null){
+                stock.setCurrentPrice(Float.NaN);
+                stock.setCompany("*not found*");
+                stock.setHighPrice(Float.NaN);
+                stock.setLowPrice(Float.NaN);
+                
+            }else{
+            stock.setCurrentPrice(convertToFloat(stockquote.getStockQuote()));
+            stock.setCompany(stockquote.getCompanyName());
+            stock.setHighPrice(convertToFloat(stockquote.getDayHighPrice()));
+            stock.setLowPrice(convertToFloat(stockquote.getDayLowPrice()));
+            }
+         }
         
-        AccountFactory accountFactory=new AccountFactory();
-
-        AccountReport accountReport = accountFactory.createAccountReport();
-        List accountSummaries = accountReport.getAccountSummaries();
-
-        CheckingAccount checkingAccount = accountDataService.getCheckingAccount(customerID);
-        AccountSummary checkingAccountSummary = accountFactory.createAccountSummary();
-        checkingAccountSummary.setAccountNumber(checkingAccount.getAccountNumber());
-        checkingAccountSummary.setAccountType("checking");
-        checkingAccountSummary.setBalance(fromUSDollarToCurrency(checkingAccount.getBalance()));
-        accountSummaries.add(checkingAccountSummary);
-
-        SavingsAccount savingsAccount = accountDataService.getSavingsAccount(customerID);
-        AccountSummary savingsAccountSummary = accountFactory.createAccountSummary();
-        savingsAccountSummary.setAccountNumber(savingsAccount.getAccountNumber());
-        savingsAccountSummary.setAccountType("savings");
-        savingsAccountSummary.setBalance(fromUSDollarToCurrency(savingsAccount.getBalance()));
-        accountSummaries.add(savingsAccountSummary);
-
-        StockAccount stockAccount = accountDataService.getStockAccount(customerID);
-        AccountSummary stockAccountSummary = accountFactory.createAccountSummary();
-        stockAccountSummary.setAccountNumber(stockAccount.getAccountNumber());
-        stockAccountSummary.setAccountType("stock");
-        float balance = (stockQuoteService.getQuote(stockAccount.getSymbol())) * stockAccount.getQuantity();
-        stockAccountSummary.setBalance(fromUSDollarToCurrency(balance));
-        accountSummaries.add(stockAccountSummary);
-
         return accountReport;
     }
+    
+    float convertToFloat( final String s){
+        
+        
+    try {
+        return Float.parseFloat(s);
+    } catch (Exception e) {
+        return Float.NaN;
+    }      
+       
+    }
+
+
 
     private float fromUSDollarToCurrency(float value) {
 
@@ -96,5 +172,70 @@
         else if (currency.equals("EURO")) return value * 0.8f;
         else
             return 0.0f;
+    }
+
+    public StockSummary purchaseStock(int param0) throws RemoteException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public CustomerProfileData getCustomerProfile(String logonID) throws RemoteException { 
+        
+    try{
+        return accountDataService.getCustomerProfile(logonID);
+    } catch (Exception e) {
+        e.printStackTrace();
+        if (e instanceof RemoteException) throw (RemoteException)e;
+        else throw new RemoteException(e.getClass() + " " +e.getMessage(),e); 
+    }        
+    
+    }
+
+    public float deposit(String param4) throws RemoteException {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public StockSummary sellStock(int param6) throws RemoteException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public float withdraw(String param8) throws RemoteException {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public float deposit(String param6, float param7) throws RemoteException {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public StockSummary purchaseStock(int param0, String param1, int param2) throws RemoteException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public StockSummary sellStock(int param9, int param10) throws RemoteException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public float withdraw(String param12, float param13) throws RemoteException {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    public CustomerProfileData createAccount(CustomerProfileData customerProfile, boolean createSavings, boolean createCheckings) throws RemoteException {
+        try{
+            return accountDataService.createAccount(customerProfile, createSavings, createCheckings);
+        } catch (Exception e) {
+            e.printStackTrace();
+            if (e instanceof RemoteException) throw (RemoteException)e;
+            else throw new RemoteException(e.getClass() + " " +e.getMessage(),e); 
+        }        
+        
+        
+      
     }
 }

Modified: incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataService.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataService.java?rev=398228&r1=398227&r2=398228&view=diff
==============================================================================
--- incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataService.java (original)
+++ incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataService.java Sat Apr 29 12:37:22 2006
@@ -16,11 +16,23 @@
  */
 package org.apache.tuscany.samples.bigbank.account.services.accountdata;
 
-public interface AccountDataService {
+import java.rmi.RemoteException;
+
+import com.bigbank.account.AccountReport;
+import com.bigbank.account.CustomerProfileData;
 
-    CheckingAccount getCheckingAccount(String customerID);
+public interface AccountDataService {
+    public CustomerProfileData getCustomerProfile(String logonID) throws RemoteException ;
 
-    SavingsAccount getSavingsAccount(String customerID);
+//    public CheckingAccount getCheckingAccount(int customerID);
 
-    StockAccount getStockAccount(String customerID);
+//    public SavingsAccount getSavingsAccount(int  customerID);
+//
+//    public StockAccount getStockAccount(int  customerID);
+    
+    
+    
+    public AccountReport getAccountReport(int customerID ) throws RemoteException;
+    public CustomerProfileData createAccount(CustomerProfileData customerProfile, boolean createSavings, boolean createCheckings) throws RemoteException ;
+    
 }

Added: incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataServiceDASImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataServiceDASImpl.java?rev=398228&view=auto
==============================================================================
--- incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataServiceDASImpl.java (added)
+++ incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataServiceDASImpl.java Sat Apr 29 12:37:22 2006
@@ -0,0 +1,275 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.tuscany.samples.bigbank.account.services.accountdata;
+
+import java.io.InputStream;
+import java.rmi.RemoteException;
+import java.sql.Connection;
+import java.sql.Date;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Collection;
+import java.util.Properties;
+import java.util.TimeZone;
+
+import org.apache.tuscany.das.rdb.ApplyChangesCommand;
+import org.apache.tuscany.das.rdb.Command;
+import org.apache.tuscany.das.rdb.CommandGroup;
+import org.apache.tuscany.das.rdb.Converter;
+import org.apache.tuscany.samples.bigbank.account.services.account.AccountServiceImpl;
+import org.apache.tuscany.sdo.util.SDOUtil;
+import org.osoa.sca.annotations.Service;
+
+import com.bigbank.account.AccountFactory;
+import com.bigbank.account.AccountReport;
+import com.bigbank.account.CustomerProfileData;
+import com.bigbank.account.DataGraphRoot;
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.TypeHelper;
+
+@Service(AccountDataService.class)
+public class AccountDataServiceDASImpl implements AccountDataService {
+    // TODO get rid of this!!
+    static public String dbDirectory = null;
+    static {
+        SDOUtil.registerStaticTypes(AccountFactory.class);
+    }
+
+    public CustomerProfileData getCustomerProfile(String logonID) throws RemoteException {
+
+        try {
+            InputStream mapping = createConfigStream();
+            Command select = Command.FACTORY.createCommand(
+                    "SELECT firstName, lastName, loginID, password, id FROM customers where loginID = :loginID", mapping);
+            Connection conn = getConnection();
+            select.setConnection(conn);
+            select.setParameterValue("loginID", logonID);
+            TypeHelper helper = TypeHelper.INSTANCE;
+
+            select.setDataObjectModel(helper.getType(DataGraphRoot.class));
+
+            DataGraphRoot root = (DataGraphRoot) select.executeQuery();
+            conn.close();
+
+            Collection customers = root.getCustomerProfileData();
+            CustomerProfileData customerProfileData = (CustomerProfileData) customers.iterator().next();
+            System.out.println(customerProfileData);
+            System.out.flush();
+            return customerProfileData;
+        } catch (Exception e) {
+
+            e.printStackTrace();
+            RemoteException re = new RemoteException("Failed to get customer profile'" + logonID + "' ", e);
+            re.printStackTrace();
+            throw re;
+        }
+    }
+
+    protected static final String driver = "org.apache.derby.jdbc.EmbeddedDriver";
+
+    protected static final String protocol = "jdbc:derby:";
+
+    protected InputStream createConfigStream() {
+        InputStream mapping = getClass().getClassLoader().getResourceAsStream("DasAccountConfiguration.xml");
+        return mapping;
+    }
+
+    protected Connection getConnection() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException {
+        Connection conn;
+        Class.forName(driver).newInstance();
+        Properties props = new Properties();
+        // props.put("user", "tuscany");
+        // props.put("password", "tuscany");
+        conn = DriverManager.getConnection(protocol + dbDirectory + ";create=true", props);
+
+        conn.setAutoCommit(false);
+        return conn;
+    }
+
+    public CustomerProfileData testgetCustomerByLoginIDThroughDASRead(final String logonID) throws Exception {
+
+        InputStream mapping = createConfigStream();
+
+        Command select = Command.FACTORY.createCommand("SELECT firstName, lastName, loginID, password, id FROM customers where loginID = :loginID",
+                mapping);
+        Connection conn = getConnection();
+        select.setConnection(conn);
+        select.setParameterValue("loginID", logonID);
+        TypeHelper helper = TypeHelper.INSTANCE;
+
+        select.setDataObjectModel(helper.getType(DataGraphRoot.class));
+
+        DataGraphRoot root = (DataGraphRoot) select.executeQuery();
+        conn.close();
+
+        Collection customers = root.getCustomerProfileData();
+        CustomerProfileData customerProfileData = (CustomerProfileData) customers.iterator().next();
+        System.out.println(customerProfileData);
+        System.out.flush();
+        return customerProfileData;
+
+    }
+
+    public static class DateConverter implements Converter {
+        public DateConverter() {
+        }
+
+        private static final DateFormat tsformat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+
+        private static final DateFormat tsformatXSDDate = new SimpleDateFormat("yyyy-MM-dd");
+
+        private static final DateFormat tsformatXSDDateTime = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSz");
+
+        public Object getPropertyValue(Object columnData) {
+
+            try {
+
+                tsformatXSDDateTime.setTimeZone(TimeZone.getTimeZone("UTC"));
+                String ret = tsformatXSDDateTime.format(columnData);
+                if (ret.endsWith("UTC"))
+                    ret = ret.substring(0, ret.length() - 3) + "Z";
+                return ret;
+
+            } catch (Exception e) {
+
+                e.printStackTrace();
+                throw new IllegalArgumentException(e);
+            }
+
+        }
+
+        public Object getColumnValue(Object propertyData) {
+
+            if (propertyData instanceof Date) {
+                return tsformat.format(propertyData);
+            } else
+                throw new IllegalArgumentException();
+
+        }
+
+    }
+
+    public CustomerProfileData createAccount(CustomerProfileData customerProfile, boolean createSavings, boolean createCheckings)
+            throws RemoteException {
+
+        try {
+            Command insert = Command.FACTORY.createCommand("insert into customers (firstName,lastName,address,email, loginID, password  ) values ('"
+                    + customerProfile.getFirstName() + "', '" + customerProfile.getLastName() + "', '" + customerProfile.getAddress() + "', '"
+                    + customerProfile.getEmail() + "', '" + customerProfile.getLoginID() + "', '" + customerProfile.getPassword() + "')");
+            insert.setConnection(getConnection());
+            insert.execute();
+            CustomerProfileData ret = getCustomerProfile(customerProfile.getLoginID());
+            String cid = ret.getId() + "";
+            if (createSavings) {
+                insert = Command.FACTORY.createCommand("insert into accounts (id,accountNumber, accountType, balance  ) values (" + cid + ", '"
+                        + AccountServiceImpl.SAVINGS_ACCOUNT_PREFIX + cid + "', '" + AccountServiceImpl.ACCOUNT_TYPE_SAVINGS + "', " + 1.0F + ")");
+                insert.setConnection(getConnection());
+                insert.execute();
+
+            }
+            if (createCheckings) {
+                insert = Command.FACTORY.createCommand("insert into accounts (id,accountNumber, accountType, balance  ) values (" + cid + ", '"
+                        + AccountServiceImpl.CHECKING_ACCOUNT_PREFIX + cid + "', '" + AccountServiceImpl.ACCOUNT_TYPE_CHECKINGS + "', " + 1.0F + ")");
+                insert.setConnection(getConnection());
+                insert.execute();
+
+            }
+
+            return ret;
+        } catch (Exception e) {
+            if (e instanceof RemoteException)
+                throw (RemoteException) e;
+            throw new RemoteException("createAccount " + e.getClass().getName() + "'. " + e.getMessage(), e);
+        }
+    }
+
+    public CustomerProfileData createAccountNOTWORKING(CustomerProfileData customerProfile, boolean createSavings, boolean createCheckings)
+            throws RemoteException {
+        try {
+            CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(createConfigStream());
+            commandGroup.setConnection(getConnection());
+            Command read = commandGroup.getCommand("all customers");
+
+            // select.setDataObjectModel();
+            TypeHelper helper = TypeHelper.INSTANCE;
+            read.setDataObjectModel(helper.getType(DataGraphRoot.class));
+            DataObject root = read.executeQuery();
+
+            // Create a new stockPurchase
+            DataObject customer = root.createDataObject("customerProfileData");
+
+            // THIS SEEMS TO BE THE ONLY WAY TO DO THIS .. NO WAY TO JUST ADD AN EXISTING CUSTOMER.
+            customer.set("firstName", customerProfile.getFirstName());
+            customer.set("lastName", customerProfile.getLastName());
+            customer.set("address", customerProfile.getAddress());
+            customer.set("email", customerProfile.getEmail());
+            customer.set("loginID", customerProfile.getLoginID());
+            customer.set("password", customerProfile.getPassword());
+
+            ApplyChangesCommand apply = commandGroup.getApplyChangesCommand();
+            apply.execute(root);
+            return getCustomerProfile(customerProfile.getLoginID());
+
+        } catch (Exception e) {
+            if (e instanceof RemoteException)
+                throw (RemoteException) e;
+            throw new RemoteException("createAccount " + e.getClass().getName() + "'. " + e.getMessage(), e);
+        }
+
+    }
+
+    public AccountReport getAccountReport(final int customerID) throws RemoteException {
+        try {
+            final AccountFactory accountFactory = AccountFactory.eINSTANCE;
+            final AccountReport accountReport = accountFactory.createAccountReport();
+            InputStream mapping = createConfigStream();
+
+            Command select = Command.FACTORY.createCommand("SELECT accountNumber, accountType, balance FROM accounts where id = :id", mapping);
+            Connection conn = getConnection();
+            select.setConnection(conn);
+            select.setParameterValue("id", customerID);
+            TypeHelper helper = TypeHelper.INSTANCE;
+            select.setDataObjectModel(helper.getType(DataGraphRoot.class));
+            DataGraphRoot root = (DataGraphRoot) select.executeQuery();
+            accountReport.getAccountSummaries().addAll(root.getAccountSummaries());
+
+            // Get Stocks
+
+            select = Command.FACTORY.createCommand(
+                    "SELECT Symbol, quantity, purchasePrice, purchaseDate, purchaseLotNumber  FROM stocks where id = :id", createConfigStream());
+            select.setConnection(conn);
+            select.setParameterValue("id", customerID);
+            select.setDataObjectModel(helper.getType(DataGraphRoot.class));
+
+            // select.addConverter("STOCKS.PURCHASEDATE", DateConverter.class.getName());
+
+            root = (DataGraphRoot) select.executeQuery();
+            accountReport.getStockSummaries().addAll(root.getStockSummaries());
+
+            conn.close();
+
+            return accountReport;
+        } catch (Exception e) {
+            if (e instanceof RemoteException)
+                throw (RemoteException) e;
+            throw new RemoteException("getAccountReport failed. customerID ('" + customerID + "')" + e.getClass().getName() + "'. " + e.getMessage(),
+                    e);
+        }
+    }
+}

Modified: incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataServiceImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataServiceImpl.java?rev=398228&r1=398227&r2=398228&view=diff
==============================================================================
--- incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataServiceImpl.java (original)
+++ incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataServiceImpl.java Sat Apr 29 12:37:22 2006
@@ -16,36 +16,64 @@
  */
 package org.apache.tuscany.samples.bigbank.account.services.accountdata;
 
+import java.rmi.RemoteException;
+import java.util.List;
+
 import org.osoa.sca.annotations.Service;
 
+import com.bigbank.account.AccountFactory;
+import com.bigbank.account.AccountReport;
+import com.bigbank.account.AccountSummary;
+import com.bigbank.account.CustomerProfileData;
+import com.bigbank.account.StockSummary;
+
 @Service(AccountDataService.class)
 public class AccountDataServiceImpl implements AccountDataService {
 
-    public CheckingAccount getCheckingAccount(String customerID) {
 
-        CheckingAccount checkingAccount = new CheckingAccount();
-        checkingAccount.setAccountNumber(customerID + "_" + "CHA12345");
-        checkingAccount.setBalance(1500.0f);
-
-        return checkingAccount;
+    public CustomerProfileData getCustomerProfile(String logonID) throws RemoteException {
+        // TODO Auto-generated method stub
+        return null;
     }
 
-    public SavingsAccount getSavingsAccount(String customerID) {
-
-        SavingsAccount savingsAccount = new SavingsAccount();
-        savingsAccount.setAccountNumber(customerID + "_" + "SAA12345");
-        savingsAccount.setBalance(1500.0f);
-
-        return savingsAccount;
+    public AccountReport getAccountReport(int customerID) {
+        final AccountFactory accountFactory = AccountFactory.eINSTANCE;
+        AccountReport accountReport= accountFactory.createAccountReport();
+        List accounts = accountReport.getAccountSummaries();
+        
+        AccountSummary account = accountFactory.createAccountSummary();
+        account.setAccountType("1111");
+        account.setAccountNumber("22-22-22");
+        account.setBalance(123.45F);
+        accounts.add(account);
+        
+        account= accountFactory.createAccountSummary();
+        account.setAccountType("04-11-19");
+        account.setAccountNumber("11-23");
+        account.setBalance(543.21F);
+        accounts.add(account);
+        
+        List stocks = accountReport.getStockSummaries();
+        StockSummary stock = accountFactory.createStockSummary();
+        stock.setSymbol("IBM");
+        stock.setPurchaseDate("1999-11-23");
+        stock.setPurchaseLotNumber(101);
+        stock.setPurchasePrice(33.33F);
+        stock.setQuantity(10);
+        stocks.add(stock);
+        
+        stock = accountFactory.createStockSummary();
+        stock.setSymbol("TUSK");
+        stock.setPurchaseDate("2005-01-05");
+        stock.setPurchaseLotNumber(102);
+        stock.setPurchasePrice(11.11F);
+        stock.setQuantity(4);
+        stocks.add(stock);
+        return accountReport;
     }
 
-    public StockAccount getStockAccount(String customerID) {
-
-        StockAccount stockAccount = new StockAccount();
-        stockAccount.setAccountNumber(customerID + "_" + "STA12345");
-        stockAccount.setSymbol("IBM");
-        stockAccount.setQuantity(100);
-
-        return stockAccount;
+    public CustomerProfileData createAccount(CustomerProfileData customerProfile, boolean createSavings, boolean createCheckings) throws RemoteException {
+        // TODO Auto-generated method stub
+        return null;
     }
 }

Added: incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdb/AccountDBInit.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdb/AccountDBInit.java?rev=398228&view=auto
==============================================================================
--- incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdb/AccountDBInit.java (added)
+++ incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdb/AccountDBInit.java Sat Apr 29 12:37:22 2006
@@ -0,0 +1,458 @@
+package org.apache.tuscany.samples.bigbank.account.services.accountdb;
+
+import java.io.File;
+import java.io.InputStream;
+import java.io.PrintStream;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Properties;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+
+import org.apache.tuscany.das.rdb.ApplyChangesCommand;
+import org.apache.tuscany.das.rdb.Command;
+import org.apache.tuscany.das.rdb.CommandGroup;
+import org.apache.tuscany.das.rdb.Converter;
+import org.apache.tuscany.das.rdb.config.ConfigFactory;
+import org.apache.tuscany.samples.bigbank.account.services.account.AccountServiceImpl;
+import org.apache.tuscany.samples.bigbank.account.services.accountdata.AccountDataServiceDASImpl;
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import com.bigbank.account.AccountFactory;
+import com.bigbank.account.AccountService;
+import com.bigbank.account.AccountSummary;
+import com.bigbank.account.CustomerProfileData;
+import com.bigbank.account.DataGraphRoot;
+import com.bigbank.account.purchaseStock;
+import com.bigbank.account.withdraw;
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.TypeHelper;
+
+public class AccountDBInit extends HttpServlet {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -4795999792460944805L;
+
+    protected static final String driver = "org.apache.derby.jdbc.EmbeddedDriver";
+
+    protected static final String protocol = "jdbc:derby:";
+
+    boolean deleteExisting = false;
+
+    protected String dbDirectory = null;
+
+    // static{
+    // System.err.println("instatic");
+    // System.out.println("instatic");
+    // }
+
+    @Override
+    public void init() throws ServletException {
+        try {
+            // System.err.println("init()");
+            // System.out.println("init()");
+
+            registerTypes();
+            ServletConfig servletConfig = getServletConfig();
+            ServletContext servletContext = servletConfig.getServletContext();
+            this.dbDirectory = servletContext.getRealPath("WEB-INF/bigbankdb/accounts");
+            this.deleteExisting = false;
+
+            createDB(dbDirectory);
+            final String msgDBcreated = "BigBank database created '" + dbDirectory + "'.";
+            System.out.println(msgDBcreated);
+            System.err.println(msgDBcreated);
+            log(msgDBcreated);
+            // TODO get rid of this!!!
+            AccountDataServiceDASImpl.dbDirectory = dbDirectory;
+
+        } catch (Exception e) {
+
+            e.printStackTrace();
+            log(e.toString(), e);
+            throw new ServletException(e);
+        }
+    }
+
+    public AccountDBInit() {
+        // System.err.println("AccountDBInit()");
+        // System.out.println("AccountDBInit()");
+    }
+
+    public AccountDBInit(String dbDirectory, Boolean deleteExisting) {
+        this.dbDirectory = dbDirectory;
+        this.deleteExisting = deleteExisting;
+    }
+
+    protected void createDB(final String location) throws Exception {
+        Connection conn = null;
+        Exception processessingException = null;
+        try {
+            conn = createConnection(location);
+
+            creatTables(conn);
+
+            int id = createCustomer(conn, "test", "das", "304 Fox Trot ln, Apex, NC", "test@das.org", "test", "password");
+            createAccount(conn, id, AccountServiceImpl.SAVINGS_ACCOUNT_PREFIX + id, AccountServiceImpl.ACCOUNT_TYPE_SAVINGS, 123.43F);
+            createAccount(conn, id, AccountServiceImpl.CHECKING_ACCOUNT_PREFIX+id, AccountServiceImpl.ACCOUNT_TYPE_CHECKINGS, 23.12F);
+            createStockPurchase(conn, id, "IBM", 33, 66.20F, "2005-11-23 13:22:02");
+            createStockPurchase(conn, id, "DELL", 13, 12.74F, "2003-01-03 11:04:03");
+            createStockPurchase(conn, id, "LU", 7, 2.74F, "2003-01-04 16:04:03");
+            createStockPurchase(conn, id, "IBM", 22, 81.43F, "2004-02-03 13:04:33");
+            // System.out.println("id " +id); System.out.flush();
+            id = createCustomer(conn, "test2", "demo2", "Pleasant Plains Rd, ViewMount, CO","test2@das.org", "test2", "password");
+            createAccount(conn, id, AccountServiceImpl.SAVINGS_ACCOUNT_PREFIX + id, AccountServiceImpl.ACCOUNT_TYPE_SAVINGS, 924.40F);
+            createAccount(conn, id, AccountServiceImpl.CHECKING_ACCOUNT_PREFIX+id, AccountServiceImpl.ACCOUNT_TYPE_CHECKINGS, 33.26F);
+            createStockPurchase(conn, id, "FOO", 3, 6.20F, "2000-09-11 09:11:01");
+
+            // System.out.println("id " +id); System.out.flush();
+
+            conn.commit();
+            System.out.println("done.");
+            System.out.flush();
+
+        } catch (org.apache.derby.impl.jdbc.EmbedSQLException e) {
+            if (conn != null && !conn.isClosed())
+                conn.rollback();
+            if (e.getErrorCode() == 20000 && "X0Y32".equalsIgnoreCase(e.getSQLState()) && -1 != e.getMessage().indexOf("already exists")) {
+                // this is ok the database is there.
+                if (false && deleteExisting) {
+                    deleteExisting = false;
+                    File dbFILE = new File(dbDirectory);
+
+                    // createDB(dbDirectory);
+                }
+
+                System.out.println("DB already there.");
+                System.out.flush();
+
+            } else {
+
+                e.printStackTrace();
+                processessingException = e;
+                throw e;
+            }
+        } finally {
+            try {
+                if (null != conn && !conn.isClosed()) {
+
+                    conn.close();
+                }
+                conn = null;
+            } catch (Exception e) {
+                e.printStackTrace();
+                if (null != processessingException) {
+                    throw e;
+                }
+            }
+        }
+
+    }
+
+    private Connection createConnection() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException {
+        return createConnection(dbDirectory);
+    }
+
+    private Connection createConnection(final String location) throws InstantiationException, IllegalAccessException, ClassNotFoundException,
+            SQLException {
+        Connection conn;
+        Class.forName(driver).newInstance();
+        Properties props = new Properties();
+        // props.put("user", "tuscany");
+        // props.put("password", "tuscany");
+        conn = DriverManager.getConnection(protocol + location + ";create=true", props);
+
+        conn.setAutoCommit(false);
+        return conn;
+    }
+
+    protected void creatTables(Connection conn) throws Exception {
+        
+        
+        
+        Statement s = conn.createStatement();
+        s
+                .execute("create table customers(firstName varchar(80) NOT NULL, lastName varchar(80), address varchar(180),email varchar(40),loginID varchar(80) NOT NULL UNIQUE, password varchar(80), id int NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY)");
+
+        s.execute("create table accounts(id int NOT NULL, accountNumber varchar(80) NOT NULL UNIQUE, accountType varchar(80), balance real )");
+
+        s
+                .execute("create table stocks(id int NOT NULL, Symbol varchar(8) NOT NULL, quantity int NOT NULL, purchasePrice real NOT NULL, purchaseDate TIMESTAMP, purchaseLotNumber int NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY  )");
+
+        s.close();
+    }
+
+    protected int createCustomer(Connection conn, final String firstName, final String lastName, final String address, final String email,  final String logonID, final String password)
+            throws SQLException, Exception {
+        Statement s = conn.createStatement();
+
+        s.execute("insert into customers (firstName,lastName,address,email, loginID, password  ) values ('" + firstName + "', '" + lastName + "', '"+ address + "', '" + email + "', '"  + logonID
+                + "', '" + password + "')");
+
+        ResultSet rs = s.executeQuery("SELECT loginID, id FROM customers where loginID='" + logonID + "'");
+        if (!rs.next()) {
+            throw new Exception("Wrong number of rows");
+        }
+        int id = rs.getInt(2);
+        s.close();
+        // System.out.println("cr2wrc id='" + id +"'"); System.out.flush();
+        return id;
+    }
+
+    protected void createAccount(Connection conn, int customerID, final String accountNumber, final String accountType, final float balance)
+            throws SQLException, Exception {
+        Statement s = conn.createStatement();
+
+        s.execute("insert into accounts (id,accountNumber, accountType, balance  ) values (" + customerID + ", '" + accountNumber + "', '"
+                + accountType + "', " + balance + ")");
+
+        s.close();
+        // System.out.println("cr2wrc id='" + id +"'"); System.out.flush();
+
+    }
+
+    protected InputStream createConfigStream() {
+        InputStream mapping = getClass().getClassLoader().getResourceAsStream("basicStaticCustomer.xml");
+        return mapping;
+    }
+
+    protected void createStockPurchase(Connection conn, int customerID, final String stockSymbol, final int quantity, final float purchasePrice,
+            String purchaseDate) throws SQLException, Exception {
+        Statement s = conn.createStatement();
+
+        s.execute("insert into stocks (id, symbol, quantity, purchasePrice, purchaseDate  ) values (" + customerID + ", '" + stockSymbol + "', "
+                + quantity + ", " + purchasePrice + ", '" + purchaseDate + "')");
+
+        s.close();
+        // System.out.println("cr2wrc id='" + id +"'"); System.out.flush();
+
+    }
+
+    protected static void registerTypes() {
+        SDOUtil.registerStaticTypes(AccountFactory.class);
+        // TODO remove
+        SDOUtil.registerStaticTypes(ConfigFactory.class);
+
+    }
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) throws Exception {
+        registerTypes();
+        String dbDirectory = null; // "c:/derbydbtest/foo";
+        Boolean deleteExisting = false;
+        for (String x : args) {
+            if ("-d".equals(x)) {
+                deleteExisting = true;
+            }
+            if (!x.startsWith("-")) {
+                dbDirectory = x;
+            }
+
+        }
+        AccountDBInit accountDBInit = new AccountDBInit(dbDirectory, deleteExisting);
+
+        accountDBInit.createDB(dbDirectory);
+        accountDBInit.readDBstdout(System.out);
+        // CustomerProfileData customerProfileData = accountDBInit.testgetCustomerByLoginIDThroughDASRead("cr22rc");
+
+        // Test withdrawl
+        withdraw wd = AccountFactory.INSTANCE.createwithdraw();
+        wd.setAccountNumber("134-43-39438");
+        wd.setAmount(1.00F);
+        // accountDBInit.testWithdrawThroughDAS(wd);
+
+        // test stock purchase.
+
+        purchaseStock sp = AccountFactory.INSTANCE.createpurchaseStock();
+        sp.setSymbol("GOOG");
+        sp.setId(1);
+        sp.setQuantity(10);
+        accountDBInit.testStrockPurchaseThroughDAS(sp);
+
+        accountDBInit.readDBstdout(System.out);
+
+        System.out.flush();
+    }
+
+    protected void testStrockPurchaseThroughDAS(purchaseStock sp) throws InstantiationException, IllegalAccessException, ClassNotFoundException,
+            SQLException {
+
+        CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(createConfigStream());
+        commandGroup.setConnection(createConnection());
+        Command read = commandGroup.getCommand("all stocks");
+
+        DataObject root = read.executeQuery();
+
+        // Create a new stockPurchase
+        DataObject stockPurchase = root.createDataObject("STOCKS");
+        stockPurchase.set("ID", new Integer(sp.getId()));
+        stockPurchase.set("SYMBOL", sp.getSymbol());
+        stockPurchase.set("QUANTITY", new Integer(sp.getQuantity()));
+        stockPurchase.set("PURCHASEPRICE", new Float(11.00));
+        stockPurchase.set("PURCHASEDATE", new Date());
+
+        ApplyChangesCommand apply = commandGroup.getApplyChangesCommand();
+   //     apply.addConverter("STOCKS.PURCHASEDATE", MyDateConverter.class.getName());
+        apply.execute(root);
+
+        // System.out.println(sp);
+
+    }
+
+    public CustomerProfileData testgetCustomerByLoginIDThroughDASRead(final String logonID) throws Exception {
+
+        InputStream mapping = createConfigStream();
+
+        Command select = Command.FACTORY.createCommand("SELECT firstName, lastName, loginID, password, id FROM customers where loginID = :loginID",
+                mapping);
+        Connection conn = createConnection();
+        select.setConnection(conn);
+        select.setParameterValue("loginID", logonID);
+        TypeHelper helper = TypeHelper.INSTANCE;
+
+        select.setDataObjectModel(helper.getType(DataGraphRoot.class));
+
+        DataGraphRoot root = (DataGraphRoot) select.executeQuery();
+        conn.close();
+
+        Collection customers = root.getCustomerProfileData();
+        CustomerProfileData customerProfileData = (CustomerProfileData) customers.iterator().next();
+        System.out.println(customerProfileData);
+        System.out.flush();
+        return customerProfileData;
+
+    }
+
+    protected void readDBstdout(PrintStream stream) throws Exception {
+        Connection conn = null;
+        try {
+            conn = createConnection(dbDirectory);
+            Statement s = conn.createStatement();
+            ResultSet rs = s.executeQuery("SELECT firstName, lastName, loginID, password, id FROM customers ORDER BY lastName");
+            while (rs.next()) {
+                stream.print(rs.getString(1));
+                stream.print(" ");
+                stream.print(rs.getString(2));
+                stream.print(" ");
+                stream.print(rs.getString(3));
+                stream.print(" ");
+                stream.print(rs.getString(4));
+                stream.print(" ");
+                stream.print(rs.getString(5));
+                stream.println();
+                int id = rs.getInt(5);
+                Statement s1 = conn.createStatement();
+                ResultSet rs1 = s1.executeQuery("SELECT accountNumber, accountType, balance FROM accounts where id=" + id);
+                while (rs1.next()) {
+                    stream.print("\t");
+                    stream.print(rs1.getString(1));
+                    stream.print(" ");
+                    stream.print(rs1.getString(2));
+                    stream.print(" ");
+                    stream.print(rs1.getString(3));
+                    stream.println();
+                }
+                rs1.close();
+                rs1 = s1.executeQuery("SELECT symbol, quantity, purchasePrice, purchaseDate,  purchaseLotNumber FROM stocks where id=" + id);
+                while (rs1.next()) {
+                    stream.print("\t");
+                    stream.print(rs1.getString(1));
+                    stream.print(" ");
+                    stream.print(rs1.getString(2));
+                    stream.print(" ");
+                    stream.print(rs1.getString(3));
+                    stream.print(" ");
+                    stream.print(rs1.getString(4));
+                    stream.print(" ");
+                    stream.print(rs1.getString(5));
+                    stream.println();
+                }
+                s1.close();
+                stream.println();
+
+            }
+            s.close();
+            conn.commit();
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if (conn != null)
+                conn.close();
+            conn = null;
+        }
+
+    }
+
+    public void testWithdrawThroughDAS(withdraw wd) throws Exception {
+
+        Command select = Command.FACTORY.createCommand("SELECT accountNumber, balance FROM accounts where accountNumber = :accountNumber",
+                createConfigStream());
+        Connection conn = createConnection();
+        select.setConnection(conn);
+        select.setParameterValue("accountNumber", wd.getAccountNumber());
+        TypeHelper helper = TypeHelper.INSTANCE;
+
+        select.setDataObjectModel(helper.getType(DataGraphRoot.class));
+
+        DataGraphRoot root = (DataGraphRoot) select.executeQuery();
+
+        Collection accounts = root.getAccountSummaries();
+        AccountSummary account = (AccountSummary) accounts.iterator().next();
+        float newbalance = account.getBalance() - wd.getAmount();
+        account.setBalance(newbalance);
+        // update department set companyid = ? where department.name = ?
+
+        CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(createConfigStream());
+        commandGroup.setConnection(conn);
+        Command update = commandGroup.getCommand("update balance");
+        update.setParameterValue("BALANCE", new Float(newbalance));
+        update.setParameterValue("ACCOUNTNUMBER", wd.getAccountNumber());
+
+        update.execute();
+        conn.close();
+
+    }
+
+    public static class MyDateConverter implements Converter {
+
+        private static DateFormat tsformat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+
+        public Object getPropertyValue(Object columnData) {
+
+            try {
+                return tsformat.parse(columnData.toString());
+            } catch (ParseException e) {
+
+                e.printStackTrace();
+                throw new IllegalArgumentException(e);
+            }
+
+        }
+
+        public Object getColumnValue(Object propertyData) {
+
+            if (propertyData instanceof Date) {
+                return tsformat.format(propertyData);
+            } else
+                throw new IllegalArgumentException();
+
+        }
+
+    }
+
+}

Added: incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuote.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuote.java?rev=398228&view=auto
==============================================================================
--- incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuote.java (added)
+++ incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuote.java Sat Apr 29 12:37:22 2006
@@ -0,0 +1,205 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.tuscany.samples.bigbank.account.services.stockquote;
+
+public class StockQuote {
+
+    private String companyName;
+
+    private String symbol;
+
+    private String stockQuote;
+
+    private String lastUpdated;
+
+    private String change;
+
+    private String openPrice;
+
+    private String dayHighPrice;
+
+    private String dayLowPrice;
+
+    private String volume;
+
+    private String marketCap;
+
+    private String yearRange;
+
+    private String exDividendDate;
+
+    private String dividendYield;
+
+    private String dividendPerShare;
+
+    /**
+     * <!-- begin-user-doc --> <!-- end-user-doc -->
+     * 
+     * @generated
+     */
+    protected StockQuote() {
+        super();
+    }
+
+    public String getCompanyName() {
+        return companyName;
+    }
+
+    public void setCompanyName(String newCompanyName) {
+        companyName = newCompanyName;
+    }
+
+    public String getSymbol() {
+        return symbol;
+    }
+
+    public void setSymbol(String newStockTicker) {
+        symbol = newStockTicker;
+    }
+
+    public String getStockQuote() {
+        return stockQuote;
+    }
+
+    public void setStockQuote(String newStockQuote) {
+        stockQuote = newStockQuote;
+    }
+
+    public String getLastUpdated() {
+        return lastUpdated;
+    }
+
+    public void setLastUpdated(String newLastUpdated) {
+        lastUpdated = newLastUpdated;
+    }
+
+    public String getChange() {
+        return change;
+    }
+
+    public void setChange(String newChange) {
+        change = newChange;
+    }
+
+    public String getOpenPrice() {
+        return openPrice;
+    }
+
+    public void setOpenPrice(String newOpenPrice) {
+        openPrice = newOpenPrice;
+    }
+
+    public String getDayHighPrice() {
+        return dayHighPrice;
+    }
+
+    public void setDayHighPrice(String newDayHighPrice) {
+        dayHighPrice = newDayHighPrice;
+    }
+
+    public String getDayLowPrice() {
+        return dayLowPrice;
+    }
+
+    public void setDayLowPrice(String newDayLowPrice) {
+        dayLowPrice = newDayLowPrice;
+    }
+
+    public String getVolume() {
+        return volume;
+    }
+
+    public void setVolume(String newVolume) {
+        volume = newVolume;
+    }
+
+    public String getMarketCap() {
+        return marketCap;
+    }
+
+    public void setMarketCap(String newMarketCap) {
+        marketCap = newMarketCap;
+    }
+
+    public String getYearRange() {
+        return yearRange;
+    }
+
+    public void setYearRange(String newYearRange) {
+        yearRange = newYearRange;
+    }
+
+    public String getExDividendDate() {
+        return exDividendDate;
+    }
+
+    public void setExDividendDate(String newExDividendDate) {
+        exDividendDate = newExDividendDate;
+    }
+
+    public String getDividendYield() {
+        return dividendYield;
+    }
+
+    public void setDividendYield(String newDividendYield) {
+        dividendYield = newDividendYield;
+    }
+
+    public String getDividendPerShare() {
+        return dividendPerShare;
+    }
+
+    public void setDividendPerShare(String newDividendPerShare) {
+        dividendPerShare = newDividendPerShare;
+    }
+
+    public String toString() {
+
+        StringBuffer result = new StringBuffer(super.toString());
+        result.append(" (companyName: ");
+        result.append(companyName);
+        result.append(", symbol: ");
+        result.append(symbol);
+        result.append(", stockQuote: ");
+        result.append(stockQuote);
+        result.append(", lastUpdated: ");
+        result.append(lastUpdated);
+        result.append(", change: ");
+        result.append(change);
+        result.append(", openPrice: ");
+        result.append(openPrice);
+        result.append(", dayHighPrice: ");
+        result.append(dayHighPrice);
+        result.append(", dayLowPrice: ");
+        result.append(dayLowPrice);
+        result.append(", volume: ");
+        result.append(volume);
+        result.append(", marketCap: ");
+        result.append(marketCap);
+        result.append(", yearRange: ");
+        result.append(yearRange);
+        result.append(", exDividendDate: ");
+        result.append(exDividendDate);
+        result.append(", dividendYield: ");
+        result.append(dividendYield);
+        result.append(", dividendPerShare: ");
+        result.append(dividendPerShare);
+        result.append(')');
+        return result.toString();
+    }
+
+} // Quote

Modified: incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteService.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteService.java?rev=398228&r1=398227&r2=398228&view=diff
==============================================================================
--- incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteService.java (original)
+++ incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteService.java Sat Apr 29 12:37:22 2006
@@ -16,12 +16,14 @@
  */
 package org.apache.tuscany.samples.bigbank.account.services.stockquote;
 
-import org.osoa.sca.annotations.Remotable;
+import java.rmi.RemoteException;
+import java.util.Map;
 
-@Remotable
+/**
+ * This is the business interface of the HelloWorld service component.
+ */
 public interface StockQuoteService {
 
-    public float getQuote(String symbol);
-}
+    public Map<String, StockQuote> getQuotes(String[] symbols) throws RemoteException;
 
- 
\ No newline at end of file
+}

Modified: incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteServiceImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteServiceImpl.java?rev=398228&r1=398227&r2=398228&view=diff
==============================================================================
--- incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteServiceImpl.java (original)
+++ incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteServiceImpl.java Sat Apr 29 12:37:22 2006
@@ -16,13 +16,17 @@
  */
 package org.apache.tuscany.samples.bigbank.account.services.stockquote;
 
+import java.rmi.RemoteException;
+import java.util.Map;
+
 /* Dummy'd up StockQuoteService, override webservice for now */
 
 public class StockQuoteServiceImpl implements StockQuoteService {
 
-    public float getQuote(String symbol) {
-        // Just hardcode for now
-        return 83.00f;
+ 
+    public Map<String, StockQuote> getQuotes(String[] symbols) throws RemoteException {
+        // TODO Auto-generated method stub
+        return null;
     }
 
 }

Added: incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteWebservicexServiceImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteWebservicexServiceImpl.java?rev=398228&view=auto
==============================================================================
--- incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteWebservicexServiceImpl.java (added)
+++ incubator/tuscany/java/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteWebservicexServiceImpl.java Sat Apr 29 12:37:22 2006
@@ -0,0 +1,166 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.tuscany.samples.bigbank.account.services.stockquote;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.lang.reflect.Method;
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Map;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+
+import net.x.webservice.StockQuoteSoap;
+import net.x.webservice.WebserviceFactory;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XSDHelper;
+
+/**
+ * This class implements the Stock quote service component.
+ */
+@Service(StockQuoteService.class)
+// FIXME workaround for JIRA TUSCANY-41
+@Scope("MODULE")
+public class StockQuoteWebservicexServiceImpl implements StockQuoteService {
+    static {
+        SDOUtil.registerStaticTypes(WebserviceFactory.class);
+        TypeHelper th = SDOUtil.createTypeHelper();
+        XSDHelper xsdHelper = SDOUtil.createXSDHelper(th);
+
+        InputStream xsdInputStream = StockQuoteWebservicexServiceImpl.class.getClassLoader().getResourceAsStream("wsdl/stockquotes.webservicex.wsdl");
+        xsdHelper.define(xsdInputStream, null);
+
+    }
+
+    @Reference
+    public StockQuoteSoap stockQuoteService = null; // Injected by the SCA container.
+
+    /**
+     * @throws RemoteException
+     * @see org.apache.tuscany.samples.bigbank.account.services.stockquote.StockQuoteService#getQuotes(String[])
+     */
+    public Map<String, StockQuote> getQuotes(final String[] symbols) throws RemoteException {
+        try {
+            assert null != stockQuoteService : "stockQuoteService was not set by the SCA runtime!";
+            StringBuilder sb = new StringBuilder(5 * symbols.length);
+            for (String sym : symbols) {
+                if (sb.length() != 0)
+                    sb.append(' ');
+                sb.append(sym);
+            }
+            String stockdata = stockQuoteService.GetQuote(sb.toString());
+            // System.err.println(stockdata);
+
+            InputStream in = new ByteArrayInputStream(stockdata.getBytes());
+            XMLInputFactory factory = XMLInputFactory.newInstance();
+            XMLStreamReader parser = factory.createXMLStreamReader(in);
+            ArrayList<StockQuote> listQuotes = new ArrayList<StockQuote>();
+            Hashtable<String,StockQuote> listQuoteHT= new Hashtable<String,StockQuote>();
+            MapStock currentStock = null;
+            StringBuilder currentText = new StringBuilder(100);
+            for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
+                String lname;
+                switch (event) {
+                case XMLStreamConstants.START_ELEMENT:
+                    if (parser.getLocalName() == "Stock") {
+
+                        currentStock = new MapStock();
+                        listQuotes.add(currentStock);
+                    }
+                    break;
+                case XMLStreamConstants.END_ELEMENT:
+                    lname= parser.getLocalName();
+                    String mname = "set" + lname;
+                    try {
+                        Method setter = MapStock.class.getMethod(mname, new Class[] { String.class });
+                        if (setter != null) {
+                            setter.invoke(currentStock, currentText.toString());
+                            if( lname.equals("Symbol")){
+                                listQuoteHT.put(currentText.toString(), currentStock);
+                                
+                            }
+                        }
+                    } catch (NoSuchMethodException e) {
+                        // TODO: handle exception
+                    }
+                    // System.err.println(parser.getLocalName() + ":" + currentText.toString());
+                    currentText.setLength(0);
+                    break;
+                case XMLStreamConstants.CHARACTERS:
+                    // System.out.print(parser.getText());
+                    currentText.append(parser.getText());
+                    break;
+                case XMLStreamConstants.CDATA:
+                    // System.out.print(parser.getText());
+                    currentText.append(parser.getText());
+                    break;
+                } // end switch
+            } // end while
+            parser.close();
+
+            return listQuoteHT;
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RemoteException(e.getClass().getName() + e.getMessage(), e);
+        }
+    }
+
+    public static class MapStock extends StockQuote {
+
+        public void setLast(String val) {
+            super.setStockQuote(val);
+        }
+
+        public void setDate(String val) {
+        };
+
+        public void setTime(String val) {
+        };
+
+        public void setHigh(String val) {
+            super.setDayHighPrice(val);
+        }
+
+        public void setLow(String val) {
+            super.setDayLowPrice(val);
+        }
+
+        public void setOpen(String val) {
+            super.setOpenPrice(val);
+        }
+
+        public void setMktCap(String val) {
+            super.setMarketCap(val);
+        }
+
+        public void setName(String val) {
+            super.setCompanyName(val);
+        }
+
+    }
+
+}

Added: incubator/tuscany/java/samples/bigbank/account/src/main/resources/DasAccountConfiguration.xml
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/bigbank/account/src/main/resources/DasAccountConfiguration.xml?rev=398228&view=auto
==============================================================================
--- incubator/tuscany/java/samples/bigbank/account/src/main/resources/DasAccountConfiguration.xml (added)
+++ incubator/tuscany/java/samples/bigbank/account/src/main/resources/DasAccountConfiguration.xml Sat Apr 29 12:37:22 2006
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="ASCII"?>
+<Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  
+  <Table name="CUSTOMERS" propertyName="CustomerProfileData">
+    <!-- Column name="firstName" primaryKey="true"/ -->
+    <Column name="FIRSTNAME"/>
+    <Column name="LASTNAME"/> 
+    <Column name="ADDRESS"/> 
+    <Column name="EMAIL"/>
+     <Column name="LOGINID"/> 
+     <Column name="PASSWORD"/> 
+      <Column name="ID"/> 
+  </Table>
+  <Table name="ACCOUNTS" propertyName="AccountSummary">
+    <!-- Column name="firstName" primaryKey="true"/ -->
+    <Column name="ACCOUNTNUMBER"/>
+    <Column name="BALANCE"/> 
+  </Table>
+
+<!--
+"create table stocks(id int NOT NULL, Symbol varchar(8) NOT NULL, quantity int NOT NULL, purchasePrice real NOT NULL, purchaseDate TIMESTAMP, purchaseLotNumber int NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY  )");
+-->	
+  <Table name="STOCKS" propertyName="StockSummary" >
+    
+    <Column name="ID"/>
+    <Column name="Symbol"/>
+    <Column name="quantity"/>
+    <Column name="purchasePrice"/>
+    <Column name="PURCHASEDATE" converterClassName="org.apache.tuscany.samples.bigbank.account.services.accountdata.AccountDataServiceDASImpl$DateConverter"/>
+  </Table>
+
+	
+  <Command name="update balance"
+        SQL="update ACCOUNTS set BALANCE = :BALANCE where ACCOUNTNUMBER = :ACCOUNTNUMBER"
+        kind="Update">
+        <Parameter name=":BALANCE"/>
+        <Parameter name=":ACCOUNTNUMBER"/>
+    </Command>
+    
+    
+    <Command name="all stocks" SQL="select * from stocks"  kind="Select"/>
+    <Command name="all customers" SQL="select * from CUSTOMERS"  kind="Select"/>
+    
+	
+</Config>

Modified: incubator/tuscany/java/samples/bigbank/account/src/main/resources/sca.module
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/samples/bigbank/account/src/main/resources/sca.module?rev=398228&r1=398227&r2=398228&view=diff
==============================================================================
--- incubator/tuscany/java/samples/bigbank/account/src/main/resources/sca.module (original)
+++ incubator/tuscany/java/samples/bigbank/account/src/main/resources/sca.module Sat Apr 29 12:37:22 2006
@@ -1,58 +1,74 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
-  Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- -->
-<module xmlns="http://www.osoa.org/xmlns/sca/0.9" xmlns:v="http://www.osoa.org/xmlns/sca/values/0.9"
-
-        name="tuscany.samples.bigbank.account">
-
-    <import.sdo factory="org.apache.tuscany.samples.bigbank.account.AccountFactory"/>
-    <import.wsdl location="wsdl/AccountService.wsdl" namespace="http://www.bigbank.com/Account/"/>
-    <import.wsdl location="wsdl/StockQuoteWebService.wsdl" namespace="http://webservice.stockquote"/>
-		
-    <entryPoint name="AccountService">
-        <interface.java interface="org.apache.tuscany.samples.bigbank.account.services.account.AccountService"/>
-        <binding.ws port="http://www.bigbank.com/Account/#AccountServiceSOAP"/>
-        <reference>AccountServiceComponent/AccountService</reference>
-    </entryPoint>
-
-    <component name="AccountServiceComponent">
-        <implementation.java class="org.apache.tuscany.samples.bigbank.account.services.account.AccountServiceImpl"/>
-        <properties>
-            <v:currency>EURO</v:currency>
-        </properties>
-        <references>
-            <v:accountDataService>AccountDataServiceComponent</v:accountDataService>
-            <v:stockQuoteService>StockQuoteService</v:stockQuoteService>
-        </references>
-    </component>
-
-    <component name="AccountDataServiceComponent">
-        <implementation.java class="org.apache.tuscany.samples.bigbank.account.services.accountdata.AccountDataServiceImpl"/>
-    </component>
-
-    <component name="StockQuoteService">
-        <implementation.java class="org.apache.tuscany.samples.bigbank.account.services.stockquote.StockQuoteServiceImpl"/>
-    </component>
-
-    <!--
-        <externalService name="StockQuoteService">
-            <interface.java interface="org.apache.tuscany.samples.bigbank.account.services.stockquote"/>
-            <binding.ws port="http://www.quickstockquote.com/StockQuoteService#StockQuoteServiceSOAP"/>
-        </externalService>
-    -->
-
-</module>
-	
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+  Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+ -->
+<module xmlns="http://www.osoa.org/xmlns/sca/0.9" xmlns:v="http://www.osoa.org/xmlns/sca/values/0.9"
+        name="tuscany.samples.bigbank.account">
+	<import.sdo factory="com.bigbank.account.AccountFactory" />
+	<import.sdo factory="net.x.webservice.WebserviceFactory" />
+    <import.wsdl
+                location="wsdl/AccountService.wsdl"
+                namespace="http://www.bigbank.com/account"/>
+    <!-- import.wsdl
+                location="wsdl/StockQuoteWebService.wsdl"
+                namespace="http://webservice.stockquote"/ -->
+
+    <import.wsdl location="wsdl/stockquotes.webservicex.wsdl"
+      namespace="http://www.webserviceX.NET/"/>
+
+    <entryPoint name="AccountService">
+        <interface.java interface="com.bigbank.account.AccountService"/>
+        <binding.ws port="http://www.bigbank.com/account#AccountServiceSOAP"/>
+        <reference>AccountServiceComponent/AccountService</reference>
+    </entryPoint>
+
+    <component name="AccountServiceComponent">
+        <implementation.java class="org.apache.tuscany.samples.bigbank.account.services.account.AccountServiceImpl"/>
+        <properties>
+            <v:currency>EURO</v:currency>
+        </properties>
+        <references>
+            <v:accountDataService>AccountDataServiceComponent</v:accountDataService>
+            <v:stockQuoteService>StockQuoteServiceComponent</v:stockQuoteService>
+        </references>
+    </component>
+
+    <component name="AccountDataServiceComponent">
+        <implementation.java class="org.apache.tuscany.samples.bigbank.account.services.accountdata.AccountDataServiceDASImpl"/>
+    </component>
+
+    <component name="StockQuoteServiceComponent">
+        <implementation.java class="org.apache.tuscany.samples.bigbank.account.services.stockquote.StockQuoteWebservicexServiceImpl"/>
+        <references>
+            <v:stockQuoteService>StockQuoteWebService</v:stockQuoteService>
+        </references>
+    </component>
+
+<!--   local
+    <component name="StockQuoteServiceComponet">
+        <implementation.java class="org.apache.tuscany.samples.bigbank.account.services.stockquote.StockQuoteServiceImpl"/>
+    </component>
+    -->
+
+    <externalService name="StockQuoteWebService">
+        <interface.wsdl interface="http://www.webserviceX.NET/#StockQuoteSoap"/>
+        <binding.ws port="http://www.webserviceX.NET/#StockQuoteSoap"/>
+        
+    </externalService>
+
+
+                
+</module>
+