Returns a java.sql.PreparedStatement instance that allows the user to add delete operations to the download. The prepared
statement applies to the download table and contains a parameter for each primary key column in the table.
The prepared statement applies to the DownloadTableData instance and contains a parameter for each primary key column in the
table.
To include a delete operation in the download, set all columns in your java.sql.PreparedStatement and then call the java.sql.PreparedStatement.executeUpdate
method.
Set all the parameters to null to have the remote database truncate the table.
Note
You must set all primary key values for download delete operations, or set all primary key values to null for truncate operations.
In the following example, the setDownloadDeletes method uses the DownloadTableData.getDeletePreparedStatement to obtain a
prepared statement for rows you want to delete. The java.sql.PreparedStatement.setInt method sets the primary key values for
rows you want to delete in the remote database and the java.sql.PreparedStatement.executeUpdate method sets the row values
in the download.
void setDownloadDeletes(DownloadTableData td) {
java.sql.PreparedStatement delete_ps = td.getDeletePreparedStatement();
// This is the same as executing the following SQL statement:
// DELETE FROM remoteOrders where pk=2300;
delete_ps.setInt(1, 2300);
delete_ps.executeUpdate();
delete_ps.close();
}