Package java.sql

Examples of java.sql.Statement.executeUpdate()


         // from now on on an operation on that table should be detected and should start fill the repl_items table
         st = conn.createStatement();
         st.executeUpdate("DELETE FROM " + this.replPrefix + "items");
         st.close();
         st = conn.createStatement();
         st.executeUpdate("INSERT INTO " + tableName + " VALUES ('somebody', 'Paris')");
         st.close();
         // now it should be in " + this.replPrefix + "items ...
        
         st = conn.createStatement();
         rs = st.executeQuery("SELECT * FROM " + this.replPrefix + "items");
View Full Code Here


         assertEquals("Testing if the action for the operation INSERT was correct in " + this.replPrefix + "items.", "INSERT", action);
         rs.close();
         st.close();
         // and now cleanup
         st = conn.createStatement();
         st.executeUpdate("DELETE FROM " + this.replPrefix + "items");
         st.close();
        
      }
      catch (Exception ex) {
         ex.printStackTrace();
View Full Code Here

         String command = descriptor.getCommand();

         if (descriptor.getInteraction().equalsIgnoreCase("update")) {
            if (log.isLoggable(Level.FINE)) log.fine("Trying DB update '" + command + "' ...");

            int rowsAffected = stmt.executeUpdate(command);

            doc = createUpdateDocument(rowsAffected, descriptor);
         }
         else {
            if (log.isLoggable(Level.FINE)) log.fine("Trying SQL query '" + command + "' ...");
View Full Code Here

       
        Statement stmt = null;
       
        stmt = connection.createStatement();
        try {
            stmt.executeUpdate(CREATE_SRC_SEQUENCES_TABLE_STMT);
        } catch (SQLException ex) {
            if (!"X0Y32".equals(ex.getSQLState())) {
                throw ex;
            } else {
                LOG.fine("Table CELTIX_RM_SRC_SEQUENCES already exists.");
View Full Code Here

        }
        stmt.close();
       
        stmt = connection.createStatement();
        try {
            stmt.executeUpdate(CREATE_DEST_SEQUENCES_TABLE_STMT);
        } catch (SQLException ex) {
            if (!"X0Y32".equals(ex.getSQLState())) {
                throw ex;
            } else {
                LOG.fine("Table CELTIX_RM_DEST_SEQUENCES already exists.");
View Full Code Here

        stmt.close();
       
        for (String tableName : new String[] {OUTBOUND_MSGS_TABLE_NAME, INBOUND_MSGS_TABLE_NAME}) {
            stmt = connection.createStatement();
            try {
                stmt.executeUpdate(MessageFormat.format(CREATE_MESSAGES_TABLE_STMT, tableName));
            } catch (SQLException ex) {
                if (!"X0Y32".equals(ex.getSQLState())) {
                    throw ex;
                } else {
                    if (LOG.isLoggable(Level.FINE)) {
View Full Code Here

        Connection con = null;
        try {
            con = getConnection();
            if ( con != null ) {
                Statement stmt = con.createStatement();
                stmt.executeUpdate(sql);
                stmt.close();
            }
        }
        catch (SQLException e) {
            ErrorHandler.reportError("Error while running insert query", e);
View Full Code Here

    Statement oStmt = oConn.createStatement();

    if (DebugFile.trace) DebugFile.writeln("Statement.executeUpdate (DELETE FROM " + DB.k_newsgroup_subscriptions + " WHERE " + DB.gu_newsgrp + "='" + sNewsGroupId + "' AND " + DB.gu_user + "='" + sUserId + "')");

    int iAffected = oStmt.executeUpdate("DELETE FROM " + DB.k_newsgroup_subscriptions + " WHERE " + DB.gu_newsgrp + "='" + sNewsGroupId + "' AND " + DB.gu_user + "='" + sUserId + "'");

    oStmt.close();

    if (DebugFile.trace) {
      DebugFile.decIdent();
View Full Code Here

    Statement oStmt = oConn.createStatement();

    if (DebugFile.trace)
      DebugFile.writeln("Statement.executeUpdate(UPDATE " + DB.k_newsgroup_subscriptions + " SET " + DB.id_status + "=" + String.valueOf(ACTIVE) + " WHERE " + DB.gu_newsgrp + "='" + sNewsGroupId + "' AND " + DB.gu_user + "='" + sUserId + "')");

    int iAffected = oStmt.executeUpdate("UPDATE " + DB.k_newsgroup_subscriptions + " SET " + DB.id_status + "=" + String.valueOf(ACTIVE) + " WHERE " + DB.gu_newsgrp + "='" + sNewsGroupId + "' AND " + DB.gu_user + "='" + sUserId + "'");

    oStmt.close();

    if (DebugFile.trace) {
      DebugFile.decIdent();
View Full Code Here

    Statement oStmt = oConn.createStatement();

    if (DebugFile.trace)
      DebugFile.writeln("Statement.executeUpdate(UPDATE " + DB.k_newsgroup_subscriptions + " SET " + DB.id_status + "=" + String.valueOf(UNACTIVE) + " WHERE " + DB.gu_newsgrp + "='" + sNewsGroupId + "' AND " + DB.gu_user + "='" + sUserId + "')");

    int iAffected = oStmt.executeUpdate("UPDATE " + DB.k_newsgroup_subscriptions + " SET " + DB.id_status + "=" + String.valueOf(UNACTIVE) + " WHERE " + DB.gu_newsgrp + "='" + sNewsGroupId + "' AND " + DB.gu_user + "='" + sUserId + "'");

    oStmt.close();

    if (DebugFile.trace) {
      DebugFile.decIdent();
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.