package com.j256.ormlite.support;

import java.sql.SQLException;

import com.j256.ormlite.field.SqlType;

/**
 * An internal reduction of the SQL PreparedStatment so we can implement its functionality outside of JDBC.
 * 
 * @author graywatson
 */
public interface CompiledStatement {

	/**
	 * Returns the number of columns in this statement.
	 */
	public int getColumnCount() throws SQLException;

	/**
	 * Get the designated column's name.
	 * 
	 * @param column
	 *            The first column is 1, the second is 2, ...
	 */
	public String getColumnName(int column) throws SQLException;

	/**
	 * Run the prepared update statement returning the number of rows affected.
	 */
	public int runUpdate() throws SQLException;

	/**
	 * Run the prepared query statement returning the results.
	 */
	public DatabaseResults runQuery() throws SQLException;

	/**
	 * Run the prepared execute statement returning whether it worked or not.
	 */
	public boolean runExecute() throws SQLException;

	/**
	 * Get the generated key results.
	 */
	public DatabaseResults getGeneratedKeys() throws SQLException;

	/**
	 * Close the statement.
	 */
	public void close() throws SQLException;

	/**
	 * Set the parameter specified by the index and type to be null.
	 * 
	 * @param parameterIndex
	 *            Index of the parameter with 1 being the first parameter, etc..
	 * @param sqlType
	 *            SQL type of the parameter.
	 */
	public void setNull(int parameterIndex, SqlType sqlType) throws SQLException;

	/**
	 * Set the parameter specified by the index and type to be an object.
	 * 
	 * @param parameterIndex
	 *            Index of the parameter with 1 being the first parameter, etc..
	 * @param obj
	 *            Object that we are setting.
	 * @param sqlType
	 *            SQL type of the parameter.
	 */
	public void setObject(int parameterIndex, Object obj, SqlType sqlType) throws SQLException;

	/**
	 * Set the number of rows to return in the results.
	 */
	public void setMaxRows(int max) throws SQLException;
}

@@ -904,32 +904,35 @@
 ing 
-whether it worked or not
+the number of rows affected
 .%0A%09 
@@ -946,15 +946,11 @@
 lic 
-boolean
+int
  run

Make runExecute return int again after reading the docs more.