Package java.sql

Examples of java.sql.Statement.executeUpdate()


  
   private int update(Connection conn, String sql) throws SQLException {
      Statement st = conn.createStatement();
      System.out.println(this.compareCount + "/" + this.compareNmax + ": '" + sql + "'");
      try {
         return st.executeUpdate(sql);
      }
      catch (SQLException ex) {
         this.exceptionOccured = true;
         throw ex;
      }
View Full Code Here


         }
         this.operations.clear();
         sql = "DELETE FROM replitems";
         st.close();
         st = conn.createStatement();
         st.executeUpdate(sql);
         st.close();
      }
      finally {
         if (st != null)
            st.close();
View Full Code Here

         StringTokenizer tokenizer = new StringTokenizer(createSt, ";");
         while (tokenizer.hasMoreTokens()) {
            String sql = tokenizer.nextToken();
            if (sql.trim().length() > 0) {
               log.info("Executing create statement >" + sql + "<");
               st.executeUpdate(sql);
            }
         }
      }
      finally {
         if (st != null)
View Full Code Here

      if (!exists(conn))
         return false;
      Statement st = null;
      try {
         st = conn.createStatement();
         st.executeUpdate(dropSt);
         return true;
      }
      finally {
         if (st != null)
            st.close();
View Full Code Here

            Statement st = null;
            try {
               st = conn.createStatement();
               if (timeout > 0)
                  st.setQueryTimeout(timeout);
               int num = st.executeUpdate(req);
               if (commitInBetween)
                  conn.commit();
               sum += num;
            }
            finally {
View Full Code Here

            if (createString != null && createString.length() > 1) {
               log.info("adding trigger to '" + table + "'");
               if (log.isLoggable(Level.FINE))
                  log.fine(createString);
               st = conn.createStatement();
               st.executeUpdate(createString);
               st.close();
            }
            tableToWatch.setStatus(TableToWatchInfo.STATUS_OK);
            tableToWatch.storeStatus(this.replPrefix, this.dbPool);
         }
View Full Code Here

  
   private int update(Connection conn, String sql) throws SQLException {
      Statement st = conn.createStatement();
      System.out.println(this.compareCount + "/" + this.compareNmax + ": '" + sql + "'");
      try {
         return st.executeUpdate(sql);
      }
      catch (SQLException ex) {
         this.exceptionOccured = true;
         throw ex;
      }
View Full Code Here

         }
         this.operations.clear();
         sql = "DELETE FROM replitems";
         st.close();
         st = conn.createStatement();
         st.executeUpdate(sql);
         st.close();
      }
      finally {
         if (st != null)
            st.close();
View Full Code Here

            if (name != null) {
               sql = "DROP " + objName + " " + name + postfix;
               log.info(sql);
               st = conn.createStatement();
               try {
                  st.executeUpdate(sql);
               }
               catch (Exception e) {
                  e.printStackTrace();
               }
               finally {
View Full Code Here

               name = schema + "." + name;
            // String sql = "DROP TABLE "  + name + " CASCADE CONSTRAINTS";
            String sql = prefix + " " + name + " " + postfix;
            st = conn.createStatement();
            log.fine("statement: " + sql + "' for cleanup");
            sum += st.executeUpdate(sql);
         }
         catch (Exception ex) {
            ex.printStackTrace();
         }
         finally {
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.