Package com.bleujin.framework.db.procedure

Examples of com.bleujin.framework.db.procedure.IUserProcedure


   

   
    // **** impl
    public IUserProcedure createUserProcedure(String proc) {
        IUserProcedure upt = getService().createUserProcedure(this, proc);
        upt.setPage(Page.create(getLimitedRows(), 1)) ;
        return upt ;
    }
View Full Code Here


    Rows rows = dc.createUserCommand("select 1 union all select 2").execQuery() ;
    assertEquals(2, rows.getRowCount()) ;
  }
 
  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(5, rows.getRowCount()) ;
    }
 
  public void testProcedure2() throws Exception {
    IUserProcedure upt = dc.createUserProcedure("demoSp2(?,?)") ;
    upt.addParam("abcdefg" ).addParam(4) ;
   
    int rowcount = upt.execUpdate() ;
      assertEquals(1, rowcount) ;
    }
View Full Code Here

    recreate.execUpdate();
  }

  public void xtestUpdate() throws Exception {
    IUserProcedure upt = dc.createUserProcedure("temp@insertChain");
    upt.addParam("param1", 1).addParam("param2", 2);
    upt.execUpdate();
  }
View Full Code Here

        final int misecond = Integer.parseInt(String.valueOf(atask.getEnd() - atask.getStart())) ;
        final DBController dc = new DBController(atask.getDBManager()) ;
        new Thread(){
            public void run(){
                try {
                    IUserProcedure upt = dc.createUserProcedure("OnlyAdmin@addLongTimeProcedure(?,?,?)") ;
                    upt.addParam(0, procName) ;
                    upt.addParam(1, procFullName.length() > 1000 ? procFullName.substring(0, 1000) : procFullName) ;
                    upt.addParam(2, misecond) ;
                    upt.execUpdate() ;
                }
                catch(SQLException ex) {
                    ex.printStackTrace();
                }
            }
View Full Code Here

 
 
 
 
  public void testNamedProcedure() throws Exception {
    IUserProcedure upt = dc.createUserProcedure("sample@insertWith(:a, :b)") ;
    upt.addParam("a", 1) ;
    upt.addParam("b", "abc") ;
    upt.execUpdate() ;
   
    Rows rows = dc.getRows("select * from update_sample") ;
    assertEquals(1, rows.getRowCount()) ;
  }
View Full Code Here

   
    assertEquals(10, rows.getRowCount()) ;
 
 
  public void testProcedure() throws Exception {
    IUserProcedure cmd = dc.createUserProcedure("common@testBy()") ;
    cmd.setPage(Page.TEN) ;
   
    Rows rows = cmd.execQuery();
    assertEquals(10, rows.getRowCount()) ;
  }
View Full Code Here

    assertEquals(10, beans.size()) ;
  }

 
  public void testHandleBeanProcedure() throws Exception {
    IUserProcedure cmd = dc.createUserProcedure("common@testBy()") ;
    cmd.setPage(Page.TEN) ;
   
    List<TestBean> beans =  (List<TestBean>)(cmd.execQuery().toHandle(new BeanListHandler(TestBean.class))) ;
    assertEquals(10, beans.size()) ;
  }
View Full Code Here

    List<TestBean> beans =  (List<TestBean>)(cmd.execQuery().toHandle(new BeanListHandler(TestBean.class))) ;
    assertEquals(10, beans.size()) ;
  }
 
  public void test2Page() throws Exception {
    IUserProcedure cmd = dc.createUserProcedure("common@testBy()") ;
    cmd.setPage(Page.create(10, 2)) ;
   
    Rows rows = cmd.execQuery();
    assertEquals(10, rows.getRowCount()) ;
    Debug.debug(rows) ;
  }
View Full Code Here

  public void testUserProcedures() throws Exception {
    UserProcedures upts = dc.createUserProcedures("composite") ;
    IUserCommand cmd = dc.createUserCommand("select * from copy_tblc") ;
    cmd.setPage(Page.TEN) ;

    IUserProcedure upt = dc.createUserProcedure("common@testBy()") ;
    upt.setPage(Page.create(10, 2)) ;
   
    upts.add(cmd).add(upt) ;
   
    Rows rows = upts.execQuery() ;
    assertEquals(10, rows.getRowCount()) ;
View Full Code Here

TOP

Related Classes of com.bleujin.framework.db.procedure.IUserProcedure

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.