com.j256.ormlite.support
Interface PreparedStmt

All Known Implementing Classes:
JdbcPreparedStmt

public interface PreparedStmt

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

Author:
graywatson

Method Summary
 void close()
          Close the statement.
 boolean execute()
          Execute the prepared statement returning true if it worked.
 int getColumnCount()
          Returns the number of columns in this statement.
 String getColumnName(int column)
          Get the designated column's name.
 boolean getMoreResults()
          Put more results in the results object.
 Results getResults()
          Get our results object generated by the statement.
 SQLWarning getWarnings()
          Return any warnings generated by the statement.
 void setMaxRows(int max)
          Set the number of rows to return in the results.
 void setNull(int parameterIndex, int sqlType)
          Set the parameter specified by the index and type to be null.
 void setObject(int parameterIndex, Object obj, int 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 column)
                     throws SQLException
Get the designated column's name.

Parameters:
column - The first column is 1, the second is 2, ...
Throws:
SQLException

execute

boolean execute()
                throws SQLException
Execute the prepared statement returning true if it worked.

Throws:
SQLException

getWarnings

SQLWarning getWarnings()
                       throws SQLException
Return any warnings generated by the statement.

Throws:
SQLException

getResults

Results getResults()
                   throws SQLException
Get our results object generated by the statement.

Throws:
SQLException

getMoreResults

boolean getMoreResults()
                       throws SQLException
Put more results in the results object.

Throws:
SQLException

close

void close()
           throws SQLException
Close the statement.

Throws:
SQLException

setNull

void setNull(int parameterIndex,
             int sqlType)
             throws SQLException
Set the parameter specified by the index and type to be null.

Parameters:
parameterIndex - Index of the parameter with 1 being the first parameter, etc..
sqlType - SQL type of the parameter.
Throws:
SQLException

setObject

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

Parameters:
parameterIndex - Index of the parameter with 1 being the first parameter, etc..
obj - Object that we are setting.
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


Copyright © 2010. All Rights Reserved.