Package java.sql

Examples of java.sql.PreparedStatement.executeUpdate()


     
      try {
         preStatement.setLong(1, storeId);
         if (id != 0)
            preStatement.setLong(2, id);
         return preStatement.executeUpdate();
      }
      finally {
         if (preStatement != null)
            preStatement.close();
      }
View Full Code Here


      PreparedStatement preStatement = conn.prepareStatement(deleteTransientsSt);
      preStatement.setLong(1, storeId);
      if (timeout > 0)
         preStatement.setQueryTimeout(timeout);
      try {
         return preStatement.executeUpdate();
      }
      finally {
         if (preStatement != null)
            preStatement.close();
      }
View Full Code Here

         sql = "UPDATE " + getCompleteTableName() + setSt + whereSt;
         st = conn.prepareStatement(sql);

         for (int i=0; i < entries.size(); i++)
            insertIntoStatement(st, i+1, (ClientProperty)entries.get(i));
         return st.executeUpdate();
      }
      catch (Throwable ex) {
         log.severe(" Entry '" + newRow.toXml("", true, false, true) + "' caused a (throwable) exception. Statement was '" + sql + "': " + ex.getMessage());
         if (ex instanceof Exception)
            throw (Exception)ex;
View Full Code Here

         sql = "DELETE FROM " + getCompleteTableName() + whereSt;
         st = conn.prepareStatement(sql);

         for (int i=0; i < entries.size(); i++)
            insertIntoStatement(st, i+1, (ClientProperty)entries.get(i));
         return st.executeUpdate();
      }
      catch (Throwable ex) {
         log.severe(" Entry '" + row.toXml("", true, false, true) + "' caused a (throwable) exception. Statement was '" + sql + "': " + ex.getMessage());
         if (ex instanceof Exception)
            throw (Exception)ex;
View Full Code Here

            //if (i>0) buf.append(", ");
            //buf.append((ClientProperty)entries.get(i));
         }
         //log.info("Writing: " + buf.toString());
        
         ret = st.executeUpdate();
        
         return ret;
      }
      catch (SQLException ex) {
         // unique constraint for Oracle: TODO implement also for other DB
View Full Code Here

        params.add(name);
        throw new XException(Constants.LOCATION_EXTERN,
            Constants.LAYER_TECHNICAL,
            Constants.PACKAGE_TECHNICAL_DATABASE, "7", params);
      }
      result = pStatement.executeUpdate();
    }
    catch (SQLException e)
    {
      throw new XException(Constants.LOCATION_EXTERN,
          Constants.LAYER_TECHNICAL,
View Full Code Here

      oStmt = oConn.prepareStatement("INSERT INTO " + DB.k_x_cat_objs + " (" + DB.gu_category + "," + DB.gu_object + "," + DB.id_class + "," + DB.od_position + ") VALUES (?,?,?,?)");
      oStmt.setString(1, idCategory);
      oStmt.setString(2, getString(DB.gu_product));
      oStmt.setInt (3, ClassId);
      oStmt.setInt (4, iOdPosition);
      iRetVal = oStmt.executeUpdate();
      oStmt.close();
    }
    else {
      iRetVal = 0;
    }
View Full Code Here

    PreparedStatement oStmt;

    oStmt = oConn.prepareStatement("DELETE FROM " + DB.k_x_cat_objs + " WHERE " + DB.gu_category + "=? AND " + DB.gu_object + "=?");
    oStmt.setString(1, idCategory);
    oStmt.setString(2, getString(DB.gu_product));
    iDeleted = oStmt.executeUpdate();
    oStmt.close();

    return iDeleted;
  } // removeFromCategory
View Full Code Here

         preStatement.setLong(6, dataId);
         preStatement.setString(7, queueName);

         if (log.isLoggable(Level.FINE)) log.fine(preStatement.toString());

         int num = preStatement.executeUpdate();
         if (log.isLoggable(Level.FINE)) log.fine("Modified " + num + " entries, entryId='" + entry.getUniqueId() + "'");
         if (oldEntry == null)
            return entry.getSizeInBytes();
         return entry.getSizeInBytes() - oldEntry.getSizeInBytes();
      }
View Full Code Here

            countTest++;
            if (countTest % 10 == 0)
               throw new java.sql.SQLException("Connection reset by peer: socket write error");
               //com.microsoft.sqlserver.jdbc.XmlBlasterSqlServerHelper.throwTestException();
         }
         int num = preStatement.executeUpdate();
         if (log.isLoggable(Level.FINE)) log.fine("Added " + num + " entries, entryId='" + entry.getUniqueId() + "'");
         ret = true;
      }
      catch (Throwable ex) {
         String originalExceptionStack = Global.getStackTraceAsString(ex);
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.