Package java.sql

Examples of java.sql.Statement.executeBatch()


        updateStmt.addBatch(query_dk_da);
        updateStmt.addBatch(query_gr_el);
        updateStmt.addBatch(query_pe_fa);
        updateStmt.addBatch(query_tc_tr);

        updateStmt.executeBatch();
      } catch (ClassNotFoundException e){
        log.warn("Could not load jdbc driver for database configured in olat_config.xml. Driver: "+ driverClass, e);
        throw new StartupException("Could not load jdbc driver for database configured in olat_config.xml. Driver: "+ driverClass, e);
      catch (SQLException e) {
        log.warn("Could not execute system upgrade sql query composed of : "
View Full Code Here


            stmt = connection.createStatement();

            stmt.addBatch(ddlStr);
            stmt.addBatch(sqlStr);

            int[] updateCounts = stmt.executeBatch();
        } catch (ClassNotFoundException e) {
            System.err.println(e.getClass().getName() + ": "
                               + e.getMessage());
            e.printStackTrace(System.err);
        } catch (SQLException e) {
View Full Code Here

      Statement updateStmt = con.createStatement();
      updateStmt.addBatch(lastLoginQuery);
      updateStmt.addBatch(lastUsageQuery);
      updateStmt.addBatch(repositoryLastUsageQuery);
      updateStmt.executeBatch();
    } catch (ClassNotFoundException e) {
      log.warn("Could not load jdbc driver for database configured in olat_config.xml. Driver: "+ driverClass, e);
      throw new StartupException("Could not load jdbc driver for database configured in olat_config.xml. Driver: "+ driverClass, e);
    } catch (SQLException e) {
      log.warn("Could not execute system upgrade sql query. ", e);
View Full Code Here

        Class.forName(driverClass);
        con = DriverManager.getConnection(dbUrl, username, password);
        deleteStmt = con.createStatement();
        deleteStmt.addBatch(query_sub);
        deleteStmt.addBatch(query_pub);
        deleteStmt.executeBatch();
      } catch (ClassNotFoundException e){
        log.warn("Could not load jdbc driver for database configured in olat_config.xml. Driver: "+ driverClass, e);
        throw new StartupException("Could not load jdbc driver for database configured in olat_config.xml. Driver: "+ driverClass, e);
      catch (SQLException e) {
        log.warn("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");
View Full Code Here

            }

            try
            {
                final long start = System.currentTimeMillis();
                final int[] rs = stmt.executeBatch();
                logger.log(System.currentTimeMillis() - start);
                return rs;

            }
            catch (SQLException e)
View Full Code Here

    sql = "insert into customers(name,id) values ('billy', 102)";
    stmt.addBatch(sql);
    assertTrue(super.getLastLogEntry().contains(sql));
    assertTrue(super.getLastLogEntry().contains("|batch|"));

    stmt.executeBatch();
    assertTrue(super.getLastLogEntry().contains(sql));

    assertEquals(2, P6TestUtil.queryForInt(connection,"select count(*) from customers where id > 100"));

    stmt.close();
View Full Code Here

  }
 
  @Test
  public void testExecuteEmptyBatchWithIncludeExcludeEmpty() throws SQLException {
    Statement stmt = connection.createStatement();
    stmt.executeBatch();
    stmt.close();
  }
 
  @Test
  public void testExecuteEmptyBatchWithIncludeExcludeNonEmpty()
View Full Code Here

      throws SQLException {
    P6LogOptions.getActiveInstance().setExclude("foo");
    P6LogOptions.getActiveInstance().setInclude("foo");
   
    Statement stmt = connection.createStatement();
    stmt.executeBatch();
    stmt.close();
   
    P6LogOptions.getActiveInstance().setExclude("");
    P6LogOptions.getActiveInstance().setInclude("");
  }
View Full Code Here

                    stat.addBatch(sql);
                    count++;
                }
            }
            if (count > 0)
                stat.executeBatch();
        }
        finally {
            if (stat != null)
                stat.close();
        }
View Full Code Here

            info.getDefaultValue());
        log.info(sql);
        statement.addBatch(sql);
      }
    }
    statement.executeBatch();
  }

  /**
   * Generates a user object by parse a record in the database.
   * @param <T> the user class type
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.