Package java.sql

Examples of java.sql.PreparedStatement.clearBatch()


        pStmt.addBatch();
        pStmt.setInt(1, 2);
        pStmt.addBatch();
        pStmt.setInt(1, 3);
        pStmt.addBatch();
        pStmt.clearBatch();
        pStmt.setInt(1, 1);
        pStmt.addBatch();
        pStmt.setInt(1, 2);
        pStmt.addBatch();
        pStmt.setInt(1, 3);
View Full Code Here


      String stateStr = "INSERT INTO DISCRETECHARSTATE(DISCRETECHARSTATE_ID, VERSION, DESCRIPTION, NOTES, PHYLOCHAR_ID, SYMBOL) VALUES(default, 0, ?, ?, ?, ?)";
      PreparedStatement stateBatch = pCon.prepareStatement(stateStr);

      for (MatrixColumnJDBC columnJDBC : columns) {

        stateBatch.clearBatch();
        DiscreteChar phyloChar = (DiscreteChar) columnJDBC.getPhyloChar();

        // Need to test: symbolChar is shared for the matrix.
        if (phyloChar.getId() == null) {
          ps.setString(1, phyloChar.getDescription()); // phylochar description
View Full Code Here

        DBManager dbm = dc.getDBManager();
    Connection conn = dbm.getConnection() ;

        long start = System.currentTimeMillis() ;
        PreparedStatement ps = conn.prepareStatement("insert into a# Select ? a,? from dual t1 Where Exists(Select 1 From copy_tblc WHere no2 = t1.dummy)");
        ps.clearBatch();
        for (int i = 0; i < MaxTryCount; i++) {
            ps.setInt(1, i);
            ps.setString(2, "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789");
            ps.addBatch();
        }
View Full Code Here

                stmtInsert.setLong(1, vmId);
                stmtInsert.addBatch();
                count++;
                if (count % 16 == 0) {
                    queryResult = stmtInsert.executeBatch();
                    stmtInsert.clearBatch();
                }
            }
            queryResult = stmtInsert.executeBatch();

            txn.commit();
View Full Code Here

                stat.setObject(4, "xxxxxxxxxxxx");
                stat.addBatch();

                if (i % 1000 == 0) {
                    stat.executeBatch();
                    stat.clearBatch();
                }
            }
            stat.executeBatch();
            conn.commit();
        } catch (Exception ex) {
View Full Code Here

                stmtInsert.setLong(1, vmId);
                stmtInsert.addBatch();
                count++;
                if (count % 16 ==0) {
                    queryResult = stmtInsert.executeBatch();
                    stmtInsert.clearBatch();
                }
            }
            queryResult = stmtInsert.executeBatch();
           
            txn.commit();
View Full Code Here

          count++;
        }

        if (count > BATCH_SIZE) {
          ps.executeBatch();
          ps.clearBatch();
          count = 0;
        }
      }
      if (count > 0) {
        ps.executeBatch();
View Full Code Here

          count = 0;
        }
      }
      if (count > 0) {
        ps.executeBatch();
        ps.clearBatch();
      }
      ps.close();
      if (autoCommit) {
        commit();
      }
View Full Code Here

          count++;
        }
 
        if (count > BATCH_SIZE) {
          ps.executeBatch();
          ps.clearBatch();
          count = 0;
        }
      }
      if (count > 0) {
        ps.executeBatch();
View Full Code Here

          count = 0;
        }
      }
      if (count > 0) {
        ps.executeBatch();
        ps.clearBatch();
      }
      ps.close();

      if (autoCommit) {
        commit();
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.