Package com.bleujin.framework.db.procedure

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


    assertEquals(1, count) ;
   
   
    IUserCommand cmd2 = dc.createUserCommand("insert into update_sample values(?, ?)") ;
    cmd2.addParam(0, 2) // start index is 0...
    cmd2.addParam(1, "bcd") ;
    count = cmd2.execUpdate() ;
    assertEquals(1, count) ;
  }

 
View Full Code Here


 
  public void testUserProcedures() throws Exception {
    UserProcedures upts = dc.createUserProcedures("One Transaction") ;
   
    IUserCommand cmd = dc.createUserCommand("insert into update_sample values(?, ?)") ;
    cmd.addParam(1).addParam("abc") ;
   
    IUserCommand cmd2 = dc.createUserCommand("update update_sample set b = ? where a = ?") ;
    cmd2.addParam("___").addParam(1) // unique index exception
   
    int count = upts.add(cmd).add(cmd2).execUpdate() ;
View Full Code Here

   
    IUserCommand cmd = dc.createUserCommand("insert into update_sample values(?, ?)") ;
    cmd.addParam(1).addParam("abc") ;
   
    IUserCommand cmd2 = dc.createUserCommand("update update_sample set b = ? where a = ?") ;
    cmd2.addParam("___").addParam(1) // unique index exception
   
    int count = upts.add(cmd).add(cmd2).execUpdate() ;
    assertEquals(2, count) ;
   
    Rows rows = dc.getRows("select * from update_sample where a = 1") ;
View Full Code Here

  public void testSimpleTransaction() throws Exception {
   
    UserProcedures upts = dc.createUserProcedures("One Transaction") ;
   
    IUserCommand cmd = dc.createUserCommand("insert into update_sample values(?, ?)") ;
    cmd.addParam(1).addParam("abc") ;
   
    IUserCommand cmd2 = dc.createUserCommand("insert into update_sample values(?, ?)") ;
    cmd.addParam(1).addParam("abc") // unique index exception
   
    upts.add(cmd).add(cmd2) ;
View Full Code Here

        UserProcedures case1 = dc.createUserProcedures("noneBatch") ;

        long start = System.currentTimeMillis() ;
        for (int i = 0, last = limit; i < last; i++) {
            IUserCommand command = dc.createUserCommand("insert into BLEU## values(?,?,?)") ;
            command.addParam(0, i); ;
            command.addParam(1, "abcdefg"); ;
            command.addClob(2, longString); ;
            case1.add(command) ;
        }
        case1.execUpdate() ;
View Full Code Here

        long start = System.currentTimeMillis() ;
        for (int i = 0, last = limit; i < last; i++) {
            IUserCommand command = dc.createUserCommand("insert into BLEU## values(?,?,?)") ;
            command.addParam(0, i); ;
            command.addParam(1, "abcdefg"); ;
            command.addClob(2, longString); ;
            case1.add(command) ;
        }
        case1.execUpdate() ;
        long end = System.currentTimeMillis() ;
View Full Code Here

    }


    public void xtestClobInsert() throws Exception {
        IUserCommand command = dc.createUserCommand("insert into aaa## values(?,?,?,?)") ;
        command.addParam(0, 1); ;
        command.addParam(1, "��������"); ;
        command.addClob(2, getLongString()); ;
        command.addBlob(3, new FileInputStream("c:/temp/article.csv"));

        command.execUpdate() ;
View Full Code Here


    public void xtestClobInsert() throws Exception {
        IUserCommand command = dc.createUserCommand("insert into aaa## values(?,?,?,?)") ;
        command.addParam(0, 1); ;
        command.addParam(1, "��������"); ;
        command.addClob(2, getLongString()); ;
        command.addBlob(3, new FileInputStream("c:/temp/article.csv"));

        command.execUpdate() ;
    }
View Full Code Here

   
    StopWatch sw = new StopWatch() ;
    sw.start() ;
    for (int i = 0; i < unitCount; i++) {
      IUserCommand cmd = dc.createUserCommand("insert into performance_sample(a, b, c) values(?, ?, ?)") ;
      cmd.addParam(0, unitCount + i) ;
      cmd.addParam(1, "No." + (unitCount + i) + ".....") ;
      cmd.addParam(2, RandomUtil.nextRandomString(RandomUtil.nextRandomInt(10, 50), RandomUtil.NUMBER_CHAR_TYPE)) ;
      cmd.execUpdate() ;
    }
    Debug.debug(sw.getTime()) ;
View Full Code Here

    StopWatch sw = new StopWatch() ;
    sw.start() ;
    for (int i = 0; i < unitCount; i++) {
      IUserCommand cmd = dc.createUserCommand("insert into performance_sample(a, b, c) values(?, ?, ?)") ;
      cmd.addParam(0, unitCount + i) ;
      cmd.addParam(1, "No." + (unitCount + i) + ".....") ;
      cmd.addParam(2, RandomUtil.nextRandomString(RandomUtil.nextRandomInt(10, 50), RandomUtil.NUMBER_CHAR_TYPE)) ;
      cmd.execUpdate() ;
    }
    Debug.debug(sw.getTime()) ;
    assertEquals(true, unitCount * 50 > sw.getTime()) ;
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.