Package com.bleujin.framework.db.procedure

Examples of com.bleujin.framework.db.procedure.IUserCommand.addParam()


    for (int i = 0, last = 100; i < last; i++) {
      tenKtext.append(str) ;
        }
   
    IUserCommand cmd = dc.createUserCommand("insert into framework_test_lob(a, b) values(?,?)") ;
    cmd.addParam(1).addClob(tenKtext.toString()) ;
   
    int rowcount = cmd.execUpdate() ;
    assertEquals(1, rowcount) ;
  }
 
View Full Code Here


    plan.printPlan(System.out) ;
  }
 
  public void testLimit() throws Exception {
    IUserCommand cmd = dc.createUserCommand("select * from millon_tblt limit ?,?") ;
    cmd.addParam(10).addParam(2) ;
    MySQLUserCommandPlan plan = new MySQLUserCommandPlan(dc, cmd) ;
   
    plan.printPlan(System.out) ;
  }
 
View Full Code Here

    assertEquals(10, rows.getRowCount()) ;
  }
 
  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

public class TestUserCommand extends MySQLMother {

  public void testParameter() throws Exception {
    IUserCommand cmd = dc.createUserCommand("select * from millon_tblt limit ?");
    cmd.addParam(10) ;

    Debug.debug(cmd) ;
    Debug.debug(cmd.execQuery().firstRow());
  }
}
View Full Code Here

   * EmptyQueryable, TimeOutQuery, XAUserProcedure�� �̰͵��� �ٸ� Queryable�� ���� �ϳ��� Ʈ��������� ó���ɼ� ���� ������
   */
 
  public void testFirst() throws Exception {
    IUserCommand ins = dc.createUserCommand("insert into update_sample values(?,?)") ;
    ins.addParam(1).addParam("abc") ;
   
    IUserCommand sel = dc.createUserCommand("select * from update_sample") ;
   
    CombinedUserProcedures upts = dc.createCombinedUserProcedures("combined") ;
   
View Full Code Here

  }

 
  public void testSecond() throws Exception {
    IUserCommand ins = dc.createUserCommand("insert into update_sample values(?,?)") ;
    ins.addParam(1).addParam("abc") ;
   
    IUserCommand sel = dc.createUserCommand("select * from update_sample") ;


    IUserCommand del = dc.createUserCommand("delete from update_sample where a = ?") ;
View Full Code Here

   
    IUserCommand sel = dc.createUserCommand("select * from update_sample") ;


    IUserCommand del = dc.createUserCommand("delete from update_sample where a = ?") ;
    del.addParam(1) ;
   
    CombinedUserProcedures upts = dc.createCombinedUserProcedures("combined") ;
   
    upts.add(ins, "ins", IQueryable.UPDATE_COMMAND)
      .add(sel, "sel", IQueryable.QUERY_COMMAND)
View Full Code Here

 
  public void testInsert() throws Exception {
    dc.createUserCommand("truncate table lob_sample") ;
    IUserCommand cmd = dc.createUserCommand("insert into lob_sample(a, b, c, d, e) values(:a, :b, :c, :d, :e)") ;
    cmd.addParam("a", 1) ;
    cmd.addClob("b", "abcdefg") ;
    cmd.addClob("c", FileUtils.readFileToString(k100File, "UTF-8")) ;
    cmd.addBlob("d", new FileInputStream(k100File)) ;
    cmd.addParam("e", "12345") ;
    int result = cmd.execUpdate() ;
View Full Code Here

    IUserCommand cmd = dc.createUserCommand("insert into lob_sample(a, b, c, d, e) values(:a, :b, :c, :d, :e)") ;
    cmd.addParam("a", 1) ;
    cmd.addClob("b", "abcdefg") ;
    cmd.addClob("c", FileUtils.readFileToString(k100File, "UTF-8")) ;
    cmd.addBlob("d", new FileInputStream(k100File)) ;
    cmd.addParam("e", "12345") ;
    int result = cmd.execUpdate() ;
   
    assertEquals(1, result) ;
   
    Rows rows = dc.getRows("select a, b, c, d, e from lob_sample where a = 1") ;
View Full Code Here

    dc.execUpdate("truncate table performance_sample") ;
  }
 
  public void testNamedParameter() throws Exception {
    IUserCommand cmd = dc.createUserCommand("select * from copy_sample where no1 >= :no1 and no1 <= :no1") ;
    cmd.addParam("no1", 20) ;
   
    Rows rows = cmd.execQuery() ;
    assertEquals(1, rows.getRowCount()) ;
 
  }
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.