com.j256.ormlite.jdbc
Class JdbcPreparedStmt

java.lang.Object
  extended by com.j256.ormlite.jdbc.JdbcPreparedStmt
All Implemented Interfaces:
PreparedStmt

public class JdbcPreparedStmt
extends Object
implements PreparedStmt

Wrapper around a PreparedStatement object which we delegate to.

Author:
graywatson

Constructor Summary
JdbcPreparedStmt(PreparedStatement preparedStatement)
           
 
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 x, int targetSqlType)
          Set the parameter specified by the index and type to be an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcPreparedStmt

public JdbcPreparedStmt(PreparedStatement preparedStatement)
Method Detail

close

public void close()
           throws SQLException
Description copied from interface: PreparedStmt
Close the statement.

Specified by:
close in interface PreparedStmt
Throws:
SQLException

execute

public boolean execute()
                throws SQLException
Description copied from interface: PreparedStmt
Execute the prepared statement returning true if it worked.

Specified by:
execute in interface PreparedStmt
Throws:
SQLException

getColumnCount

public int getColumnCount()
                   throws SQLException
Description copied from interface: PreparedStmt
Returns the number of columns in this statement.

Specified by:
getColumnCount in interface PreparedStmt
Throws:
SQLException

getColumnName

public String getColumnName(int column)
                     throws SQLException
Description copied from interface: PreparedStmt
Get the designated column's name.

Specified by:
getColumnName in interface PreparedStmt
Parameters:
column - The first column is 1, the second is 2, ...
Throws:
SQLException

getMoreResults

public boolean getMoreResults()
                       throws SQLException
Description copied from interface: PreparedStmt
Put more results in the results object.

Specified by:
getMoreResults in interface PreparedStmt
Throws:
SQLException

getResults

public Results getResults()
                   throws SQLException
Description copied from interface: PreparedStmt
Get our results object generated by the statement.

Specified by:
getResults in interface PreparedStmt
Throws:
SQLException

getWarnings

public SQLWarning getWarnings()
                       throws SQLException
Description copied from interface: PreparedStmt
Return any warnings generated by the statement.

Specified by:
getWarnings in interface PreparedStmt
Throws:
SQLException

setMaxRows

public void setMaxRows(int max)
                throws SQLException
Description copied from interface: PreparedStmt
Set the number of rows to return in the results.

Specified by:
setMaxRows in interface PreparedStmt
Throws:
SQLException

setNull

public void setNull(int parameterIndex,
                    int sqlType)
             throws SQLException
Description copied from interface: PreparedStmt
Set the parameter specified by the index and type to be null.

Specified by:
setNull in interface PreparedStmt
Parameters:
parameterIndex - Index of the parameter with 1 being the first parameter, etc..
sqlType - SQL type of the parameter.
Throws:
SQLException

setObject

public void setObject(int parameterIndex,
                      Object x,
                      int targetSqlType)
               throws SQLException
Description copied from interface: PreparedStmt
Set the parameter specified by the index and type to be an object.

Specified by:
setObject in interface PreparedStmt
Parameters:
parameterIndex - Index of the parameter with 1 being the first parameter, etc..
x - Object that we are setting.
targetSqlType - SQL type of the parameter.
Throws:
SQLException


Copyright © 2010. All Rights Reserved.