Package java.sql

Examples of java.sql.Statement.addBatch()


    stat.execute(DruidParserTestUtil.SEED[1]);
    TEST_UTIL.waitTableAvailable(Bytes.toBytes("Photo"));

    conn.setAutoCommit(false);
    Statement stat = conn.createStatement();
    stat.addBatch("Insert into User(user_id,name) values(1,'testTransaction');");
    stat.addBatch("Insert into Photo(user_id,photo_id,tag) values(1,1,'tag');");
    int[] ret = stat.executeBatch();
    conn.commit();
    int successNum = 0;
    for (int i : ret) {
View Full Code Here


    TEST_UTIL.waitTableAvailable(Bytes.toBytes("Photo"));

    conn.setAutoCommit(false);
    Statement stat = conn.createStatement();
    stat.addBatch("Insert into User(user_id,name) values(1,'testTransaction');");
    stat.addBatch("Insert into Photo(user_id,photo_id,tag) values(1,1,'tag');");
    int[] ret = stat.executeBatch();
    conn.commit();
    int successNum = 0;
    for (int i : ret) {
      if(i == 1) successNum++;
View Full Code Here

          {
            String sql = dialect.getDropForeignKeyConstraintSQL(constraint);
           
            this.logger.log(Level.DEBUG, sql);
           
            statement.addBatch(sql);
          }
        }
        statement.executeBatch();
      }
      finally
View Full Code Here

          {
            String sql = dialect.getCreateForeignKeyConstraintSQL(constraint);
           
            this.logger.log(Level.DEBUG, sql);
           
            statement.addBatch(sql);
          }
        }
       
        statement.executeBatch();
      }
View Full Code Here

          {
            String sql = support.getAlterSequenceSQL(sequence, sequenceMap.get(sequence) + 1);
           
            this.logger.log(Level.DEBUG, sql);
           
            targetStatement.addBatch(sql);
          }
         
          targetStatement.executeBatch();
        }
        finally
View Full Code Here

                 
                  if (alterSQL != null)
                  {
                    this.logger.log(Level.DEBUG, alterSQL);
                   
                    targetStatement.addBatch(alterSQL);
                  }
                }
               
                targetStatement.executeBatch();
              }
View Full Code Here

          {
            String sql = dialect.getDropUniqueConstraintSQL(constraint);
           
            this.logger.log(Level.DEBUG, sql);
           
            statement.addBatch(sql);
          }
        }
       
        statement.executeBatch();
      }
View Full Code Here

          {
            String sql = dialect.getCreateUniqueConstraintSQL(constraint);
           
            this.logger.log(Level.DEBUG, sql);
           
            statement.addBatch(sql);
          }
        }
       
        statement.executeBatch();
      }
View Full Code Here

         scr = scr.replace(PASSWORD_TEMPLATE, dbPassword);

         String s = JDBCUtils.cleanWhitespaces(scr.trim());
         if (s.length() > 0)
         {
            statement.addBatch(s);
         }
      }
      statement.executeBatch();
   }
View Full Code Here

         scr = scr.replace(PASSWORD_TEMPLATE, dbPassword);

         String s = cleanWhitespaces(scr.trim());
         if (s.length() > 0)
         {
            statement.addBatch(s);
         }
      }
      statement.executeBatch();
   }
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.