Package com.bleujin.framework.db

Examples of com.bleujin.framework.db.Rows


      Connection conn = getConnection() ;
      long start = System.currentTimeMillis();
        conn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);

        //
      Rows rows = myQuery(conn) ;

      long end = System.currentTimeMillis();
      getDBManager().freeConnection(conn) ;
      getDBController().handleServant(start, end, this, IQueryable.QUERY_COMMAND);
      return rows ;
View Full Code Here


 
  public void testProcedure() throws Exception {
    IUserProcedure upt = dc.createUserProcedure("framework_test_select()") ;
    upt.setPage(Page.create(5, 1)) ;
   
    Rows rows = upt.execQuery() ;
    while(rows.next()){
      Debug.debug(rows.getString(1)) ;
    }
      assertEquals(5, rows.getRowCount()) ;
    }
View Full Code Here

    assertEquals(1, rowcount) ;
  }
 
 
  public void testRowCount() throws Exception {
      Rows rows = dc.createUserCommand("select * from copy_tblc where 1 = 2").execQuery() ;
      assertEquals(0, rows.getRowCount()) ;
    }
View Full Code Here

public class TestPage extends MySQLMother{

  public void testPage() throws Exception {
    final IUserCommand cmd = dc.createUserCommand("select * from millon_tblt") ;
    cmd.setPage(Page.TEN) ;
    Rows rows = cmd.execQuery();
   
    assertEquals(10, rows.getRowCount()) ;
  }
View Full Code Here

  }
 
  public void testLimit() throws Exception {
    final IUserCommand cmd = dc.createUserCommand("select * from millon_tblt limit ?,?") ;
    cmd.addParam(10).addParam(10) ;
    Rows rows = cmd.execQuery();
   
    assertEquals(10, rows.getRowCount()) ;
  }
View Full Code Here

    }

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

        try {
//            ((OracleConnection) conn).setStmtCacheSize(40); // Set the Statement cache size to 40
//            ((OracleConnection) conn).setStatementCacheSize(40); // Set the Statement cache size to 40
//            ((OracleConnection) conn).setImplicitCachingEnabled(true); // Set the Statement cache size to 40
View Full Code Here

    dc.initSelf() ;
   
    dc.createUserCommand("create table if not exists test(a int, b varchar(20))").execUpdate() ;
    dc.createUserCommand("insert into test values(1, 'BlaBla')").execUpdate() ;
   
    Rows rows = dc.createUserCommand("select * from test" ).execQuery() ;
    Debug.debug(rows) ;
   
    dc.destroySelf() ;
  }
View Full Code Here

public class TestH2ChainProcedure extends TestCaseH2 {

  public void xtestBatch() throws Exception {

    FakeUserCommand stmt = new FakeUserCommand(dbm.getConnection(), "select count(*) from uri");
    Rows rows = stmt.execQuery();
    rows.next();

    System.out.println("count:" + rows.getInt(1));
  }
View Full Code Here

    dc.execUpdate("create procedure framework_test_select() begin select * from copy_tblc; end//");
  }
 
 
  public void testCommand() throws Exception {
    Rows rows = dc.createUserCommand("select 1 union all select 2").execQuery() ;
    assertEquals(2, rows.getRowCount()) ;
  }
View Full Code Here

  }


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

    try {
      pstmt = conn.prepareStatement(getStmtSQL(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
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.