|
2004.04.29 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.jdc.lang.Object
|
+--com.jdc.rdb.sql.SQL
|
+--com.jdc.rdb.sql.dml.DML
|
+--com.jdc.rdb.sql.dml.delete.Delete
Delete represents a Data Manipulation Language Delete
SQL statement. The Delete statement deletes
one or more rows from a database Table or View.
Deleting a row from a View deletes the row from the Table
on which the View is based.
DELETE form is used to delete one or more rows
(optionally determined by a search condition).DELETE form is used to delete exactly one row
(as determined by the current position of a cursor).Delete by a search condition is supported.
SQL statements. It is an executable statement
that can be dynamically prepared.DELETE privilege on the table or view for which rows are to be deleted.CONTROL privilege on the table or view for which rows are to be deleted.SYSADM or DBADM authority.Delete statement, the privileges
held by the authorization ID of the statement must also include at least one of the
following for each table or view referenced by a subquery
(for IBM® DB2 Universal Database™):
SELECT privilege.CONTROL privilege.SYSADM or DBADM authority.
Delete delete = new Delete(table);
delete.setWhere(column 1 , 123 );
delete.setWhere(column 2 , "Key");
. . .
DeleteStatus status = delete.execute();
if (status.isSuccessful())
{
// Delete success
}
else
{
// Delete failed!
}Delete from a View is not currently supported.
From,
Correlation,
Where,
With,
Serialized Form| Field Summary | |
static String |
COMMAND
The Delete statement command keyword. |
| Fields inherited from class com.jdc.rdb.sql.dml.DML |
sql |
| Fields inherited from class com.jdc.lang.Object |
string |
| Constructor Summary | |
Delete()
Constructs a new Delete statement object. |
|
Delete(String statement)
Constructs a new Delete statement object for the specified
Delete statement. |
|
Delete(Table table)
Constructs a new Delete statement object for the specified
Database Table. |
|
| Method Summary | |
DeleteStatus |
execute()
Executes the Delete statement and returns
a DeleteStatus object. |
From |
getFrom()
Returns the From clause for this Delete statement. |
Where |
getWhere()
Returns the Where clause for this Delete statement. |
protected boolean |
isValid()
Returns true if the Delete statement is valid. |
Delete |
set(DeleteClause clause)
Sets a DeleteClause for this Delete
statement. |
Delete |
setWhere(Column column,
int value)
Sets a search condition for the specified table Column
and int value. |
Delete |
setWhere(Column column,
Object value)
Sets a search condition for the specified table Column
and Object value. |
String |
toString()
Returns a String representation of this Delete statement. |
| Methods inherited from class com.jdc.rdb.sql.dml.DML |
finalize, getColumn, getConnection, getTable, setTable |
| Methods inherited from class com.jdc.rdb.sql.SQL |
addClause, execute, getClause, getCommand, getStatement, setCommand, setConnection, setStatement |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final String COMMAND
Delete statement command keyword.
| Constructor Detail |
public Delete()
Delete statement object.
public Delete(Table table)
Delete statement object for the specified
Database Table.
SQLInvalidException - No table definition is specified.public Delete(String statement)
Delete statement object for the specified
Delete statement.
SQLInvalidException - No DELETE statement is specified.| Method Detail |
public DeleteStatus execute()
Delete statement and returns
a DeleteStatus object.
Delete statement status.public From getFrom()
From clause for this Delete statement.
Delete statement From clause.public Where getWhere()
Where clause for this Delete statement.
Delete statement Where clause.protected boolean isValid()
true if the Delete statement is valid.
isValid in class SQLtrue.public Delete set(DeleteClause clause)
DeleteClause for this Delete
statement. Use this method to specify a custom Delete clause.
Delete statement object.
SQLInvalidException - No DELETE statement clause is specified.
public Delete setWhere(Column column,
int value)
Column
and int value. These values are used to create the Where
clause for this statement. A Comparison operator of EQUAL,
i.e. "=", is implied.
Delete statement object.
SQLInvalidException - No column is specified or an invalid
table column is specified.
public Delete setWhere(Column column,
Object value)
Column
and Object value. These values are used to create the Where
clause for this statement. A Comparison operator of EQUAL,
i.e. "=", is implied.
Delete statement object.
SQLInvalidException - No column is specified or an invalid
table column is specified.public String toString()
String representation of this Delete statement.
toString in interface StatementtoString in class SQLString representation of this Delete statement.
|
2004.04.29 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||