com.j256.ormlite.support
Interface CompiledStatement


public interface CompiledStatement

An internal reduction of the SQL PreparedStatment so we can implement its functionality outside of JDBC.

Author:
graywatson

Method Summary
 void close()
          Close the statement.
 int getColumnCount()
          Returns the number of columns in this statement.
 String getColumnName(int columnIndex)
          Get the designated column's name.
 int runExecute()
          Run the prepared execute statement returning the number of rows affected.
 DatabaseResults runQuery(ObjectCache objectCache)
          Run the prepared query statement returning the results.
 int runUpdate()
          Run the prepared update statement returning the number of rows affected.
 void setMaxRows(int max)
          Set the number of rows to return in the results.
 void setObject(int parameterIndex, Object obj, SqlType sqlType)
          Set the parameter specified by the index and type to be an object.
 

Method Detail

getColumnCount

int getColumnCount()
                   throws SQLException
Returns the number of columns in this statement.

Throws:
SQLException

getColumnName

String getColumnName(int columnIndex)
                     throws SQLException
Get the designated column's name.

Throws:
SQLException

runUpdate

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

Throws:
SQLException

runQuery

DatabaseResults runQuery(ObjectCache objectCache)
                         throws SQLException
Run the prepared query statement returning the results.

Throws:
SQLException

runExecute

int runExecute()
               throws SQLException
Run the prepared execute statement returning the number of rows affected.

Throws:
SQLException

close

void close()
           throws SQLException
Close the statement.

Throws:
SQLException

setObject

void setObject(int parameterIndex,
               Object obj,
               SqlType sqlType)
               throws SQLException
Set the parameter specified by the index and type to be an object.

Parameters:
parameterIndex - Index of the parameter with 0 being the first parameter, etc..
obj - Object that we are setting. Can be null.
sqlType - SQL type of the parameter.
Throws:
SQLException

setMaxRows

void setMaxRows(int max)
                throws SQLException
Set the number of rows to return in the results.

Throws:
SQLException


This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.