Package org.apache.tuscany.das.rdb

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


        insert.setParameter(2, stock.getSymbol());
        insert.setParameter(3, new Integer(stock.getQuantity()));
        insert.setParameter(4, STOCK_ACTION_TYPE_PURCHASE);
        insert.setParameter(5, new Integer(stock.getPurchaseLotNumber()));

        insert.execute();
        /*
         * performLog("insert into stockLog (id, Symbol, quantity, actionType, purchaseLotNumber) values (" + id + ", '" + stock.getSymbol() + "', " +
         * stock.getQuantity() + ", '" + STOCK_ACTION_TYPE_PURCHASE + ", " + stock.getPurchaseLotNumber() + ")");
         */
    }
View Full Code Here


        insert.setParameter(2, symbol);
        insert.setParameter(3, new Integer(quantity));
        insert.setParameter(4, STOCK_ACTION_TYPE_SELL);
        insert.setParameter(5, new Integer(stock.getPurchaseLotNumber()));

        insert.execute();
        /*
         * performLog("insert into stockLog (id, Symbol, quantity, actionType, purchaseLotNumber) values (" + id + ", '" + stock.getSymbol() + "', " +
         * quantity + ", '" + STOCK_ACTION_TYPE_SELL + ", " + stock.getPurchaseLotNumber() + ")");
         */
    }
View Full Code Here

        assertFalse(root.get("CUSTOMER[1]/LASTNAME").equals("Pavick"));
        int id = root.getInt("CUSTOMER[1]/ID");

        Command update = commandGroup.getCommand("update customer");
        update.setParameterValue("ID", new Integer(id));
        update.execute();

        // Verify update - reuse select command
        root = read.executeQuery();
        assertEquals("Pavick", root.get("CUSTOMER[1]/LASTNAME"));
View Full Code Here

        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 {
View Full Code Here

    // Explicitly change OCC column in database to force collision
    Command update = Command.FACTORY
        .createCommand("update BOOK set OCC = :OCC where BOOK_ID = 1");
    update.setConnection(getConnection());
    update.setParameterValue("OCC", new Integer(100));
    update.execute();

    //Try to flush the change
    ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("BooksConfig.xml"));
    apply.setConnection(getConnection());
View Full Code Here

  public void testInsert() throws Exception {
   
    Command insert = Command.FACTORY.createCommand("insert into CUSTOMER values (10, 'Williams', '5528 Wells Fargo Dr')")
    insert.setConnection(getConnection());
    insert.execute();

    //Verify
    Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 10");
    select.setConnection(getConnection());
    DataObject root = select.executeQuery()
View Full Code Here

        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 + ")");
View Full Code Here

            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 + ")");
View Full Code Here

            }
            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) {
View Full Code Here

            CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(createConfigStream());
            commandGroup.setConnection(conn);
            Command update = commandGroup.getCommand("update balance");
            update.setParameterValue("BALANCE", new Float(newbalance));
            update.setParameterValue("ACCOUNTNUMBER", account);
            update.execute();
            conn.close();
            return newbalance;
        } catch (Exception e) {
            throw new RemoteException(e.getClass().getName(), e);
        }
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.