Package com.bleujin.framework.db

Examples of com.bleujin.framework.db.Rows


 
  public void testDate() throws Exception {
    String query = "select now() day" ;
    // select a, b, sysdate day from update_sample where a = v_a ;
    Rows rows = dc.createUserProcedure("Sample@selectEmpBy()").execQuery() ;
   
    rows.next() ;
    Date d = rows.getDate("hiredate") ;
   

    assertEquals(17, d.getDate()) ; // smith
  }
View Full Code Here


    testSetClob() ;

    IUserProcedure upt = dc.createUserProcedure("Sample@selectLobBy(:a)") ;
    upt.addParam("a", 1);
   
    Rows rows = upt.execQuery();
    assertEquals(true, rows.firstRow().getString("c").length() > 9000) ;

    dc.execUpdate("delete from lob_sample") ;
  }
View Full Code Here

 
  public void testDefaultLimit() throws Exception {
    dc.setLimitedRows(20) ;
    IUserCommand cmd = dc.createUserCommand(query1) ;
   
    Rows rows = cmd.execQuery() ;
    assertEquals(20, rows.getRowCount()) ;

    rows.absolute(20) ;
    assertEquals(20, rows.getInt("no2")) ;
  }
View Full Code Here

 
  public void testNextPage() throws Exception {
    IUserCommand cmd = dc.createUserCommand(query1) ;
    cmd.setPage(Page.create(10, 1))
   
    Rows rows = cmd.execQuery() ; // 1page
    assertEquals(10, rows.getRowCount()) ;
    assertEquals(1, rows.firstRow().getInt("no2")) ;
   
   
    Rows nextRows = rows.nextPageRows() ; // 2page
    assertEquals(10, nextRows.getRowCount()) ;
    assertEquals(11, nextRows.firstRow().getInt("no2")) ;
  }
View Full Code Here

 
  public void testPrePage() throws Exception {
    IUserCommand cmd = dc.createUserCommand(query1) ;
    cmd.setPage(Page.create(10, 2)) // 2page
   
    Rows rows = cmd.execQuery() ;
    assertEquals(10, rows.getRowCount()) ;
    assertEquals(11, rows.firstRow().getInt("no2")) ;
   
   
    Rows preRows = rows.prePageRows() // 1page
    assertEquals(10, preRows.getRowCount()) ;
    assertEquals(1, preRows.firstRow().getInt("no2")) ;
  }
View Full Code Here

import com.bleujin.framework.db.procedure.IUserCommand;

public class TestFirst extends MSSQLTestMother{

  public void testConnect2005Express() throws Exception {
    Rows rows = dc.getRows("select 1") ;
   
    assertEquals(1, rows.getRowCount()) ;
  }
View Full Code Here

    assertEquals(1, rows.getRowCount()) ;
  }

 
  public void testRows() throws Exception {
    Rows rows = dc.getRows("select * from copy_tblc", 3, 1) ;
    assertEquals(3, rows.getRowCount()) ;
   
    assertEquals(3, rows.nextPageRows().getRowCount()) ;
  }
View Full Code Here

  public void testPlan() throws Exception {
    CombinedUserProcedures upts  = new CombinedUserProcedures(dc, "plan_view") ;
   
   
    Rows rows = dc.getRows("sp_who") ;
    Debug.debug(rows) ;
  }
View Full Code Here

    IUserProcedure upt = dc.createUserProcedure("framework@viewPlan(?)") ;
    upt.setPage(Page.create(3, 1)) ;
    upt.addParam("select") ;
   
   
    Rows rows = dc.getRows(upt) ;
    Debug.debug(rows) ;
  }
View Full Code Here

   */
  public void testDCInit() throws Exception {
    DBController newDc = new DBController("newDC", dc.getDBManager()) ;
    newDc.initSelf() ;
   
    Rows rows = newDc.getRows("select 1 from copy_sample") ;
    newDc.destroySelf() ;

    assertEquals(1, rows.firstRow().getInt(1)) ;
  }
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.