Package java.sql

Examples of java.sql.PreparedStatement.executeBatch()


          ps.setInt(1, i%2);
            ps.setString(2, "Tuple " +i);
            ps.setString(3, "any value");
            ps.addBatch();
        }
        ps.executeBatch();

    s.execute("call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1)");
   
    //Executing the query below and looking at it's plan will show that
    //we picked index T2I1 rather than T2I2 because there are no
View Full Code Here


          }
          i++;
        }
        prep.addBatch();
        conn.setAutoCommit(false);
        prep.executeBatch();
        conn.commit();
        prep.close();
        prep = null;
      } catch (Throwable e) {
        if (!omitErrorLogs) {
View Full Code Here

      dataStmt.setInt(3, relLoc.getBlockZ());
      dataStmt.setString(4, block.getType().toString());
      dataStmt.setShort(5, block.getData().toItemStack().getDurability());
      dataStmt.addBatch();
      if (++changed % batchSize == 0) {
        dataStmt.executeBatch();
      }
    }
    dataStmt.executeBatch(); // insert remaining records
    databaseConnection.commit();
    databaseConnection.setAutoCommit(true);
View Full Code Here

      dataStmt.addBatch();
      if (++changed % batchSize == 0) {
        dataStmt.executeBatch();
      }
    }
    dataStmt.executeBatch(); // insert remaining records
    databaseConnection.commit();
    databaseConnection.setAutoCommit(true);
    dataStmt.close();
    return changed;
  }
View Full Code Here

          }
         
          dataStmt.addBatch();
         
          if (++changed % batchSize == 0) {
            dataStmt.executeBatch();
            if ((System.currentTimeMillis() - startTime) >= 5000L) {
              String seconds = new DecimalFormat("#0.00").format((double) (System.currentTimeMillis() - startTime) / 1000.0D);
              War.war.getLogger().log(Level.FINE, "Still saving warzone {0} , {1} seconds elapsed.", new Object[] {zoneName, seconds});
            }
          }
View Full Code Here

            }
          }
        }
      }
    }
    dataStmt.executeBatch(); // insert remaining records
    databaseConnection.commit();
    dataStmt.close();
    databaseConnection.close();
    String seconds = new DecimalFormat("#0.00").format((double) (System.currentTimeMillis() - startTime) / 1000.0D);
    War.war.getLogger().log(Level.INFO, "Saved warzone {0} in {1} seconds.", new Object[] {zoneName, seconds});
View Full Code Here

      dataStmt.setInt(3, relLoc.getBlockZ());
      dataStmt.setString(4, block.getType().toString());
      dataStmt.setShort(5, block.getData().toItemStack().getDurability());
      dataStmt.addBatch();
      if (++changed % batchSize == 0) {
        dataStmt.executeBatch();
      }
    }
    dataStmt.executeBatch(); // insert remaining records
    databaseConnection.commit();
    dataStmt.close();
View Full Code Here

      dataStmt.addBatch();
      if (++changed % batchSize == 0) {
        dataStmt.executeBatch();
      }
    }
    dataStmt.executeBatch(); // insert remaining records
    databaseConnection.commit();
    dataStmt.close();
    databaseConnection.close();
  }
 
View Full Code Here

        stmt.setString(1, kdr.getPlayer().getName());
        stmt.setInt(2, kdr.getKills());
        stmt.setInt(3, kdr.getDeaths());
        stmt.addBatch();
      }
      stmt.executeBatch();
      conn.commit();
      stmt.close();
      final String deleteClause =
          War.war.getMysqlConfig().getLoggingDeleteClause();
      if (!deleteClause.isEmpty()) {
View Full Code Here

      prep.setInt(2, 3);
      prep.addBatch();
      prep.setString(1, "aspen");
      prep.setInt(2, 4);
      prep.addBatch();
      prep.executeBatch();
      assertTrue(super.getLastLogEntry().contains(update));
      assertTrue(super.getLastLogEntry().contains("aspen"));
      assertTrue(super.getLastLogEntry().contains("4"));
      prep.close();
     
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.