package org.seasar.dao.impl;

import javax.sql.DataSource;

import org.seasar.dao.CommandContext;
import org.seasar.extension.jdbc.impl.BasicUpdateHandler;

/**
 * @author higa
 *  
 */
public class UpdateDynamicCommand extends AbstractDynamicCommand {

	public UpdateDynamicCommand(DataSource dataSource) {
		super(dataSource);
	}

	public Object execute(Object[] args) {
		CommandContext ctx = apply(args);
		BasicUpdateHandler updateHandler = new BasicUpdateHandler(
				getDataSource(), ctx.getSql());
		return new Integer(updateHandler.execute(ctx.getBindVariables()));
	}

}