Package com.bleujin.framework.db.procedure

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


        upt.execUpdate() ;
    }


    public void xtestBlobInsertBatch() throws Exception {
        IUserCommandBatch command = dc.createUserCommandBatch("insert into aaa## values(?,?,?,?)") ;
        command.addParam(0, new int[]{1,2,3}); ;
        command.addParamSize(1, "abcdefg", 3); ;
        command.addClobSize(2, getLongString(), 3);
        command.addBlobSize(3, "c:/temp/article.csv", 3);

        int result = command.execUpdate() ;
    }
View Full Code Here


    int batchCount = 3 ; // 10000 * 10 = 100,000
   
    StopWatch sw = new StopWatch() ;
    sw.start() ;
    for (int k = 0; k < batchCount; k++) {
      IUserCommandBatch cmd = dc.createUserCommandBatch("insert into performance_sample(a, b, c) values(?, ?, ?)") ;
      for (int i = 0; i < unitCount; i++) {
        cmd.addBatchParam(0, k * unitCount + i) ;
        cmd.addBatchParam(1, "No." + (k * unitCount + i) + ".....") ;
        cmd.addBatchParam(2, RandomUtil.nextRandomString(RandomUtil.nextRandomInt(10, 50), RandomUtil.NUMBER_CHAR_TYPE)) ;
      }
      cmd.execUpdate() ;
      cmd.clearParam() ;
      assertEquals(true, unitCount > sw.getTime()) ;
      sw.stop() ;
      sw.reset() ;
      sw.start() ;
    }
View Full Code Here

    dc.execUpdate("create table millon_tblt(no int primary key auto_increment, subject varchar(400), content text)") ;
    //dc.execUpdate("create unique index millon_pk on millon_tblt(no)") ;
  }
 
  public void insertBatch() throws Exception {
    IUserCommandBatch batch = dc.createUserCommandBatch("insert into millon_tblt(subject) values(?)") ;
   
    for (int k = 0; k < 5; k++) {
      for (int i = 0; i < 50000; i++) {
        // 10000 -> 4.1 sec
        // 100000 -> 33.547 sec
        batch.addBatchParam(0, i + " Batch ..............................................................................................................") ;
      }
      Debug.line() ;
      batch.execUpdate() ;
      batch.clearParam() ;
    }
  }
View Full Code Here

    StopWatch watch = new StopWatch();
    watch.start();
    int iMax = 100;
    int jMax = 5000;
    for (int i = 0; i < iMax; i++) {
      IUserCommandBatch batch = dc.createUserCommandBatch("insert into test values(?,?)");

      int[] a = new int[jMax];
      String[] b = new String[jMax];
      for (int j = 0; j < jMax; j++) {
        a[j] = j + i * iMax + aMax + 1;
        b[j] = "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789:" + j;
      }
      batch.addParam(a).addParam(b);

      batch.execUpdate();
    }
    watch.stop();
    System.out.println("time(ms):" + watch.getTime());
  }
View Full Code Here

    dc.initSelf() ;
   
    String query = "insert into node_tblc#(uuid, ntid, name, explain, status, viewcount, reguserid, parentid, versionnum) " +
    "values(?,?,?,?,?, ?,?,?,?)" ;

    IUserCommandBatch batch = dc.createUserCommandBatch(query) ;
    int max = 1000 ;

    for (int i = 0; i < max; i++) {
      batch.addBatchParam(0, RandomUtil.nextRandomString(35, RandomUtil.DOWNCASE_CHAR_TYPE)) ;
      batch.addBatchParam(1, RandomUtil.nextRandomString(10, RandomUtil.DOWNCASE_CHAR_TYPE)) ;
      batch.addBatchParam(2, RandomUtil.nextRandomString(10, RandomUtil.DOWNCASE_CHAR_TYPE)) ;
      batch.addBatchParam(3, RandomUtil.nextRandomString(20, RandomUtil.DOWNCASE_CHAR_TYPE)) ;
      batch.addBatchParam(4, "NORMAL") ;
      batch.addBatchParam(5, RandomUtil.nextInt()) ;
      batch.addBatchParam(6, RandomUtil.nextRandomString(12, RandomUtil.DOWNCASE_CHAR_TYPE)) ;
      batch.addBatchParam(7, RandomUtil.nextRandomString(10, RandomUtil.DOWNCASE_CHAR_TYPE)) ;
      batch.addBatchParam(8, RandomUtil.nextInt()) ;
    }
    batch.execUpdate() ;
    dc.destroySelf() ;
  }
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.