Package com.bleujin.framework.db

Examples of com.bleujin.framework.db.Rows.firstRow()


   
    assertEquals(1, rows.firstRow().getInt("no1")) ;
   
    try {
      rows = dc.getRows("select * from copy_sample where 1 = 2") ;
      rows.firstRow() ;
      fail() ;
    } catch (SQLException ignore){
     
    } catch (RepositoryException ignore){
     
View Full Code Here


    upt.addParam(1);
   
    Rows rows = upt.execQuery() ;
   
    assertEquals(1, rows.getRowCount()) ;
    assertEquals("abc", rows.firstRow().getString("b")) ;
  }
 
 
 
 
View Full Code Here

   
    int count = upts.add(cmd).add(cmd2).execUpdate() ;
    assertEquals(2, count) ;
   
    Rows rows = dc.getRows("select * from update_sample where a = 1") ;
    assertEquals("___", rows.firstRow().getString("b")) ;
  }
 
 
  public void testSimpleTransaction() throws Exception {
   
View Full Code Here

      fail() ;
    }catch(SQLException ignore){
    }
   
    Rows rows = dc.getRows("select count(*) from update_sample") ;
    assertEquals(0, rows.firstRow().getInt(1)) ;
  }
}
View Full Code Here

  String query = "select * from copy_sample" ;

  public void testFirstRow() throws Exception {
    Rows rows  = dc.getRows(query) ;
   
    Row row = rows.firstRow() ;
   
   
    assertEquals("01", row.getString(2)) ;
    assertEquals("1", row.getString(1)) ;

View Full Code Here

    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

    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

    assertEquals(1, rows.firstRow().getInt("no2")) ;
   
   
    Rows nextRows = rows.nextPageRows() ; // 2page
    assertEquals(10, nextRows.getRowCount()) ;
    assertEquals(11, nextRows.firstRow().getInt("no2")) ;
  }

 
  public void testPrePage() throws Exception {
    IUserCommand cmd = dc.createUserCommand(query1) ;
View Full Code Here

    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

    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

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.