Java

Topic: JDBC

Explain method Updating the Underlying Data Source?

When the method acceptChanges is executed, the CachedRowSet object's writer, a RowSetWriterImpl object, is called behind the scenes to write the changes made to the rowset to the underlying data source. The writer is implemented to make a connection to the data source and write updates to it.A writer is made available through an implementation of the SyncProvider interface, as discussed in section 1, "Creating a CachedRowSet Object." The default reference implementation provider, RIOptimisticProvider, has its writer implemented to use an optimistic concurrency control mechanism. That is, it maintains no locks in the underlying database while the rowset is disconnected from the database and simply checks to see if there are any conflicts before writing data to the data source. If there are any conflicts, it does not write anything to the data source.The reader/writer facility provided by the SyncProvider class is pluggable, allowing for the customization of data retrieval and updating. If a different concurrency control mechanism is desired, a different implementation of SyncProvider can be plugged in using the method setSyncProvider.In order to use the optimistic concurrency control routine, the RIOptismisticProvider maintains both its current value and its original value (the value it had immediately preceding the current value). Note that if no changes have been made to the data in a RowSet object, its current values and its original values are the same, both being the values with which the RowSet object was initially populated. However, once any values in the RowSet object have been changed, the current values and the original values will be different, though at this stage, the original values are still the initial values. With any subsequent changes to data in a RowSet object, its original values and current values will still differ, but its original values will be the values that were previously the current values.Keeping track of original values allows the writer to compare the RowSet object's original value with the value in the database. If the values in the database differ from the RowSet object's original values, which means that the values in the database have been changed, there is a conflict. Whether a writer checks for conflicts, what degree of checking it does, and how it handles conflicts all depend on how it is implemented. 

Browse random answers:

What does the connection object represents?
Explain method Creating a CachedRowSet Object?
Explain Retrieving Data from a CachedRowSet Object?
Explain method Retrieving RowSetMetaData?
Explain method Updating a CachedRowSet Object?
Explain method Updating the Underlying Data Source?
Explain method Registering and Notifying Listeners?
Explain method Passing Data to Thin Clients?
Explain Scrolling and Updating?
Explain Getting Universal Data Access?
Explain Setting Properties?
Explain Paging Data?
Explain Background?
Explain  Predicate Sharing?
Explain Updating a FilteredRowSet Object?
Explain Behavior of Rows Outside the Filter?
Explain Creating a JdbcRowSet Object?
Explain boolean getShowDeleted() throws SQLException?
Explain void setShowDeleted(boolean b) throws SQLException?
Explain about getRowSetWarningsRowSetWarning getRowSetWarnings()                                throws SQLException?
Explain about  void commit() throws SQLException?
Explain getAutoCommitboolean getAutoCommit()                      throws SQLException?
Explain void setAutoCommit(boolean autoCommit)                   throws SQLException?
Explain about void rollback()              throws SQLException?
Explain void rollback(Savepoint s)              throws SQLException?
Explain about  Managing Multiple Match Columns?
Explain about void setMatchColumn(int columnIdx)                    throws SQLException?
Explain setMatchColumnvoid setMatchColumn(int[] columnIdxes)                    throws SQLException
Explain about setMatchColumnvoid setMatchColumn(String columnName)                    throws SQLException?
Explain about setMatchColumnvoid setMatchColumn(String[] columnNames)                    throws SQLException?
Explain about getMatchColumnIndexesint[] getMatchColumnIndexes()                            throws SQLException
Explain about getMatchColumnNamesString[] getMatchColumnNames()                             throws SQLException?
Explain about unsetMatchColumnvoid unsetMatchColumn(int columnIdx)                      throws SQLException
Explain about unsetMatchColumnvoid unsetMatchColumn(int[] columnIdxes)                      throws SQLException?
Explain unsetMatchColumnvoid unsetMatchColumn(String columnName)                      throws SQLException?
UnsetMatchColumnvoid unsetMatchColumn(String[] columnName)                      throws SQLException
Using a JoinRowSet Object for Creating a JOIN
JoinRowSet Methods
Explain method CROSS_JOIN?
Explain about INNER_JOINstatic final int INNER_JOIN?
Explain the difference between LEFT_OUTER_JOINstatic final int LEFT_OUTER_JOIN?
Explain method RIGHT_OUTER_JOIN?
Explain the difference between FULL_JOINstatic final int FULL_JOIN
Explain about addRowSetvoid addRowSet(Joinable rowset)               throws SQLException?
Explain about addRowSetvoid addRowSet(RowSet rowset,             int columnIdx)               throws SQLException?
Explain about addRowSetvoid addRowSet(RowSet rowset,             String columnName)               throws SQLException?
Explain about addRowSetvoid addRowSet(RowSet[] rowset,             int[] columnIdx)               throws SQLException?
Explain about addRowSetvoid addRowSet(RowSet[] rowset,             String[] columnName)               throws SQLException?
Explain about getRowSetsCollection<?> getRowSets()                         throws SQLException?
Explain getRowSetNamesString[] getRowSetNames()                        throws SQLException?
Explain toCachedRowSetCachedRowSet toCachedRowSet()                            throws SQLException?
Explain aboutpublic abstract class BaseRowSetextends Objectimplements Serializable, Cloneable?
Explain the difference between UNICODE_STREAM_PARAMpublic static final int UNICODE_STREAM_PARAM?
Explain the difference between BINARY_STREAM_PARAMpublic static final int BINARY_STREAM_PARAM?
Explain the difference between ASCII_STREAM_PARAMpublic static final int ASCII_STREAM_PARAM?
Explain the difference between binaryStreamprotected InputStream binaryStream?
Explain the difference between unicodeStreamprotected InputStream unicodeStream?
Explain the difference between asciiStreamprotected InputStream asciiStream?
Explain the difference between charStreamprotected Reader charStream?
Explain the difference between BaseRowSetpublic BaseRowSet()?
Explain the difference between initParamsprotected void initParams()?
Explain about addRowSetListenerpublic void addRowSetListener(RowSetListener listener)?
Explain about removeRowSetListenerpublic void removeRowSetListener(RowSetListener listener)?
Explain notifyCursorMovedprotected void notifyCursorMoved()                          throws SQLException?
Explain notifyRowChangedprotected void notifyRowChanged()                         throws SQLException?
Explain notifyRowSetChangedprotected void notifyRowSetChanged()                            throws SQLException?
Explain getCommandpublic String getCommand()
Explain about public void setCommand(String cmd)                throws SQLException
Explain about public String getUrl()              throws SQLException?
Explain about setUrlpublic void setUrl(String url)            throws SQLException?
Explain getDataSourceNamepublic String getDataSourceName()?
Explain setDataSourceNamepublic void setDataSourceName(String name)                       throws SQLException ?
Explain getUsernamepublic String getUsername( ) ?
Explain setUsernamepublic void setUsername(String name)?
Explain getPasswordpublic String getPassword()?
Explain method setPasswordpublic void setPassword(String pass)?
Explain method setTypepublic void setType(int type)             throws SQLException ?
Explain method getTypepublic int getType()            throws SQLException ?
Explain method setConcurrencypublic void setConcurrency(int concurrency)                    throws SQLException ?
Explain method isReadOnlypublic boolean isReadOnly()?
Explain method setReadOnlypublic void setReadOnly(boolean value) ?
Explain method getTransactionIsolationpublic int getTransactionIsolation() ?
Explain method setTransactionIsolationPublic void setTransactionIsolation(int level)                             throws SQLException
Explain method getTypeMappublic Map<String,Class<?>> getTypeMap()?
Explain method setTypeMappublic void setTypeMap(Map<String,Class<?>> map)?
Explain method getMaxFieldSizepublic int getMaxFieldSize()                    throws SQLException?
Explain method setMaxFieldSizepublic void setMaxFieldSize(int max)                     throws SQLException ?
Explain method getMaxRowspublic int getMaxRows()               throws SQLException?
Explain method setMaxRowspublic void setMaxRows(int max)                throws SQLException?
Explain method setEscapeProcessingpublic void setEscapeProcessing(boolean enable)                         throws SQLException ?
Explain method getQueryTimeoutpublic int getQueryTimeout()                    throws SQLException ?
Explain setQueryTimeoutpublic void setQueryTimeout(int seconds)                     throws SQLException ?
Explain method getShowDeletedpublic boolean getShowDeleted()                       throws SQLException ?
Explain public void setShowDeleted(boolean value)                    throws SQLException ?
Explain method getEscapeProcessingpublic boolean getEscapeProcessing()                            throws SQLException ?
Explain method setFetchDirectionpublic void setFetchDirection(int direction)                       throws SQLException ?
Explain method getFetchDirectionpublic int getFetchDirection()                      throws SQLException ?
Explain method setFetchSizepublic void setFetchSize(int rows)                  throws SQLException ?
Explain method getFetchSizepublic int getFetchSize()                 throws SQLException ?
Explain method getConcurrencypublic int getConcurrency()                   throws SQLException ?