src/java.sql.rowset/share/classes/com/sun/rowset/providers/RIOptimisticProvider.java
author lancea
Wed, 13 Mar 2019 14:10:18 -0400
changeset 54106 9a90236ab64c
parent 47216 71c04702a3d5
permissions -rw-r--r--
8220253: Fix Headings in java.sql.rowset Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
54106
9a90236ab64c 8220253: Fix Headings in java.sql.rowset
lancea
parents: 47216
diff changeset
     2
 * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package com.sun.rowset.providers;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import com.sun.rowset.JdbcRowSetResourceBundle;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import javax.sql.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.io.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import javax.sql.rowset.spi.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import com.sun.rowset.internal.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * The reference implementation of a JDBC Rowset synchronization provider
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * providing optimistic synchronization with a relational datastore
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * using any JDBC technology-enabled driver.
30655
d83f50188ca9 8080422: some docs cleanup for core libs
avstepan
parents: 25859
diff changeset
    39
 *
54106
9a90236ab64c 8220253: Fix Headings in java.sql.rowset
lancea
parents: 47216
diff changeset
    40
 * <h2>1.0 Backgroud</h2>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * This synchronization provider is registered with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * <code>SyncFactory</code> by default as the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * <code>com.sun.rowset.providers.RIOptimisticProvider</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * As an extension of the <code>SyncProvider</code> abstract
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * class, it provides the reader and writer classes required by disconnected
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * rowsets as <code>javax.sql.RowSetReader</code> and <code>javax.sql.RowSetWriter</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * interface implementations. As a reference implementation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * <code>RIOptimisticProvider</code> provides a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * fully functional implementation offering a medium grade classification of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * syncrhonization, namely GRADE_CHECK_MODIFIED_AT_COMMIT. A
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * disconnected <code>RowSet</code> implementation using the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * <code>RIOptimisticProvider</code> can expect the writer to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * check only rows that have been modified in the <code>RowSet</code> against
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * the values in the data source.  If there is a conflict, that is, if a value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * in the data source has been changed by another party, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * <code>RIOptimisticProvider</code> will not write any of the changes to the data
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * source and  will throw a <code>SyncProviderException</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 *
54106
9a90236ab64c 8220253: Fix Headings in java.sql.rowset
lancea
parents: 47216
diff changeset
    59
 * <h2>2.0 Usage</h2>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * Standard disconnected <code>RowSet</code> implementations may opt to use this
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * <code>SyncProvider</code> implementation in one of two ways:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * <OL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 *  <LI>By specifically calling the <code>setSyncProvider</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    defined in the <code>CachedRowSet</code> interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * <pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 *     CachedRowset crs = new FooCachedRowSetImpl();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 *     crs.setSyncProvider("com.sun.rowset.providers.RIOptimisticProvider");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 *  <LI>By specifying it in the constructor of the <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 *      implementation
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * <pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 *     CachedRowset crs = new FooCachedRowSetImpl(
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 *                         "com.sun.rowset.providers.RIOptimisticProvider");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * </OL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 * Note that because the <code>RIOptimisticProvider</code> implementation is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 * the default provider, it will always be the provider when no provider ID is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 * specified to the constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 * See the standard <code>RowSet</code> reference implementations in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 * <code>com.sun.rowset</code> package for more details.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 * @author  Jonathan Bruce
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 * @see javax.sql.rowset.spi.SyncProvider
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 * @see javax.sql.rowset.spi.SyncProviderException
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
 * @see javax.sql.rowset.spi.SyncFactory
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
 * @see javax.sql.rowset.spi.SyncFactoryException
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
public final class RIOptimisticProvider extends SyncProvider implements Serializable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    private CachedRowSetReader reader;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    private CachedRowSetWriter writer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    /**
6671
c5fbc05d7347 6984044: RowSet source needs to rebrand vendor references
lancea
parents: 6530
diff changeset
    96
     * The unique provider identifier.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    private String providerID = "com.sun.rowset.providers.RIOptimisticProvider";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * The vendor name of this SyncProvider implementation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     */
6671
c5fbc05d7347 6984044: RowSet source needs to rebrand vendor references
lancea
parents: 6530
diff changeset
   103
    private String vendorName = "Oracle Corporation";
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * The version number of this SyncProvider implementation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    private String versionNumber = "1.0";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * ResourceBundle
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    private JdbcRowSetResourceBundle resBundle;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * Creates an <code>RIOptimisticProvider</code> object initialized with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * fully qualified class name of this <code>SyncProvider</code> implementation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * and a default reader and writer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * This provider is available to all disconnected <code>RowSet</code> implementations
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     *  as the default persistence provider.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    public RIOptimisticProvider() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        providerID = this.getClass().getName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        reader = new CachedRowSetReader();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        writer = new CachedRowSetWriter();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
           resBundle = JdbcRowSetResourceBundle.getJdbcRowSetResourceBundle();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        } catch(IOException ioe) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
            throw new RuntimeException(ioe);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * Returns the <code>'javax.sql.rowset.providers.RIOptimisticProvider'</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * provider identification string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * @return String Provider ID of this persistence provider
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    public String getProviderID() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        return providerID;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * Returns the <code>javax.sql.RowSetWriter</code> object for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * <code>RIOptimisticProvider</code> object.  This is the writer that will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * write changes made to the <code>Rowset</code> object back to the data source.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * @return the <code>javax.sql.RowSetWriter</code> object for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     *     <code>RIOptimisticProvider</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    public RowSetWriter getRowSetWriter() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
            writer.setReader(reader);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        } catch (java.sql.SQLException e) {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        return writer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * Returns the <code>javax.sql.RowSetReader</code> object for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * <code>RIOptimisticProvider</code> object.  This is the reader that will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * populate a <code>RowSet</code> object using this <code>RIOptimisticProvider</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * @return the <code>javax.sql.RowSetReader</code> object for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     *     <code>RIOptimisticProvider</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    public RowSetReader getRowSetReader() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        return reader;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * Returns the <code>SyncProvider</code> grade of synchronization that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * <code>RowSet</code> objects can expect when using this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * implementation. As an optimisic synchonization provider, the writer
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * will only check rows that have been modified in the <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     * object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    public int getProviderGrade() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        return SyncProvider.GRADE_CHECK_MODIFIED_AT_COMMIT;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * Modifies the data source lock severity according to the standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * <code>SyncProvider</code> classifications.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * @param datasource_lock An <code>int</code> indicating the level of locking to be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     *        set; must be one of the following constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * <PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     *       SyncProvider.DATASOURCE_NO_LOCK,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     *       SyncProvider.DATASOURCE_ROW_LOCK,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     *       SyncProvider.DATASOURCE_TABLE_LOCK,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     *       SyncProvider.DATASOURCE_DB_LOCk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * @throws SyncProviderException if the parameter specified is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     *           <code>SyncProvider.DATASOURCE_NO_LOCK</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    public void setDataSourceLock(int datasource_lock) throws SyncProviderException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        if(datasource_lock != SyncProvider.DATASOURCE_NO_LOCK ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
          throw new SyncProviderException(resBundle.handleGetObject("riop.locking").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     * Returns the active data source lock severity in this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * reference implementation of the <code>SyncProvider</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     * abstract class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * @return <code>SyncProvider.DATASOURCE_NO_LOCK</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     *     The reference implementation does not support data source locks.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    public int getDataSourceLock() throws SyncProviderException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
        return SyncProvider.DATASOURCE_NO_LOCK;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * Returns the supported updatable view abilities of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * reference implementation of the <code>SyncProvider</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * abstract class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * @return <code>SyncProvider.NONUPDATABLE_VIEW_SYNC</code>. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     *     the reference implementation does not support updating tables
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     *     that are the source of a view.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    public int supportsUpdatableView() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        return SyncProvider.NONUPDATABLE_VIEW_SYNC;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     * Returns the release version ID of the Reference Implementation Optimistic
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * Synchronization Provider.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     * @return the <code>String</code> detailing the version number of this SyncProvider
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    public String getVersion() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
        return this.versionNumber;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    /**
6671
c5fbc05d7347 6984044: RowSet source needs to rebrand vendor references
lancea
parents: 6530
diff changeset
   239
     * Returns the vendor name of the Reference Implementation Optimistic
c5fbc05d7347 6984044: RowSet source needs to rebrand vendor references
lancea
parents: 6530
diff changeset
   240
     * Synchronization Provider
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * @return the <code>String</code> detailing the vendor name of this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     *      SyncProvider
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
    public String getVendor() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
        return this.vendorName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    }
6530
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
   248
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
   249
    private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
   250
        // Default state initialization happens here
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
   251
        ois.defaultReadObject();
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
   252
        // Initialization of transient Res Bundle happens here .
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
   253
        try {
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
   254
           resBundle = JdbcRowSetResourceBundle.getJdbcRowSetResourceBundle();
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
   255
        } catch(IOException ioe) {
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
   256
            throw new RuntimeException(ioe);
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
   257
        }
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
   258
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
   259
    }
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
   260
    static final long serialVersionUID =-3143367176751761936L;
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
   261
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
}