|
[Deprecated API] | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | CURRENT API | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.interface21.jdbc.object.RdbmsOperation
|
+--com.interface21.jdbc.object.SqlOperation
|
+--com.interface21.jdbc.object.SqlUpdate
RdbmsOperation subclass representing a SQL update.
Like a query, an update object is reusable. Like all RdbmsOperation
objects, an update can have parameters and is defined in SQL.
This class provides a number of update() methods analogous to the
execute() methods of query objects.
This class is concrete. Although it can be subclassed (for example
to add a custom update method) it can easily be parameterized by setting
SQL and declaring parameters.
| Fields inherited from class com.interface21.jdbc.object.RdbmsOperation |
logger |
| Constructor Summary | |
SqlUpdate()
Constructor to allow use as a JavaBean. |
|
SqlUpdate(javax.sql.DataSource ds,
java.lang.String sql)
Constructs an update object with a given DataSource and SQL to keep consistent with the |
|
SqlUpdate(javax.sql.DataSource ds,
java.lang.String sql,
int[] types)
Construct an update object with a given DataSource, SQL and anonymous parameters |
|
SqlUpdate(javax.sql.DataSource ds,
java.lang.String sql,
int[] types,
int maxRowsAffected)
Construct an update object with a given DataSource, SQL, anonymous parameters and specifying the maximum number of rows that may be affected. |
|
| Method Summary | |
void |
setMaxRowsAffected(int max)
Set the maximum number of rows that may be affected by this update. |
void |
setRequiredRowsAffected(int rowsAffected)
Set the exact number of rows that must be affected by this update. |
int |
update()
Convenience method to execute an update with no parameters |
int |
update(int p1)
Convenient method to execute an update given one int arg |
int |
update(int p1,
int p2)
Convenient method to execute an update given two int args |
int |
update(java.lang.Object[] args)
Generic method to execute the update given arguments. |
int |
update(java.lang.String p)
Convenient method to execute an update given one String arg |
| Methods inherited from class com.interface21.jdbc.object.SqlOperation |
compileInternal, getJdbcTemplate, newPreparedStatementCreator, onCompileInternal |
| Methods inherited from class com.interface21.jdbc.object.RdbmsOperation |
afterPropertiesSet, compile, declareParameter, getDataSource, getDeclaredParameters, getSql, isCompiled, setDataSource, setSql, setTypes, validateParameters |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SqlUpdate()
public SqlUpdate(javax.sql.DataSource ds,
java.lang.String sql)
ds - DataSource to use to obtain connectionssql - SQLtypes - anonymous parameter declarations.
public SqlUpdate(javax.sql.DataSource ds,
java.lang.String sql,
int[] types)
ds - DataSource to use to obtain connectionssql - SQLtypes - anonymous parameter declarations.
public SqlUpdate(javax.sql.DataSource ds,
java.lang.String sql,
int[] types,
int maxRowsAffected)
ds - DataSource to use to obtain connectionssql - SQLtypes - anonymous parameter declarations.maxRowsAffected - the maximum number of rows that may
be affected by the update.| Method Detail |
public void setMaxRowsAffected(int max)
max - the maximum number of rows that can be affected
by this update without this class's update() method considering
it an error.public void setRequiredRowsAffected(int rowsAffected)
rowsAffected - the exact number of rows that must be
affected by this update.
public int update(java.lang.Object[] args)
throws InvalidDataAccessApiUsageException
args - array of object argumentspublic int update()
public int update(int p1)
public int update(int p1,
int p2)
public int update(java.lang.String p)
|
[Deprecated API] | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | CURRENT API | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||