Package com.bleujin.framework.db.procedure

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


    dc.execUpdate("drop table if exists copy_tblc") ;
    dc.execUpdate("create table copy_tblc(no1 varchar(4), no2 integer)") ;
    dc.execUpdate("alter table copy_tblc add primary key (no2)") ;
    dc.execUpdate("create unique index copy_idx on copy_tblc(no1)") ;
   
    IUserCommandBatch b = dc.createUserCommandBatch("insert into copy_tblc values(?, ?)") ;
   
    for(int i = 1 ; i <= 99 ; i++){
      b.addBatchParam(0, StringUtil.leftPad(i + "", 2, '0')) ;
      b.addBatchParam(1, i) ;
    }
   
    int result = b.execUpdate() ;
    Debug.debug(result);
  }
View Full Code Here


  }
 
 
  public void testBatch() throws Exception {
   
    IUserCommandBatch cmd = dc.createUserCommandBatch("insert into performance_sample(a, b, c) values(?, ?, ?)") ;
    for (int i = 0; i < 10; i++) {
      cmd.addBatchParam(0, i) ;
      cmd.addBatchParam(1, "No." + i + ".....") ;
      cmd.addBatchParam(2, RandomUtil.nextRandomString(RandomUtil.nextRandomInt(10, 50), RandomUtil.NUMBER_CHAR_TYPE)) ;
    }
 
    cmd.execUpdate() ;
  }
View Full Code Here

    cmd.execUpdate() ;
  }
 
  public void testNamedBatch() throws Exception {
   
    IUserCommandBatch cmd = dc.createUserCommandBatch("insert into performance_sample(a, b, c) values(:a, :b, :c)") ;
    for (int i = 0; i < 10; i++) {
      cmd.addBatchParam("a", i) ;
      cmd.addBatchParam("b", "No." + i + ".....") ;
      cmd.addBatchParam("c", RandomUtil.nextRandomString(RandomUtil.nextRandomInt(10, 50), RandomUtil.NUMBER_CHAR_TYPE)) ;
    }
   
    cmd.execUpdate() ;
  }
View Full Code Here

   * ��������� 10���Ǵ����� ��ġ ó���� ������ �� 10���� insert�� 1-3�� ������ �Ҹ�ȴ�.
   * P4_UserProcedurs���� �����ϴ� UserProcedures�� �⺻������ MDL���� �ٸ� �͵��� �ѹ��� �����Ҷ� ����Ѵ�.
   */
 
  public void testBatchDefault() throws Exception {
    IUserCommandBatch cmd = dc.createUserCommandBatch("insert into update_sample values(?, ?)") ;
   
    int max = 10 ;
    for (int i = 0; i < max; i++) {
      cmd.addBatchParam(0, i) ;
      cmd.addBatchParam(1, i + "th ..") ;
    }
   
    int count = cmd.execUpdate() ;
    assertEquals(max, count) ;
    cmd.clearParam() ; // param ojbect resource ��ȯ
  }
View Full Code Here

    cmd.clearParam() ; // param ojbect resource ��ȯ
  }
 

  public void testAddParamCase1() throws Exception {
    IUserCommandBatch cmd = dc.createUserCommandBatch("insert into update_sample values(?, ?)") ;
   
    int max = 10 ;
    int[] a = new int[max];
    String[] b = new String[max] ;
    for (int i = 0; i < max; i++) {
      a[i] = i ;
      b[i] = i + "th .." ;
    }
    cmd.addParam(a).addParam(b) ;
    int count = cmd.execUpdate() ;
    assertEquals(max, count) ;
  }
View Full Code Here

    assertEquals(max, count) ;
  }
 

  public void testAddParamCase2() throws Exception {
    IUserCommandBatch cmd = dc.createUserCommandBatch("insert into update_sample values(?, ?)") ;
   
    int max = 10 ;
    int[] a = new int[max];
    String[] b = new String[max] ;
    for (int i = 0; i < max; i++) {
      a[i] = i ;
      b[i] = i + "th .." ;
    }
   
    cmd.addParam(0, a) ;
    cmd.addParam(1, b) ;
    int count = cmd.execUpdate() ;
    assertEquals(max, count) ;
  }
View Full Code Here

    assertEquals(max, count) ;
  }

 
  public void testAddParamCase3() throws Exception {
    IUserCommandBatch cmd = dc.createUserCommandBatch("insert into update_sample values(?, ?)") ;
   
    int max = 10 ;
    int[] a = new int[max];
    for (int i = 0; i < max; i++) {
      a[i] = i ;
    }
   
    cmd.addParam(0, a) ;
    cmd.addParamSize(1, "SameValue", max) // SameValue * max
    int count = cmd.execUpdate() ;
    assertEquals(max, count) ;
  }
View Full Code Here

    assertEquals(max, count) ;
  }

 
  public void testTransaction() throws Exception {
    IUserCommandBatch cmd = dc.createUserCommandBatch("insert into update_sample values(?, ?)") ;

    int max = 10 ;
    int[] a = new int[max];
    String[] b = new String[max] ;
    for (int i = 0; i < max; i++) {
      a[i] = i ;
      b[i] = i + "th .." ;
    }
    b[max-1] = "01234567890123546789" ; // over maxLength
   
   
    cmd.addParam(a).addParam(b) ;
   
    try {
      cmd.execUpdate() ;
      fail() ;
    } catch(SQLException ignore){
     
    }
View Full Code Here

        for (int i = 0, last = limit; i < last; i++) {
            a[i] = i ;
            b[i] = "abcdefg" ;
            c[i] = longString ;
        }
        IUserCommandBatch case2 = dc.createUserCommandBatch("insert into BLEU## values(?,?,?)") ;
        case2.addParam(0, a); ;
        case2.addParam(1, b); ;
        case2.addClob(2, c); ;
        case2.execUpdate() ;

        long end = System.currentTimeMillis() ;
        return end - start ;

    }
View Full Code Here

        upt.execUpdate() ;
    }

    public void xtestClobInsertBatch() throws Exception {
        IUserCommandBatch command = dc.createUserCommandBatch("insert into BLEU## values(?,?,?)") ;
        command.addParam(0, new int[]{1,2,3}); ;
        command.addParamSize(1, "abcdefg", 3); ;
        command.addClobSize(2, getLongString(), 3); ;

        command.execUpdate() ;
    }
View Full Code Here

TOP

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

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.