Examples of createCommand()


Examples of org.apache.empire.struts2.websample.db.SampleDB.createCommand()

    @Override
    public Options getFieldOptions(DBColumn column)
    {
        if (column.equals(T.C_DEPARTMENT_ID)) {
            SampleDB db = (SampleDB)getDatabase();
            DBCommand cmd = db.createCommand();
            cmd.select(db.T_DEPARTMENTS.C_DEPARTMENT_ID);
            cmd.select(db.T_DEPARTMENTS.C_NAME);
            return db.queryOptionList(cmd, context.getConnection());
        }
        // base class implementation
View Full Code Here

Examples of org.apache.sshd.server.CommandFactory.createCommand()

        prepareServer(true);
        server.start();
        try {
            org.apache.sshd.SshServer sshd = (org.apache.sshd.SshServer) ReflectionTestUtils.getField(server, "sshd");
            CommandFactory fact = sshd.getCommandFactory();
            Command cmd = fact.createCommand("shutdown now");
            assertTrue(cmd instanceof SshCommand);
            assertEquals(((SshCommand) cmd).getCommand(),"shutdown now");
        } finally {
            server.stop();
        }
View Full Code Here

Examples of org.apache.tuscany.das.rdb.DAS.createCommand()

        try {
            InputStream mapping = createConfigStream();
            Connection conn = getConnection();
            DAS das = DAS.FACTORY.createDAS(mapping, conn);

            Command select = das.createCommand("SELECT firstName, lastName, loginID, password, id FROM customers where loginID = ?");

            select.setParameter(1, logonID);

            DataObject root = select.executeQuery();
            conn.close();
View Full Code Here

Examples of org.apache.tuscany.das.rdb.DAS.createCommand()

    public CustomerProfileData createAccount(CustomerProfileData customerProfile, boolean createSavings, boolean createCheckings)
            throws RemoteException {

        try {
            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());
View Full Code Here

Examples of org.apache.tuscany.das.rdb.DAS.createCommand()

            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 + ")");
                insert.execute();

            }
            if (createCheckings) {
View Full Code Here

Examples of org.apache.tuscany.das.rdb.DAS.createCommand()

                        + 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 + ")");
                insert.execute();

            }
View Full Code Here

Examples of org.apache.tuscany.das.rdb.DAS.createCommand()

            InputStream mapping = createConfigStream();

            Connection conn = getConnection();
            DAS das = DAS.FACTORY.createDAS(mapping, conn);

            Command select = das.createCommand("SELECT accountNumber, accountType, balance FROM accounts where id = ?");
            select.setParameter(1, customerID);

            DataObject root = select.executeQuery();
            accountReport.getAccountSummaries().addAll(root.getList("AccountSummary"));
View Full Code Here

Examples of org.apache.tuscany.das.rdb.DAS.createCommand()

            DataObject root = select.executeQuery();
            accountReport.getAccountSummaries().addAll(root.getList("AccountSummary"));

            // Get Stocks

            select = das.createCommand("SELECT Symbol, quantity, purchasePrice, purchaseDate, purchaseLotNumber  FROM stocks where id = ?");
            select.setParameter(1, customerID);

            // select.addConverter("STOCKS.PURCHASEDATE", DateConverter.class.getName());

            root = select.executeQuery();
View Full Code Here

Examples of org.apache.tuscany.das.rdb.DAS.createCommand()

        try {
            Connection conn = getConnection();
            DAS das = DAS.FACTORY.createDAS(createConfigStream(), conn);

            Command select = das.createCommand("SELECT accountNumber, balance FROM accounts where accountNumber = ?");
            select.setParameter(1, account);

            DataObject root = select.executeQuery();
            Collection accounts = root.getList("AccountSummary");
            AccountSummary accountData = (AccountSummary) accounts.iterator().next();
View Full Code Here

Examples of org.apache.tuscany.das.rdb.DAS.createCommand()

            if (null != stocks && !stocks.isEmpty()) {
                StockSummary stock = (StockSummary) stocks.get(0);
                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 {
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.