Package GenericDBMS

Examples of GenericDBMS.DBConnectionManager$CallableStatementDelegate


     * SQLDeleteHolding<p>
     * <p>
     * @param pHolding Type: Holding
     */
    private void SQLDeleteHolding(Holding pHolding) {
        DBConnectionManager dBConnection = DBConnectionManager.getInstance("DBConnection");

        // -- =============== Original SQL ===============
        // delete from Holding
        // where CustomerName=:pHolding.CustomerName and
        //    StockName=:pHolding.StockName
        // on session DBConnection
        // -- ============================================
        String qq_SQL = "delete from Holding " +
                        "where CustomerName=? and " +
                        "StockName=? ";
        Object[] qq_SQLParams = new Object[] {
            pHolding.getCustomerName(),
            pHolding.getStockName()
        };
        dBConnection.getTemplate().update(qq_SQL, qq_SQLParams);
    }
View Full Code Here


     * SQLInsertHolding<p>
     * <p>
     * @param pHolding Type: Holding
     */
    private void SQLInsertHolding(Holding pHolding) {
        DBConnectionManager dBConnection = DBConnectionManager.getInstance("DBConnection");

        // -- =============== Original SQL ===============
        // insert into Holding (CustomerName, StockName, Quantity, Price)
        // values (:pHolding.CustomerName, :pHolding.StockName,
        //        :pHolding.Quantity, :pHolding.Price)
        // on session DBConnection
        // -- ============================================
        String qq_SQL = "insert into Holding (CustomerName, StockName, Quantity, Price) " +
                        "values (?, ?, " +
                        "?, ?) ";
        Object[] qq_SQLParams = new Object[] {
            pHolding.getCustomerName(),
            pHolding.getStockName(),
            new Integer(pHolding.getQuantity()),
            new Float(pHolding.getPrice())
        };
        dBConnection.getTemplate().update(qq_SQL, qq_SQLParams);
    }
View Full Code Here

     */
    private Customer SQLSelectCustomer(TextData pName) {
        Customer aCustomer = new Customer();
        int recsReturned = 0;
        int qq_RowCount = 0;
        DBConnectionManager dBConnection = DBConnectionManager.getInstance("DBConnection");

        // -- =============== Original SQL ===============
        // select * into :aCustomer from Customer
        //         where CustomerName = :pName
        //         on session DBConnection
        // -- ============================================
        String qq_SQL = "select *  from Customer " +
                        "where CustomerName = ? ";
        Object[] qq_SQLParams = new Object[] {pName };
        // TODO [112,Info]: Using the * in a query rather than explicitly enumerating the column list is often inefficient.
        JdbcTemplate qq_Template = dBConnection.getTemplate();
        List qq_List = qq_Template.query(qq_SQL, qq_SQLParams, new BeanRowMapper(aCustomer, Customer.class));
        if (!qq_List.isEmpty()) {
            aCustomer = (Customer)DataAccessUtils.singleResult(qq_List);
        }
        qq_RowCount = qq_List.size();
View Full Code Here

     */
    private Holding SQLSelectHolding(TextData pSelHoldCustName, String pSelHoldStockName) {
        Holding aHolding = new Holding();
        int recsReturned = 0;
        int qq_RowCount = 0;
        DBConnectionManager dBConnection = DBConnectionManager.getInstance("DBConnection");

        // -- =============== Original SQL ===============
        // select * into :aHolding from Holding
        //           where CustomerName = :pSelHoldCustName
        //           and StockName = :pSelHoldStockName
        //           on session DBConnection
        // -- ============================================
        String qq_SQL = "select *  from Holding " +
                        "where CustomerName = ? " +
                        "and StockName = ? ";
        Object[] qq_SQLParams = new Object[] {
            pSelHoldCustName,
            pSelHoldStockName
        };
        // TODO [112,Info]: Using the * in a query rather than explicitly enumerating the column list is often inefficient.
        JdbcTemplate qq_Template = dBConnection.getTemplate();
        List qq_List = qq_Template.query(qq_SQL, qq_SQLParams, new BeanRowMapper(aHolding, Holding.class));
        if (!qq_List.isEmpty()) {
            aHolding = (Holding)DataAccessUtils.singleResult(qq_List);
        }
        qq_RowCount = qq_List.size();
View Full Code Here

     * @return Array_Of_Holding<Holding>
     */
    private Array_Of_Holding<Holding> SQLSelectHoldingList(TextData pName) {
        Array_Of_Holding<Holding> aCustomersHoldingList = new Array_Of_Holding<Holding>();

        DBConnectionManager dBConnection = DBConnectionManager.getInstance("DBConnection");

        // -- =============== Original SQL ===============
        // select * into :aCustomersHoldingList
        // from Holding
        // where CustomerName = :pName
        // on session DBConnection
        // -- ============================================
        String qq_SQL = "select * " +
                        "from Holding " +
                        "where CustomerName = ? ";
        Object[] qq_SQLParams = new Object[] {pName };
        // TODO [112,Info]: Using the * in a query rather than explicitly enumerating the column list is often inefficient.
        JdbcTemplate qq_Template = dBConnection.getTemplate();
        aCustomersHoldingList = (Array_Of_Holding)qq_Template.query(qq_SQL, qq_SQLParams, new ArrayRowMapper(aCustomersHoldingList, Array_Of_Holding.class));

        return aCustomersHoldingList;
    }
View Full Code Here

     * SQLUpdateHolding<p>
     * <p>
     * @param pHolding Type: Holding
     */
    private void SQLUpdateHolding(Holding pHolding) {
        DBConnectionManager dBConnection = DBConnectionManager.getInstance("DBConnection");

        // -- =============== Original SQL ===============
        // update Holding set Quantity = :pHolding.Quantity
        // where CustomerName=:pHolding.CustomerName and
        // StockName=:pHolding.StockName
        // on session DBConnection
        // -- ============================================
        String qq_SQL = "update Holding set Quantity = ? " +
                        "where CustomerName=? and " +
                        "StockName=? ";
        Object[] qq_SQLParams = new Object[] {
            new Integer(pHolding.getQuantity()),
            pHolding.getCustomerName(),
            pHolding.getStockName()
        };
        dBConnection.getTemplate().update(qq_SQL, qq_SQLParams);
    }
View Full Code Here

    public Array_Of_SqlData<SqlData> getData() {
        return this.data;
    }

    public void setDBSession(DBConnectionManager dBSession) {
        DBConnectionManager oldValue = this.dBSession;
        this.dBSession = dBSession;
        this.qq_Listeners.firePropertyChange("DBSession", oldValue, this.dBSession);
    }
View Full Code Here

    // ----------------------
    // Accessors and Mutators
    // ----------------------
    public synchronized void setDB(DBConnectionManager dB) {
        DBConnectionManager oldValue = this.dB;
        this.dB = dB;
        this.qq_Listeners.firePropertyChange("DB", oldValue, this.dB);
    }
View Full Code Here

    public Array_Of_SqlData<SqlData> getData() {
        return this.data;
    }

    public void setDBSession(DBConnectionManager dBSession) {
        DBConnectionManager oldValue = this.dBSession;
        this.dBSession = dBSession;
        this.qq_Listeners.firePropertyChange("DBSession", oldValue, this.dBSession);
    }
View Full Code Here

    // ----------------------
    // Accessors and Mutators
    // ----------------------
    public synchronized void setDB(DBConnectionManager dB) {
        DBConnectionManager oldValue = this.dB;
        this.dB = dB;
        this.qq_Listeners.firePropertyChange("DB", oldValue, this.dB);
    }
View Full Code Here

TOP

Related Classes of GenericDBMS.DBConnectionManager$CallableStatementDelegate

Copyright © 2018 www.massapicom. 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.