package eu.dnetlib.dlms.jdbc.ast;

import java.sql.SQLException;

import eu.dnetlib.dlms.jdbc.ExecutorContext;
import eu.dnetlib.dlms.jdbc.server.IStatementExecutor;

/**
 * The base class for statements.
 * 
 * @author marko
 * 
 */
public abstract class Statement extends ASTNode {
	/**
	 * Executes this Statement in the given context using the given IStatementExecutor.
	 * 
	 * @param executor
	 *            IStatementExecutor to use for execution
	 * @param context
	 *            ExecutorContext instance that is the current context
	 * @return the result of the execution
	 * @throws SQLException
	 *             problems during execution
	 */
	public abstract Object execute(final IStatementExecutor executor, final ExecutorContext context) throws SQLException;

}
