1 /* 2 * Replica is published under the terms 3 * of the Apache Software License. 4 */ 5 package replica.database.commands.sql; 6 7 import java.sql.SQLException; 8 import java.sql.Statement; 9 10 import replica.core.ApplicationMessage; 11 import replica.database.commands.StatementDbCommand; 12 import replica.server.commands.PrintCommand; 13 14 /*** 15 * 16 * @author Pedro Costa 17 * @author Helder Silva 18 * @since 20/Jan/2004 19 */ 20 public class UpdateDbCommand extends StatementDbCommand { 21 22 /*** 23 * 24 */ 25 public UpdateDbCommand() { 26 super(); 27 } 28 29 /* (non-Javadoc) 30 * @see replica.database.commands.DatabaseCommand#execute(java.sql.Statement, java.lang.String) 31 */ 32 protected Object execute(Statement st, String command) throws SQLException{ 33 34 int res = st.executeUpdate( command ); 35 36 ApplicationMessage result = new ApplicationMessage(); 37 result.setOriginator(ApplicationMessage.DATABASE_MODULE); 38 result.setBody( PrintCommand.NAME + " " + res + " rows afected."); 39 40 return result; 41 } 42 43 }

This page was automatically generated by Maven