/*
* codjo.net
*
* Common Apache License 2.0
*/
package net.codjo.dataprocess.server.handlercommand;
import net.codjo.dataprocess.server.handlerhelper.UtilHandlerHelper;
import net.codjo.mad.server.handler.HandlerCommand;
import net.codjo.mad.server.handler.HandlerException;
import java.sql.Connection;
import java.sql.SQLException;
/**
*
*/
public class ExecuteSqlCommand extends HandlerCommand {
@Override
public CommandResult executeQuery(CommandQuery query) throws HandlerException, SQLException {
Connection con = getContext().getTxConnection();
try {
String sql = query.getArgumentString("query");
boolean result = UtilHandlerHelper.executeSql(con, sql);
return createResult(result);
}
finally {
con.close();
}
}
}