Examples of ResultSetHelper


Examples of GenericDBMS.ResultSetHelper

        RowCountCallbackHandler qq_RowCounter = new RowCountCallbackHandler() {
            protected void processRow(ResultSet pResultSet, int pRow) throws SQLException {
                if (pRow >= 1) {
                    throw new IncorrectResultSizeDataAccessException(1, pRow+1);
                }
                ResultSetHelper helper = new ResultSetHelper(pResultSet);
                qqh_title1.setObject(helper.getString(1));
                qqh_numCustomers.setInt(helper.getInt(2));
                qqh_title2.setObject(helper.getTextData(3));
                qqh_numStocks.setObject(helper.getIntegerData(4));
                qqh_title3.setObject(helper.getTextNullable(5));
                qqh_totalValue.setDouble(helper.getDouble(6));
            }
        };
        dBConnection.getTemplate().query(qq_SQL, qq_RowCounter);
        title1 = (String)qqh_title1.getObject();
        numCustomers = qqh_numCustomers.getInt();
View Full Code Here

Examples of GenericDBMS.ResultSetHelper

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

Examples of GenericDBMS.ResultSetHelper

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

Examples of net.helipilot50.stocktrade.genericdbms.ResultSetHelper

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

Examples of net.helipilot50.stocktrade.genericdbms.ResultSetHelper

        RowCountCallbackHandler qq_RowCounter = new RowCountCallbackHandler() {
            protected void processRow(ResultSet pResultSet, int pRow) throws SQLException {
                if (pRow >= 1) {
                    throw new IncorrectResultSizeDataAccessException(1, pRow+1);
                }
                ResultSetHelper helper = new ResultSetHelper(pResultSet);
                qqh_title1.setObject(helper.getString(1));
                qqh_numCustomers.setInt(helper.getInt(2));
                qqh_title2.setObject(helper.getTextData(3));
                qqh_numStocks.setObject(helper.getIntegerData(4));
                qqh_title3.setObject(helper.getTextNullable(5));
                qqh_totalValue.setDouble(helper.getDouble(6));
            }
        };
        dBConnection.getTemplate().query(qq_SQL, qq_RowCounter);
        title1 = (String)qqh_title1.getObject();
        numCustomers = qqh_numCustomers.getInt();
View Full Code Here

Examples of net.helipilot50.stocktrade.genericdbms.ResultSetHelper

            //         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);
            System.out.println("Stocks:");
            while (qq_rsHelper.next()) {
                TextData temp = qq_rsHelper.getTextData(1);
                ListElement row = new ListElement();
                row.getTextValue().setValue( temp.getValue() );
                this.stockNameList.add(row);
                this.stockNames.add(temp.getValue());
                System.out.println("\t" + temp.getValue());
View Full Code Here

Examples of org.saiku.service.util.export.ResultSetHelper

  public static QueryResult convert(ResultSet rs, int limit) throws Exception {

    Integer width = 0;
    Integer height = 0;
    ResultSetHelper rsch = new ResultSetHelper();
    Cell[] header = null;
    ArrayList<Cell[]> rows = new ArrayList<Cell[]>();

    // System.out.println("DATASET");
    try {
      while (rs.next() && (limit == 0 || height < limit)) {
        if (height == 0) {
          width = rs.getMetaData().getColumnCount();
          header = new Cell[width];
          for (int s = 0; s < width; s++) {
            header[s] = new Cell(rs.getMetaData().getColumnName(s + 1), Cell.Type.COLUMN_HEADER);
          }
          if (width > 0) {
            rows.add(header);
            // System.out.println(" |");
          }
        }
        Cell[] row = new Cell[width];
        for (int i = 0; i < width; i++) {
          int colType = rs.getMetaData().getColumnType(i + 1);
          String content = rsch.getValue(rs, colType, i + 1);
          if (content == null) {
            content = "";
          }
          row[i] = new Cell(content, Cell.Type.DATA_CELL);
        }
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.