public java.sql.PreparedStatement getDeletePreparedStatement( ) throws SQLException
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.
You must set all primary key values for download delete operations.
A java.sql.PreparedStatement instance for adding delete operations to the download.
SQLException Thrown if there is a problem retrieving the delete java.sql.PreparedStatement instance.
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(); } |
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |