|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.castor.cpa.persistence.sql.engine.CastorStatement
public final class CastorStatement
CastorStatement class to wrap handling of PreparedStatements by providing functionality to prepare statements, bind parameters, execute statements and, close statements.
| Constructor Summary | |
|---|---|
CastorStatement(PersistenceFactory factory,
Connection connection)
Constructor. |
|
| Method Summary | |
|---|---|
void |
bindParameter(String name,
Object value,
int type)
Method to bind passed parameters to the local statement. |
void |
close()
Method to close the prepared statement. |
ResultSet |
executeQuery()
Method to execute prepared statement and return ResultSet. |
int |
executeUpdate()
Method to execute prepared statement. |
int |
getParameterSize()
Method returning size of the parameter map. |
PreparedStatement |
getStatement()
Method returning statement currently set. |
void |
prepareStatement(Delete delete)
Method to prepare delete statement and store it in local Variable. |
void |
prepareStatement(Insert insert)
Method to prepare insert statement and store it in local Variable. |
void |
prepareStatement(Select select)
Method to prepare select statement and store it in local Variable. |
void |
prepareStatement(Update update,
Condition condition)
Method to prepare update statement, append passed condition and store it in local Variable. |
void |
setStatement(PreparedStatement stmt)
Method to set statement. |
String |
toString()
Method to get string representation of the existing query string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CastorStatement(PersistenceFactory factory,
Connection connection)
factory - Instance of PersistenceFactory to be used to create CastorStatements.connection - Instance of the connection to be used to create CastorStatements.| Method Detail |
|---|
public PreparedStatement getStatement()
public void setStatement(PreparedStatement stmt)
stmt - Statement to be set
public int getParameterSize()
throws SQLException
SQLException - Reports database access errors.
public void prepareStatement(Select select)
throws SQLException
select - Prepared select-object to create statement for.
SQLException - Reports database access errors.
public void prepareStatement(Insert insert)
throws SQLException
insert - Prepared insert-object to create statement for.
SQLException - Reports database access errors.
public void prepareStatement(Update update,
Condition condition)
throws SQLException
update - Prepared update-object to create statement for.condition - Condition to be appended to the QueryContext.
SQLException - Reports database access errors.
public void prepareStatement(Delete delete)
throws SQLException
delete - Prepared delete-object to create statement for.
SQLException - Reports database access errors.
public void bindParameter(String name,
Object value,
int type)
throws SQLException
name - Name of the parameter to be bound.value - Value of the parameter to be bound.type - Type of the parameter to be bound.
SQLException - Reports database access errors.
public int executeUpdate()
throws SQLException
SQLException - Reports database access errors.
public ResultSet executeQuery()
throws SQLException
SQLException - Reports database access errors.
public void close()
throws SQLException
SQLException - Reports database access errors.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||