Package net.helipilot50.stocktrade.genericdbms

Examples of net.helipilot50.stocktrade.genericdbms.DBConnectionManager$CallableStatementDelegate


        if (resultSet instanceof CachedRowSet) {
          CachedRowSet cachedRowSet = (CachedRowSet) resultSet;
          try {
            cachedRowSet.updateString(pColOrdinal, pValue);
          } catch (SQLException e) {
            UsageException errorVar = new UsageException(e.getMessage(), net.helipilot50.stocktrade.framework.Constants.SP_ER_USER, net.helipilot50.stocktrade.framework.Constants.SP_ER_PARAMETERERROR, e);
            ErrorMgr.addError(errorVar);
            throw errorVar;
          }
        }
      }
View Full Code Here


     * and is a hint to the underlying JDBC driver only.
     * @param pRows The maximum number of rows for this dataset
     */
    public void setMaxRows(int pRows) {
      if (pRows < 0) {
        UsageException err = new UsageException("pRows must be > 0 in call to DBDataSet.setMaxRows");
        ErrorMgr.addError(err);
        throw err;
      }
      this.maxRows = pRows;
      if (this.statement != null) {
View Full Code Here

        //PM:19/2/08 setting the name uses the naming strategy
        try {
            ObjectName objectName  = SystemAgent.getStrategy().getObjectName(this, pValue.toString());
            this.setObjectName(objectName);
        } catch (MalformedObjectNameException e) {
            UsageException errorVar = new UsageException("Cannot set SystemAgent name to: " + pValue, e);
            ErrorMgr.addError(errorVar);
            throw errorVar;
        } catch (NullPointerException e) {
            UsageException errorVar = new UsageException("Cannot set SystemAgent name to: " + pValue, e);
            ErrorMgr.addError(errorVar);
            throw errorVar;
        }

        this.agentInfo.setAgentName(pValue.toString());
View Full Code Here

        try {
            ObjectName objectName  = SystemAgent.getStrategy().getObjectName(this, System.getProperty(PropertiesMgr.cENVIRONMENT_NAME));
            this.setObjectName(objectName);

        } catch (MalformedObjectNameException e) {
            UsageException errorVar = new UsageException("Cannot create EnvironmentAgent", e);
            ErrorMgr.addError(errorVar);
            throw errorVar;
        } catch (NullPointerException e) {
            UsageException errorVar = new UsageException("Cannot create EnvironmentAgent", e);
            ErrorMgr.addError(errorVar);
            throw errorVar;
        }

        this.setNameAsString(System.getProperty("EnvName"));
View Full Code Here

     * self.StockNameList[8] = new;<br>
     * self.StockNameList[8].TextValue.Setvalue('Forte');<br>
     * <p>
     */
    private void setupStockNameList() {
        DBConnectionManager dBConnection = DBConnectionManager.getInstance("DBConnection");
        ResultSet qq_rs = null;
        PreparedStatement qq_cmd = null;
        String qq_SQL = null;
        try {

            // -- =============== Original SQL ===============
            // select StockName from Stock
            //         on session DBConnection
            // -- ============================================
            qq_SQL = "select StockName from Stock ";
            qq_cmd = dBConnection.getPreparedStatement(qq_SQL);
            qq_rs = qq_cmd.executeQuery();
            ResultSetHelper qq_rsHelper = new ResultSetHelper(qq_rs);
            while (qq_rsHelper.next()) {
                TextData temp = qq_rsHelper.getTextData(1);
                ListElement row = new ListElement();
                row.getTextValue().setValue( temp.getValue() );
                this.stockNameList.add(row);
            }
        }
        catch (SQLException qq_error) {
            throw new SQLErrorCodeSQLExceptionTranslator(dBConnection.getDataSource()).translate("Running SQL", qq_SQL, qq_error);
        }
        finally {
            dBConnection.cleanup(qq_cmd);
        }
    }
View Full Code Here

     * 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

TOP

Related Classes of net.helipilot50.stocktrade.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.