Examples of IUserProcedure


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

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

    IUserCommand cmd = dc.createUserCommand("delete from update_sample") ;
    cmd.execUpdate() ;
  }
 
  public void testProcedureUpdate() throws Exception {
    IUserProcedure upt = dc.createUserProcedure("Sample@insertWith(?,?)") ;
    upt.addParam(1).addParam("abc") ;
   
    upt.execUpdate() ;
  }
View Full Code Here

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

  }
 
  public void testProcedureQuery() throws Exception {
    testProcedureUpdate() ;
   
    IUserProcedure upt = dc.createUserProcedure("Sample@selectBy(?)") ;
    upt.addParam(1);
   
    Rows rows = upt.execQuery() ;
   
    assertEquals(1, rows.getRowCount()) ;
    assertEquals("abc", rows.firstRow().getString("b")) ;
  }
View Full Code Here

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

 
  public void testDefault() throws Exception {
   
    // example 1
    DBController dc = DBController.getTestInstance() ;
    IUserProcedure u1 = dc.createUserProcedure("emp@add(?,?)") ;
    u1.addParam(110).addParam("bleujin") ;
    u1.execUpdate() ;

    // example
    IUserProcedure u2 = dc.createUserProcedure("emp@list()") ;
    Rows rows = u2.execQuery() ;
    while(rows.next()){
      rows.getString("name") ;
    }
  }
View Full Code Here

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

    private long execProcedureArray(int limit, String longString) throws SQLException {
        UserProcedures case1 = dc.createUserProcedures("noneBatch") ;

        long start = System.currentTimeMillis() ;
        for (int i = 0, last = limit; i < last; i++) {
            IUserProcedure upt = dc.createUserProcedure("bleujin@lobTest(?,?,?)") ;
            upt.addParam(0, i); ;
            upt.addParam(1, "abcdefg"); ;
            upt.addClob(2, longString); ;
            case1.add(upt) ;
        }
        case1.execUpdate() ;
        long end = System.currentTimeMillis() ;
        return end - start ;
View Full Code Here

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

        command.execUpdate() ;
    }

    public void xtestClobProcedure() throws Exception {
        IUserProcedure upt = dc.createUserProcedure("bleujin@lobTest2(?,?,?,?)") ;
        upt.addParam(0, 1); ;
        upt.addParam(1, "������"); ;
        upt.addClob(2, getLongString()); ;
        upt.addBlob(3, new FileInputStream("c:/temp/article.csv"));

        upt.execUpdate() ;
    }
View Full Code Here

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

    StringBuilder textString = new StringBuilder() ;
    for (int i = 0; i < 200; i++) {
      textString.append("01234567890123456789012345678901234567890123456789") ; // 10k
    }
    // insert into lob_sample(a, c) values(v_a, v_b) ;
    IUserProcedure upt = dc.createUserProcedure("Sample@insertLobWith(?,?)") ;
    upt.addParam(1).addClob(textString.toString()) ;
   
    assertEquals(1, upt.execUpdate()) ;
  }
View Full Code Here

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

        int result = batch.execUpdate() ;
        System.out.println("result="+result);
    }

    public void xtestClobBeforeProcedure() throws Exception {
        IUserProcedure upt = dc.createUserProcedure("bleujin@lobTest4(?,?,?)") ;
        upt.addParam(0, 1); ;
        upt.addParam(1, "������"); ;
        upt.addClob(2, getLongString()); ;

        upt.execUpdate() ;
    }
View Full Code Here

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

 
 
  public void testGetClob() throws Exception {
    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

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

import com.bleujin.framework.util.Debug;

public class TestThread extends DBTestCase {

  public void testSleep() throws Exception {
    IUserProcedure cmd = dc.createUserProcedure("common@sleepBy()");
    cmd.setPage(Page.create(10, 2));

    Rows rows = cmd.execQuery();
    assertEquals(10, rows.getRowCount());
    Debug.debug(rows);
  }
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.