Package org.apache.tuscany.das.rdb

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


                if (newQuatity < 1) {

                    Command delete = Command.FACTORY.createCommand("DELETE FROM STOCKS WHERE PURCHASELOTNUMBER = ?");
                    delete.setParameterValue(1, purchaseLotNumber);
                    delete.setConnection(getConnection());
                    delete.execute();

                } else {

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


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

                    update.setParameterValue("QUANTITY", newQuatity);
                    update.setParameterValue("PURCHASELOTNUMBER", purchaseLotNumber);
                    update.execute();

                    stock.setQuantity(newQuatity);
                }

            }
View Full Code Here

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

            insert.setConnection(getConnection());
            insert.execute();

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

        Command insert = Command.FACTORY.createCommand(sql);
        insert.setParameterValue("serverid", new Integer(316405209));
        insert.setParameterValue("timestamp", "2005-11-23 19:29:52.636");
        insert.setConnection(getConnection());
        insert.execute();

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

        insert.setConnection(getConnection());
        insert.setParameterValue("ID", new Integer(10));
        insert.setParameterValue("LASTNAME", null);
        insert.setParameterType("LASTNAME", SDODataTypes.STRING);
        insert.setParameterValue("ADDRESS", "5528 Wells Fargo Dr");
        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

        insert.setParameterValue("ID", new Integer(10));
        // insert.setParameterValue("LASTNAME", null);
        insert.setParameterValue("ADDRESS", "5528 Wells Fargo Dr");

        try {
            insert.execute();
            fail();
        } catch (RuntimeException e) {
            // Expected since "LASTNAME" parameter not set
        }
    }
View Full Code Here

        Command insert = Command.FACTORY.createCommand("insert into CUSTOMER values (:ID, :LASTNAME, :ADDRESS)");
        insert.setConnection(getConnection());
        insert.setParameterValue("ID", new Integer(10));
        insert.setParameterValue("LASTNAME", "");
        insert.setParameterValue("ADDRESS", "5528 Wells Fargo Dr");
        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

        // 19:29:52.636')";
        String sql = "insert into conmgt.serverstatus (managedserverid, timestamp) values (316405209, '2005-11-23 19:29:52.636')";

        Command insert = Command.FACTORY.createCommand(sql);
        insert.setConnection(getConnection());
        insert.execute();

        // Verify
        Command select = Command.FACTORY
                .createCommand("Select * from conmgt.serverstatus where statusid = 316405209");
        select.setConnection(getConnection());
View Full Code Here

        Command insert = Command.FACTORY.createCommand(sql);
        insert.setParameterValue("serverid", new Integer(316405209));
        insert.setParameterValue("timestamp", "2005-11-23 19:29:52.636");
        insert.setConnection(getConnection());
        insert.execute();

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

                .createCommand("insert into CUSTOMER values (:ID, :LASTNAME, :ADDRESS)");
        insert.setConnection(getConnection());
        insert.setParameterValue("ID", new Integer(10));
        insert.setParameterValue("LASTNAME", "Williams");
        insert.setParameterValue("ADDRESS", null);
        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

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.