Package com.bleujin.framework.db

Examples of com.bleujin.framework.db.Rows


            if (query_type == UPDATE_COMMAND){
                int updateRow = query.myUpdate(conn);
                resultMap.put(name, new Integer(updateRow)) ;
            } else if (query_type == QUERY_COMMAND) {
                Rows rows = query.myQuery(conn) ;
                resultMap.put(name, rows) ;
            } else {
              throw new IllegalArgumentException(query_type + " is not defined type\n" + query) ;
            }
        }
View Full Code Here


            }

            rs = pstmt.executeQuery();
            // rs.setFetchSize(DEFAULT_FETCHSIZE);

            Rows result = populate(rs) ;

            return result;
        } catch (SQLException ex) {
            throw new SQLException(getExceptionMessage(ex, this), ex.getSQLState(), ex.getErrorCode());
        } finally {
View Full Code Here

        return this.cstmt ;
    }

    @Override
    protected Rows myQuery(Connection conn) throws SQLException{
        Rows result = null ;
        ResultSet rs = null ;

        try {
            cstmt = ( OracleCallableStatement )conn.prepareCall( "{? = call " + getProcedureSQL() + "}", ResultSet.TYPE_SCROLL_INSENSITIVE,  ResultSet.CONCUR_READ_ONLY );
            cstmt.setMaxRows(getMaxRows());
View Full Code Here

    public Data getRows(final IQueryable query) {
        final FutureData future = new FutureData(query) ;
        new Thread() {
            public void run(){
                try{
                    Rows rows = query.execQuery() ;
                    RealData realdata = new RealData(query, rows) ;
                    future.setRealData(realdata);
                } catch(Exception ex){
                    future.setException(ex) ;
                }
View Full Code Here

  private void setCurrentQuery(IQueryable query) {
    this.currQuery = query;
  }

  protected Rows myQuery(Connection conn) throws SQLException {
    Rows result = null;
    Rows nextRows = null;
    for (int i = 0; i < querys.size(); i++) {
      Queryable query = getQuery(i);
      setCurrentQuery(query);
      if (i == 0) {
        result = query.myQuery(conn);
        nextRows = result;
      } else {
        nextRows = nextRows.setNextRows(query.myQuery(conn));
      }
    }
    return result;
  }
View Full Code Here

    this.dc = new DBController(dc.getDBManager()) ; // none servant
    this.cmd = cmd ;
  }

  public void printPlan(OutputStream output) throws SQLException {
    Rows rows = execQuery();
   
    PrintWriter writer = new PrintWriter(new OutputStreamWriter(output)) ;
    while(rows.next()) {
      writer.printf("%s", rows.getString("query_plan")) ;
      writer.println() ;
    }
    writer.flush() ;
    writer.close() ;
  }
View Full Code Here

 
  public void testRowsPage() throws Exception {
    String query = "select * from copy_sample" ;
    // listNum = 1 -> count per page
    // No = 1      -> page no
    Rows rows = dc.getRows(query, 1, 1) ;
    assertEquals(1, rows.getRowCount()) ;
  }
View Full Code Here

  public void testRowsPageMethod2() throws Exception {
    String query = "select * from copy_sample" ;
   
    IUserCommand cmd = dc.createUserCommand(query) ;
    cmd.setPage(Page.create(1, 1)) ;
    Rows rows = cmd.execQuery() ;
    assertEquals(1, rows.getRowCount()) ;
  }
View Full Code Here

        return cstmt ;
    }

    @Override
    protected Rows myQuery(Connection conn) throws SQLException{
        Rows result = null ;
        ResultSet rs = null ;

        try {
            cstmt = conn.prepareCall( "{ call " + getProcedureSQL() + "}", ResultSet.TYPE_SCROLL_INSENSITIVE,  ResultSet.CONCUR_READ_ONLY );
            cstmt.setMaxRows(getMaxRows()) ;
View Full Code Here

            }

            rs = pstmt.executeQuery();
            // rs.setFetchSize(DEFAULT_FETCHSIZE);

            Rows result = populate(rs) ;

            return result;
        } catch (SQLException ex) {
            throw new SQLException(getExceptionMessage(ex, this), ex.getSQLState(), ex.getErrorCode());
        } finally {
View Full Code Here

TOP

Related Classes of com.bleujin.framework.db.Rows

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.