Package org.apache.tuscany.das.rdb

Examples of org.apache.tuscany.das.rdb.Command.execute()


            DAS das = DAS.FACTORY.createDAS(getConnection());
            Command insert = das.createCommand("insert into customers (firstName,lastName,address,email, loginID, password  ) values ('"
                    + customerProfile.getFirstName() + "', '" + customerProfile.getLastName() + "', '" + customerProfile.getAddress() + "', '"
                    + customerProfile.getEmail() + "', '" + customerProfile.getLoginID() + "', '" + customerProfile.getPassword() + "')");

            insert.execute();
            CustomerProfileData ret = getCustomerProfile(customerProfile.getLoginID());
            String cid = ret.getId() + "";
            if (createSavings) {
                insert = das.createCommand("insert into accounts (id,accountNumber, accountType, balance  ) values (" + cid + ", '"
                        + AccountServiceImpl.SAVINGS_ACCOUNT_PREFIX + cid + "', '" + AccountServiceImpl.ACCOUNT_TYPE_SAVINGS + "', " + 1.0F + ")");
View Full Code Here


            CustomerProfileData ret = getCustomerProfile(customerProfile.getLoginID());
            String cid = ret.getId() + "";
            if (createSavings) {
                insert = das.createCommand("insert into accounts (id,accountNumber, accountType, balance  ) values (" + cid + ", '"
                        + AccountServiceImpl.SAVINGS_ACCOUNT_PREFIX + cid + "', '" + AccountServiceImpl.ACCOUNT_TYPE_SAVINGS + "', " + 1.0F + ")");
                insert.execute();

            }
            if (createCheckings) {
                insert = das.createCommand("insert into accounts (id,accountNumber, accountType, balance  ) values (" + cid + ", '"
                        + AccountServiceImpl.CHECKING_ACCOUNT_PREFIX + cid + "', '" + AccountServiceImpl.ACCOUNT_TYPE_CHECKINGS + "', " + 1.0F + ")");
View Full Code Here

            }
            if (createCheckings) {
                insert = das.createCommand("insert into accounts (id,accountNumber, accountType, balance  ) values (" + cid + ", '"
                        + AccountServiceImpl.CHECKING_ACCOUNT_PREFIX + cid + "', '" + AccountServiceImpl.ACCOUNT_TYPE_CHECKINGS + "', " + 1.0F + ")");
                insert.execute();

            }

            return ret;
        } catch (Exception e) {
View Full Code Here

            // update department set companyid = ? where department.name = ?

            Command update = das.getCommand("update balance");
            update.setParameter(1, new Float(newbalance));
            update.setParameter(2, account);
            update.execute();
            conn.close();
            return newbalance;
        } catch (Exception e) {
            throw new RemoteException(e.getClass().getName(), e);
        }
View Full Code Here

                int newQuatity = Math.max(stock.getQuantity() - quantity, 0);
                if (newQuatity < 1) {

                    Command delete = das.createCommand("DELETE FROM STOCKS WHERE PURCHASELOTNUMBER = ?");
                    delete.setParameter(1, purchaseLotNumber);
                    delete.execute();

                } else {

                    Command update = das.getCommand("stockbylot");
View Full Code Here

                    Command update = das.getCommand("stockbylot");

                    update.setParameter(1, newQuatity);
                    update.setParameter(2, purchaseLotNumber);
                    update.execute();

                    stock.setQuantity(newQuatity);
                }
                return stock;
            }
View Full Code Here

            insert.setParameter(2, stock.getSymbol());
            insert.setParameter(3, stock.getQuantity());
            insert.setParameter(4, stock.getPurchasePrice());
            insert.setParameter(5, DateConverter.INSTANCE.getColumnValue(stock.getPurchaseDate()));

            insert.execute();

            return stock;
        } catch (Exception e) {
            if (e instanceof RemoteException) {
                throw (RemoteException) e;
View Full Code Here

        Command update = das.getCommand("update balance");
        update.setParameter(1, new Float(newbalance));
        update.setParameter(2, wd.getAccountNumber());

        update.execute();
        conn.close();
    }

    protected void testStrockPurchaseThroughDAS(purchaseStock sp) throws InstantiationException, IllegalAccessException, ClassNotFoundException,
            SQLException {
View Full Code Here

        insert.setParameter(1, new Integer(id));
        insert.setParameter(2, account);
        insert.setParameter(3, ACCT_ACTION_TYPE_DEPOSIT);
        insert.setParameter(4, new Float(amount));

        insert.execute();
        /*
         * performLog("insert into acctLog (id, accountNumber, actionType, amount) values (" + id + ", '" + account + "', '" +
         * ACCT_ACTION_TYPE_DEPOSIT + "', " + amount + ")");
         */
    }
View Full Code Here

        insert.setParameter(1, new Integer(id));
        insert.setParameter(2, account);
        insert.setParameter(3, ACCT_ACTION_TYPE_WITHDRAW);
        insert.setParameter(4, new Float(amount));

        insert.execute();
        /*
         * performLog("insert into acctLog (id ,accountNumber, actionType, amount) values (" + id + ", '" + account + "', '" +
         * ACCT_ACTION_TYPE_WITHDRAW + "', " + amount + ")");
         */
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.