jdk/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java
author malenkov
Tue, 29 Oct 2013 17:01:06 +0400
changeset 21278 ef8a3a2a72f2
parent 14179 4681260d262a
child 23010 6dadb192ad81
permissions -rw-r--r--
8022746: List of spelling errors in API doc Reviewed-by: alexsch, smarks
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
14179
4681260d262a 8000763: use XXX.valueOf methods instead of constructors
lancea
parents: 12670
diff changeset
     2
 * Copyright (c) 2003, 2012, 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;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.io.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.util.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.sql.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import javax.sql.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.math.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import javax.sql.rowset.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import javax.sql.rowset.spi.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import javax.sql.rowset.serial.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import com.sun.rowset.providers.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import com.sun.rowset.internal.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * The standard implementation of the <code>FilteredRowSet</code> interface. See the interface
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 14179
diff changeset
    42
 * definition for full behavior and implementation requirements.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * @see javax.sql.rowset.Predicate
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * @author Jonathan Bruce, Amit Handa
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
public class FilteredRowSetImpl extends WebRowSetImpl implements Serializable, Cloneable, FilteredRowSet {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    private Predicate p;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    private boolean onInsertRow = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
     * Construct a <code>FilteredRowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    public FilteredRowSetImpl() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
        super();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * Construct a <code>FilteredRowSet</code> with a specified synchronization
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * provider.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * @param env a Hashtable containing a desired synchconizatation provider
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     * name-value pair.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
    69
    @SuppressWarnings("rawtypes")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    public FilteredRowSetImpl(Hashtable env) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        super(env);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * Apply the predicate for this filter
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     * @param p an implementation of the predicate interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    public void setFilter(Predicate p) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
        this.p = p;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * Retrieve the filter active for this <code>FilteredRowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * @return a <code>Predicate</code> object instance
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    public Predicate getFilter() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        return this.p;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * Over-riding <code>internalNext()</code> implementation. This method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * applies the filter on the <code>RowSet</code> each time the cursor is advanced or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * manipulated. It moves the cursor to the next row according to the set
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * predicate and returns <code>true</code> if the cursor is still within the rowset or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * <code>false</code> if the cursor position is over the last row
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * @return true if over the valid row in the rowset; false if over the last
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * row
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    protected boolean internalNext() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        // CachedRowSetImpl.next() internally calls
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        // this(crs).internalNext() NOTE: this holds crs object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        // So when frs.next() is called,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        // internally this(frs).internalNext() will be called
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        // which will be nothing but this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        // because this holds frs object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        // keep on doing super.internalNext()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        // rather than doing it once.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
         // p.evaluate will help us in changing the cursor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
         // and checking the next value by returning true or false.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
         // to fit the filter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
         // So while() loop will have a "random combination" of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
         // true and false returned depending upon the records
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
         // are in or out of filter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
         // We need to traverse from present cursorPos till end,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
         // whether true or false and check each row for "filter"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
         // "till we get a "true"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
         boolean bool = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
         for(int rows=this.getRow(); rows<=this.size();rows++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
             bool = super.internalNext();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
12670
6cf9bd9a9302 7166598: FilteredRowSetImpl can result in Invalid Cursor Position
lancea
parents: 11129
diff changeset
   131
             if( !bool || p == null) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
               return bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
             if(p.evaluate(this)){
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
                   break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
       return bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    }
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
     * Over-riding <code>internalPrevious()</code> implementation. This method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * applies the filter on the <code>RowSet</code> each time the cursor is moved backward or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * manipulated. It moves the cursor to the previous row according to the set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * predicate and returns <code>true</code> if the cursor is still within the rowset or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * <code>false</code> if the cursor position is over the last row
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * @return true if over the valid row in the rowset; false if over the last
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * row
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    protected boolean internalPrevious() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
         boolean bool = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
         // with previous move backwards,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
         // i.e. from any record towards first record
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
         for(int rows=this.getRow(); rows>0;rows--) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
             bool = super.internalPrevious();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
             if( p == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
               return bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
             if(p.evaluate(this)){
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
                   break;
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
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
       return bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * Over-riding <code>internalFirst()</code> implementation. This method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * applies the filter on the <code>RowSet</code> each time the cursor is moved to first
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * row. It moves the cursor to the first row according to the set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * predicate and returns <code>true</code> if the cursor is still within the rowset or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * <code>false</code> if the cursor position is over the last row
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * @return true if over the valid row in the rowset; false if over the last
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     * row
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    protected boolean internalFirst() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
        // from first till present cursor position(go forward),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
        // find the actual first which matches the filter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
         boolean bool = super.internalFirst();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
         if( p == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
               return bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
         while(bool) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
             if(p.evaluate(this)){
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
                   break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        bool = super.internalNext();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     return bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * Over-riding <code>internalLast()</code> implementation. This method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * applies the filter on the <code>RowSet</code> each time the cursor is moved to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * last row. It moves the cursor to the last row according to the set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * predicate and returns <code>true</code> if the cursor is still within the rowset or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * <code>false</code> if the cursor position is over the last row
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * @return true if over the valid row in the rowset; false if over the last
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * row
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    protected boolean internalLast() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
        // from last to the present cursor position(go backward),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        // find the actual last which matches the filter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
         boolean bool = super.internalLast();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
         if( p == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
               return bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
         while(bool) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
             if(p.evaluate(this)){
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
                   break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
        bool = super.internalPrevious();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     return bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
   } // end internalLast()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * Moves the cursor the specified number of rows from the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     * position, with a positive number moving it forward and a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * negative number moving it backward.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     * If the number is positive, the cursor moves the specified number of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * rows toward the end of the rowset, starting at the current row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     * For example, the following command, in which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     * <code>crs</code> is a <code>CachedRowSetImpl</code> object with 100 rows,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     * moves the cursor forward four rows from the current row.  If the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * current row is 50, the cursor would move to row 54.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     * <PRE><code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     *    crs.relative(4);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * </code> </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     * If the number is negative, the cursor moves back toward the beginning
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * the specified number of rows, starting at the current row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     * For example, calling the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     * <code>absolute(-1)</code> positions the cursor on the last row,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * <code>absolute(-2)</code> moves it on the next-to-last row, and so on.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     * If the <code>CachedRowSetImpl</code> object <code>crs</code> has five rows,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * the following command moves the cursor to the fourth-to-last row, which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * in the case of a  rowset with five rows, is also the second row
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * from the beginning.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * <PRE><code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     *    crs.absolute(-4);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * </code> </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * If the number specified is larger than the number of rows, the cursor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     * will move to the position after the last row. If the number specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     * would move the cursor one or more rows before the first row, the cursor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     * moves to the position before the first row. In both cases, this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
     * throws an <code>SQLException</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     * Note: Calling <code>absolute(1)</code> is the same as calling the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     * method <code>first()</code>.  Calling <code>absolute(-1)</code> is the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     * same as calling <code>last()</code>.  Calling <code>relative(0)</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     * is valid, but it does not change the cursor position.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     * @param rows an <code>int</code> indicating the number of rows to move
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     *             the cursor, starting at the current row; a positive number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     *             moves the cursor forward; a negative number moves the cursor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
     *             backward; must not move the cursor past the valid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     *             rows
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     * @return <code>true</code> if the cursor is on a row in this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     *         <code>CachedRowSetImpl</code> object; <code>false</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     *         otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * @throws SQLException if the rowset is type <code>ResultSet.TYPE_FORWARD_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
   public boolean relative(int rows) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
      boolean retval;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
      boolean bool = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
      boolean boolval = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
      if(getType() == ResultSet.TYPE_FORWARD_ONLY) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
         throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.relative").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
      if( rows > 0 ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
         int i = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
         while( i < (rows)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
            if( isAfterLast() ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
               return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
            bool = internalNext();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
            i++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
         retval = bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
      } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
         int j = rows;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
         while( (j) < 0 ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
           if( isBeforeFirst() ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
              return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
           }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
           boolval = internalPrevious();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
           j++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
         retval = boolval;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
      if(rows != 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
          notifyCursorMoved();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
      return retval;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     * Moves this <code>CachedRowSetImpl</code> object's cursor to the row number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
     * specified.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     * <p>If the number is positive, the cursor moves to an absolute row with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     * respect to the beginning of the rowset.  The first row is row 1, the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
     * is row 2, and so on.  For example, the following command, in which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     * <code>crs</code> is a <code>CachedRowSetImpl</code> object, moves the cursor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     * to the fourth row, starting from the beginning of the rowset.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     * <PRE><code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     *    crs.absolute(4);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
     * </code> </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     * If the number is negative, the cursor moves to an absolute row position
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     * with respect to the end of the rowset.  For example, calling
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     * <code>absolute(-1)</code> positions the cursor on the last row,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     * <code>absolute(-2)</code> moves it on the next-to-last row, and so on.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     * If the <code>CachedRowSetImpl</code> object <code>crs</code> has five rows,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     * the following command moves the cursor to the fourth-to-last row, which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     * in the case of a  rowset with five rows, is also the second row, counting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     * from the beginning.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     * <PRE><code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     *    crs.absolute(-4);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
     * </code> </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     * If the number specified is larger than the number of rows, the cursor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     * will move to the position after the last row. If the number specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     * would move the cursor one or more rows before the first row, the cursor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     * moves to the position before the first row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     * Note: Calling <code>absolute(1)</code> is the same as calling the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     * method <code>first()</code>.  Calling <code>absolute(-1)</code> is the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
     * same as calling <code>last()</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
     * @param rows a positive number to indicate the row, starting row numbering from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
     *        the first row, which is <code>1</code>; a negative number to indicate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     *        the row, starting row numbering from the last row, which is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     *        <code>-1</code>; it must not be <code>0</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     * @return <code>true</code> if the cursor is on the rowset; <code>false</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     *         otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     * @throws SQLException if the given cursor position is <code>0</code> or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     *            type of this rowset is <code>ResultSet.TYPE_FORWARD_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
    public boolean absolute(int rows) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
      boolean retval;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
      boolean bool = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
      if(rows == 0 || getType() == ResultSet.TYPE_FORWARD_ONLY) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
         throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.absolute").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
      if (rows > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
         bool = internalFirst();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
         int i = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
         while(i < (rows-1)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
            if( isAfterLast() ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
               return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
            bool = internalNext();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
            i++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
         retval = bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
      } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
         bool = internalLast();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
         int j = rows;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
         while((j+1) < 0 ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
            if( isBeforeFirst() ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
               return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
            bool = internalPrevious();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
            j++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
         retval = bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
      notifyCursorMoved();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
      return retval;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * Moves the cursor for this <code>CachedRowSetImpl</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * to the insert row.  The current row in the rowset is remembered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     * while the cursor is on the insert row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * The insert row is a special row associated with an updatable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * rowset.  It is essentially a buffer where a new row may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * be constructed by calling the appropriate <code>updateXXX</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     * methods to assign a value to each column in the row.  A complete
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     * row must be constructed; that is, every column that is not nullable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     * must be assigned a value.  In order for the new row to become part
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     * of this rowset, the method <code>insertRow</code> must be called
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     * before the cursor is moved back to the rowset.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     * Only certain methods may be invoked while the cursor is on the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     * row; many methods throw an exception if they are called while the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     * cursor is there.  In addition to the <code>updateXXX</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
     * and <code>insertRow</code> methods, only the <code>getXXX</code> methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
     * may be called when the cursor is on the insert row.  A <code>getXXX</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
     * method should be called on a column only after an <code>updateXXX</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     * method has been called on that column; otherwise, the value returned is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
     * undetermined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
     * @throws SQLException if this <code>CachedRowSetImpl</code> object is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
     *            <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
   public void moveToInsertRow() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
      onInsertRow = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
      super.moveToInsertRow();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
     * This is explanation for the overriding of the updateXXX functions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     * These functions have been overriden to ensure that only correct
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
     * values that pass the criteria for the filter are actaully inserted.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
     * The evaluation of whether a particular value passes the criteria
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     * of the filter is done using the evaluate function in the Predicate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     * interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
     * The checking can will done in the evaluate function which is implemented
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
     * in the class that implements the Predicate interface. So the checking
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     * can vary from one implementation to another.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
     * Some additional points here on the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
     * 1. updateBytes()     - since the evaluate function takes Object as parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     *                        a String is constructed from the byte array and would
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     *                        passed to the evaluate function.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     * 2. updateXXXstream() - here it would suffice to pass the stream handle
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
     *                        to the evaluate function and the implementation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
     *                        of the evaluate function can do the comparision
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
     *                        based on the stream and also type of data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
     * <code>int</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
     * This method updates a column value in the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
     * row of this rowset, but it does not update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
     * If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
     * @param columnIndex the first column is <code>1</code>, the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
     *        is <code>2</code>, and so on; must be <code>1</code> or larger
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
     *        and equal to or less than the number of columns in this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
     * @throws SQLException if (1) the given column index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
     *            (2) the cursor is not on one of this rowset's rows or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
     *            insert row, or (3) this rowset is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
     *            <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
   public void updateInt(int columnIndex , int x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     boolean bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
     if(onInsertRow) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
        if(p != null) {
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
   503
           bool = p.evaluate(Integer.valueOf(x),columnIndex);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
           if(!bool) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
              throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.notallowed").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
           }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
     super.updateInt(columnIndex,x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
     * <code>int</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     * This method updates a column value in the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
     * row of this rowset, but it does not update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     * If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
     * @param columnName a <code>String</code> object that must match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
     *        SQL name of a column in this rowset, ignoring case
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
     * @throws SQLException if (1) the given column name does not match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
     *            name of a column in this rowset, (2) the cursor is not on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
     *            one of this rowset's rows or its insert row, or (3) this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
     *            rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
   public void updateInt(String columnName , int x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
       this.updateInt(findColumn(columnName), x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
     * <code>boolean</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
     * This method updates a column value in the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
     * row of this rowset, but it does not update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
     * If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
     * @param columnIndex the first column is <code>1</code>, the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
     *        is <code>2</code>, and so on; must be <code>1</code> or larger
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
     *        and equal to or less than the number of columns in this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
     * @throws SQLException if (1) the given column index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
     *            (2) the cursor is not on one of this rowset's rows or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
     *            insert row, or (3) this rowset is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
     *            <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
   public void updateBoolean(int columnIndex, boolean x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
      boolean bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
      if(onInsertRow) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
         if(p != null) {
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
   570
            bool = p.evaluate(Boolean.valueOf(x) , columnIndex);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
            if(!bool) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
               throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.notallowed").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
      super.updateBoolean(columnIndex,x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
     * <code>boolean</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
     * This method updates a column value in the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
     * row of this rowset, but it does not update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
     * If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
     * @param columnName a <code>String</code> object that must match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
     *        SQL name of a column in this rowset, ignoring case
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
     * @throws SQLException if (1) the given column name does not match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
     *            name of a column in this rowset, (2) the cursor is not on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
     *            one of this rowset's rows or its insert row, or (3) this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
     *            rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
   public void updateBoolean(String columnName , boolean x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
      this.updateBoolean(findColumn(columnName),x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
     * <code>byte</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
     * This method updates a column value in the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
     * row of this rowset, but it does not update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
     * If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
     * @param columnIndex the first column is <code>1</code>, the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
     *        is <code>2</code>, and so on; must be <code>1</code> or larger
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
     *        and equal to or less than the number of columns in this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
     * @throws SQLException if (1) the given column index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
     *            (2) the cursor is not on one of this rowset's rows or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
     *            insert row, or (3) this rowset is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
     *            <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
   public void updateByte(int columnIndex , byte x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
      boolean bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
      if(onInsertRow) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
         if(p != null) {
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
   638
            bool = p.evaluate(Byte.valueOf(x),columnIndex);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
            if(!bool) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
                throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.notallowed").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
          }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
      super.updateByte(columnIndex,x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
     * <code>byte</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
     * This method updates a column value in the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
     * row of this rowset, but it does not update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
     * If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
     * @param columnName a <code>String</code> object that must match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
     *        SQL name of a column in this rowset, ignoring case
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
     * @throws SQLException if (1) the given column name does not match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
     *            name of a column in this rowset, (2) the cursor is not on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
     *            one of this rowset's rows or its insert row, or (3) this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
     *            rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
   public void updateByte(String columnName , byte x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
      this.updateByte(findColumn(columnName),x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
     * <code>short</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
     * This method updates a column value in the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
     * row of this rowset, but it does not update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
     * If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
     * @param columnIndex the first column is <code>1</code>, the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
     *        is <code>2</code>, and so on; must be <code>1</code> or larger
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
     *        and equal to or less than the number of columns in this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
     * @throws SQLException if (1) the given column index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
     *            (2) the cursor is not on one of this rowset's rows or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
     *            insert row, or (3) this rowset is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
     *            <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
   public void updateShort( int columnIndex , short x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
      boolean bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
      if(onInsertRow) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
         if(p != null) {
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
   707
            bool = p.evaluate(Short.valueOf(x), columnIndex);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
            if(!bool) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
               throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.notallowed").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
          }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
      super.updateShort(columnIndex,x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
     * <code>short</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
     * This method updates a column value in the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
     * row of this rowset, but it does not update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
     * If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   728
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
     * @param columnName a <code>String</code> object that must match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
     *        SQL name of a column in this rowset, ignoring case
90ce3da70b43 Initial load
duke
parents:
diff changeset
   734
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   735
     * @throws SQLException if (1) the given column name does not match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
     *            name of a column in this rowset, (2) the cursor is not on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   737
     *            one of this rowset's rows or its insert row, or (3) this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
     *            rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
   public void updateShort( String columnName , short x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   741
90ce3da70b43 Initial load
duke
parents:
diff changeset
   742
      this.updateShort(findColumn(columnName),x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   743
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
     * <code>long</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   751
     * This method updates a column value in the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
     * row of this rowset, but it does not update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
     * If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
     * @param columnIndex the first column is <code>1</code>, the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
     *        is <code>2</code>, and so on; must be <code>1</code> or larger
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
     *        and equal to or less than the number of columns in this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
     * @throws SQLException if (1) the given column index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
     *            (2) the cursor is not on one of this rowset's rows or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
   766
     *            insert row, or (3) this rowset is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
     *            <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
   public void updateLong(int columnIndex , long x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
      boolean bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   772
90ce3da70b43 Initial load
duke
parents:
diff changeset
   773
      if(onInsertRow) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
         if(p != null) {
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
   775
            bool = p.evaluate(Long.valueOf(x), columnIndex);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   776
90ce3da70b43 Initial load
duke
parents:
diff changeset
   777
            if(!bool) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   778
               throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.notallowed").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   779
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   780
          }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   781
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
90ce3da70b43 Initial load
duke
parents:
diff changeset
   783
      super.updateLong(columnIndex,x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   784
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
90ce3da70b43 Initial load
duke
parents:
diff changeset
   786
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
     * <code>long</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   791
     * This method updates a column value in the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   792
     * row of this rowset, but it does not update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   793
     * If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   795
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   799
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   800
     * @param columnName a <code>String</code> object that must match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   801
     *        SQL name of a column in this rowset, ignoring case
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
     * @throws SQLException if (1) the given column name does not match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   804
     *            name of a column in this rowset, (2) the cursor is not on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   805
     *            one of this rowset's rows or its insert row, or (3) this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   806
     *            rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   807
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   808
   public void updateLong( String columnName , long x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   809
90ce3da70b43 Initial load
duke
parents:
diff changeset
   810
      this.updateLong(findColumn(columnName) , x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   811
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   812
90ce3da70b43 Initial load
duke
parents:
diff changeset
   813
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   814
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   815
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   816
     * <code>float</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   817
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   818
     * This method updates a column value in the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   819
     * row of this rowset, but it does not update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   820
     * If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   821
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   826
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   827
     * @param columnIndex the first column is <code>1</code>, the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
   828
     *        is <code>2</code>, and so on; must be <code>1</code> or larger
90ce3da70b43 Initial load
duke
parents:
diff changeset
   829
     *        and equal to or less than the number of columns in this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   830
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   831
     * @throws SQLException if (1) the given column index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   832
     *            (2) the cursor is not on one of this rowset's rows or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
   833
     *            insert row, or (3) this rowset is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
     *            <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   836
   public void updateFloat(int columnIndex , float x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   837
90ce3da70b43 Initial load
duke
parents:
diff changeset
   838
      boolean bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
      if(onInsertRow) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   841
         if(p != null) {
14179
4681260d262a 8000763: use XXX.valueOf methods instead of constructors
lancea
parents: 12670
diff changeset
   842
            bool = p.evaluate(Float.valueOf(x), columnIndex);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   843
90ce3da70b43 Initial load
duke
parents:
diff changeset
   844
            if(!bool) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   845
               throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.notallowed").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   847
          }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   849
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
      super.updateFloat(columnIndex,x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   852
90ce3da70b43 Initial load
duke
parents:
diff changeset
   853
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   854
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   855
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   856
     * <code>float</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   857
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   858
     * This method updates a column value in the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   859
     * row of this rowset, but it does not update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   860
     * If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   861
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   862
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   863
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   864
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   865
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   866
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   867
     * @param columnName a <code>String</code> object that must match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   868
     *        SQL name of a column in this rowset, ignoring case
90ce3da70b43 Initial load
duke
parents:
diff changeset
   869
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   870
     * @throws SQLException if (1) the given column name does not match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   871
     *            name of a column in this rowset, (2) the cursor is not on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   872
     *            one of this rowset's rows or its insert row, or (3) this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   873
     *            rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   874
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   875
   public void updateFloat(String columnName , float x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   876
90ce3da70b43 Initial load
duke
parents:
diff changeset
   877
      this.updateFloat(findColumn(columnName),x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   878
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   879
90ce3da70b43 Initial load
duke
parents:
diff changeset
   880
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   881
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   883
     * <code>double</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   884
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   885
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   886
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   887
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   888
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   889
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   890
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   891
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   892
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   893
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   894
     * @param columnIndex the first column is <code>1</code>, the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
   895
     *        is <code>2</code>, and so on; must be <code>1</code> or larger
90ce3da70b43 Initial load
duke
parents:
diff changeset
   896
     *        and equal to or less than the number of columns in this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   897
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   898
     * @throws SQLException if (1) the given column index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   899
     *            (2) the cursor is not on one of this rowset's rows or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
   900
     *            insert row, or (3) this rowset is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   901
     *            <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   902
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   903
   public void updateDouble(int columnIndex , double x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   904
90ce3da70b43 Initial load
duke
parents:
diff changeset
   905
      boolean bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
90ce3da70b43 Initial load
duke
parents:
diff changeset
   907
      if(onInsertRow) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   908
         if(p != null) {
14179
4681260d262a 8000763: use XXX.valueOf methods instead of constructors
lancea
parents: 12670
diff changeset
   909
            bool = p.evaluate(Double.valueOf(x) , columnIndex);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   910
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
            if(!bool) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   912
               throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.notallowed").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   913
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   914
          }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   915
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   916
90ce3da70b43 Initial load
duke
parents:
diff changeset
   917
      super.updateDouble(columnIndex,x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   918
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   919
90ce3da70b43 Initial load
duke
parents:
diff changeset
   920
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   921
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   922
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   923
     * <code>double</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   924
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   925
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   926
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   927
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   928
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   929
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   930
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   931
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   932
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   933
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
     * @param columnName a <code>String</code> object that must match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
     *        SQL name of a column in this rowset, ignoring case
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   937
     * @throws SQLException if (1) the given column name does not match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   938
     *            name of a column in this rowset, (2) the cursor is not on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   939
     *            one of this rowset's rows or its insert row, or (3) this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   940
     *            rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   941
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   942
   public void updateDouble(String columnName , double x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   943
90ce3da70b43 Initial load
duke
parents:
diff changeset
   944
      this.updateDouble(findColumn(columnName),x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   945
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   946
90ce3da70b43 Initial load
duke
parents:
diff changeset
   947
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   948
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   949
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   950
     * <code>java.math.BigDecimal</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   951
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   952
     * This method updates a column value in the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   953
     * row of this rowset, but it does not update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   954
     * If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   955
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   956
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   957
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   958
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   959
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   960
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   961
     * @param columnIndex the first column is <code>1</code>, the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
   962
     *        is <code>2</code>, and so on; must be <code>1</code> or larger
90ce3da70b43 Initial load
duke
parents:
diff changeset
   963
     *        and equal to or less than the number of columns in this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   964
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   965
     * @throws SQLException if (1) the given column index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   966
     *            (2) the cursor is not on one of this rowset's rows or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
   967
     *            insert row, or (3) this rowset is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   968
     *            <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   969
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   970
   public void updateBigDecimal(int columnIndex , BigDecimal x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   971
90ce3da70b43 Initial load
duke
parents:
diff changeset
   972
      boolean bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   973
90ce3da70b43 Initial load
duke
parents:
diff changeset
   974
      if(onInsertRow) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   975
         if(p != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   976
            bool = p.evaluate(x,columnIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   977
90ce3da70b43 Initial load
duke
parents:
diff changeset
   978
            if(!bool) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   979
               throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.notallowed").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   980
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   981
          }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   982
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   983
90ce3da70b43 Initial load
duke
parents:
diff changeset
   984
      super.updateBigDecimal(columnIndex,x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   985
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   986
90ce3da70b43 Initial load
duke
parents:
diff changeset
   987
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   988
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   989
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   990
     * <code>java.math.BigDecimal</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   991
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   992
     * This method updates a column value in the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
   993
     * row of this rowset, but it does not update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   994
     * If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   995
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   996
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   997
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   998
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   999
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1000
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1001
     * @param columnName a <code>String</code> object that must match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1002
     *        SQL name of a column in this rowset, ignoring case
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1003
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1004
     * @throws SQLException if (1) the given column name does not match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1005
     *            name of a column in this rowset, (2) the cursor is not on
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1006
     *            one of this rowset's rows or its insert row, or (3) this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1007
     *            rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1009
   public void updateBigDecimal(String columnName , BigDecimal x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1010
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1011
      this.updateBigDecimal(findColumn(columnName),x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1012
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1013
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1014
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1015
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1016
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1017
     * <code>String</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1018
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1019
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1020
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1021
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1022
     * method {@link #updateRow} must be called to mark the row as updated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1023
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1024
     * must be called to insert the new row into this rowset and mark it
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1025
     * as inserted. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1026
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1027
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1028
     * The method <code>acceptChanges</code> must be called if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1029
     * updated values are to be written back to the underlying database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1030
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1031
     * @param columnIndex the first column is <code>1</code>, the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1032
     *        is <code>2</code>, and so on; must be <code>1</code> or larger
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1033
     *        and equal to or less than the number of columns in this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1034
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1035
     * @throws SQLException if (1) the given column index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1036
     *            (2) the cursor is not on one of this rowset's rows or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1037
     *            insert row, or (3) this rowset is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1038
     *            <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1039
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1040
   public void updateString(int columnIndex , String x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1041
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1042
      boolean bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1043
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1044
      if(onInsertRow) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1045
         if(p != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1046
           bool = p.evaluate(x,columnIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1047
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1048
           if(!bool) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1049
              throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.notallowed").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1050
           }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1051
         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1052
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1053
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1054
      super.updateString(columnIndex,x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1055
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1056
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1057
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1058
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1059
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1060
     * <code>String</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1061
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1062
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1063
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1064
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1065
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1066
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1067
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1068
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1069
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1070
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1071
     * @param columnName a <code>String</code> object that must match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1072
     *        SQL name of a column in this rowset, ignoring case
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1073
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1074
     * @throws SQLException if (1) the given column name does not match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1075
     *            name of a column in this rowset, (2) the cursor is not on
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1076
     *            one of this rowset's rows or its insert row, or (3) this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1077
     *            rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1078
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1079
   public void updateString(String columnName , String x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1080
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1081
      this.updateString(findColumn(columnName),x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1082
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1083
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1084
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1085
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1086
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1087
     * <code>byte</code> array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1088
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1089
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1090
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1091
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1092
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1093
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1094
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1095
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1096
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1097
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1098
     * @param columnIndex the first column is <code>1</code>, the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1099
     *        is <code>2</code>, and so on; must be <code>1</code> or larger
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1100
     *        and equal to or less than the number of columns in this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1101
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1102
     * @throws SQLException if (1) the given column index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1103
     *            (2) the cursor is not on one of this rowset's rows or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1104
     *            insert row, or (3) this rowset is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1105
     *            <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1106
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1107
   public void updateBytes(int columnIndex , byte []x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1108
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1109
      boolean bool;
6692
aef4e294026f 6988993: Address Findbugs warnings for the use of String Constructor
lancea
parents: 6530
diff changeset
  1110
      String val = "";
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1111
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1112
      Byte [] obj_arr = new Byte[x.length];
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1113
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1114
      for(int i = 0; i < x.length; i++) {
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 6692
diff changeset
  1115
         obj_arr[i] = Byte.valueOf(x[i]);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1116
         val = val.concat(obj_arr[i].toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1117
     }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1118
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1119
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1120
      if(onInsertRow) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1121
         if(p != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1122
             bool = p.evaluate(val,columnIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1123
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1124
             if(!bool) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1125
                 throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.notallowed").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1126
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1127
         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1128
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1129
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1130
      super.updateBytes(columnIndex,x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1131
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1132
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1133
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1134
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1135
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1136
     * <code>byte</code> array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1137
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1138
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1139
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1140
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1141
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1142
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1143
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1144
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1145
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1146
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1147
     * @param columnName a <code>String</code> object that must match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1148
     *        SQL name of a column in this rowset, ignoring case
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1149
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1150
     * @throws SQLException if (1) the given column name does not match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1151
     *            name of a column in this rowset, (2) the cursor is not on
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1152
     *            one of this rowset's rows or its insert row, or (3) this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1153
     *            rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1154
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1155
   public void updateBytes(String columnName , byte []x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1156
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1157
      this.updateBytes(findColumn(columnName),x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1158
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1159
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1160
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1161
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1162
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1163
     * <code>Date</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1164
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1165
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1166
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1167
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1168
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1169
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1170
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1171
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1172
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1173
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1174
     * @param columnIndex the first column is <code>1</code>, the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1175
     *        is <code>2</code>, and so on; must be <code>1</code> or larger
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1176
     *        and equal to or less than the number of columns in this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1177
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1178
     * @throws SQLException if (1) the given column index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1179
     *            (2) the cursor is not on one of this rowset's rows or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1180
     *            insert row, (3) the type of the designated column is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1181
     *            an SQL <code>DATE</code> or <code>TIMESTAMP</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1182
     *            (4) this rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1183
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1184
   public void updateDate(int columnIndex , java.sql.Date x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1185
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1186
      boolean bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1187
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1188
      if(onInsertRow) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1189
         if(p != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1190
             bool = p.evaluate(x,columnIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1191
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1192
             if(!bool) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1193
                 throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.notallowed").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1194
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1195
         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1196
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1197
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1198
      super.updateDate(columnIndex,x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1199
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1200
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1201
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1202
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1203
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1204
     * <code>Date</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1205
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1206
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1207
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1208
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1209
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1210
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1211
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1212
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1213
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1214
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1215
     * @param columnName a <code>String</code> object that must match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1216
     *        SQL name of a column in this rowset, ignoring case
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1217
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1218
     * @throws SQLException if (1) the given column name does not match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1219
     *            name of a column in this rowset, (2) the cursor is not on
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1220
     *            one of this rowset's rows or its insert row, (3) the type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1221
     *            of the designated column is not an SQL <code>DATE</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1222
     *            <code>TIMESTAMP</code>, or (4) this rowset is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1223
     *            <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1224
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1225
   public void updateDate(String columnName , java.sql.Date x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1226
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1227
      this.updateDate(findColumn(columnName),x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1228
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1229
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1230
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1231
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1232
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1233
     * <code>Time</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1234
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1235
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1236
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1237
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1238
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1239
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1240
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1241
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1242
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1243
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1244
     * @param columnIndex the first column is <code>1</code>, the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1245
     *        is <code>2</code>, and so on; must be <code>1</code> or larger
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1246
     *        and equal to or less than the number of columns in this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1247
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1248
     * @throws SQLException if (1) the given column index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1249
     *            (2) the cursor is not on one of this rowset's rows or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1250
     *            insert row, (3) the type of the designated column is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1251
     *            an SQL <code>TIME</code> or <code>TIMESTAMP</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1252
     *            (4) this rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1253
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1254
   public void updateTime(int columnIndex , Time x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1255
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1256
      boolean bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1257
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1258
      if(onInsertRow) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1259
         if(p != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1260
             bool = p.evaluate(x, columnIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1261
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1262
             if(!bool) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1263
                 throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.notallowed").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1264
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1265
         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1266
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1267
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1268
      super.updateTime(columnIndex,x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1269
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1270
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1271
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1272
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1273
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1274
     * <code>Time</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1275
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1276
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1277
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1278
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1279
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1280
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1281
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1282
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1283
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1284
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1285
     * @param columnName a <code>String</code> object that must match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1286
     *        SQL name of a column in this rowset, ignoring case
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1287
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1288
     * @throws SQLException if (1) the given column name does not match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1289
     *            name of a column in this rowset, (2) the cursor is not on
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1290
     *            one of this rowset's rows or its insert row, (3) the type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1291
     *            of the designated column is not an SQL <code>TIME</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1292
     *            <code>TIMESTAMP</code>, or (4) this rowset is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1293
     *            <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1294
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1295
   public void updateTime(String columnName , Time x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1296
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1297
      this.updateTime(findColumn(columnName),x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1298
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1299
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1300
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1301
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1302
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1303
     * <code>Timestamp</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1304
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1305
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1306
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1307
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1308
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1309
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1310
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1311
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1312
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1313
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1314
     * @param columnIndex the first column is <code>1</code>, the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1315
     *        is <code>2</code>, and so on; must be <code>1</code> or larger
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1316
     *        and equal to or less than the number of columns in this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1317
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1318
     * @throws SQLException if (1) the given column index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1319
     *            (2) the cursor is not on one of this rowset's rows or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1320
     *            insert row, (3) the type of the designated column is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1321
     *            an SQL <code>DATE</code>, <code>TIME</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1322
     *            <code>TIMESTAMP</code>, or (4) this rowset is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1323
     *            <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1324
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1325
   public void updateTimestamp(int columnIndex , Timestamp x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1326
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1327
      boolean bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1328
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1329
      if(onInsertRow) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1330
         if(p != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1331
             bool = p.evaluate(x,columnIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1332
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1333
             if(!bool) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1334
                 throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.notallowed").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1335
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1336
         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1337
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1338
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1339
      super.updateTimestamp(columnIndex,x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1340
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1341
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1342
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1343
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1344
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1345
     * <code>Timestamp</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1346
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1347
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1348
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1349
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1350
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1351
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1352
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1353
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1354
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1355
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1356
     * @param columnName a <code>String</code> object that must match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1357
     *        SQL name of a column in this rowset, ignoring case
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1358
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1359
     * @throws SQLException if the given column index is out of bounds or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1360
     *            the cursor is not on one of this rowset's rows or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1361
     *            insert row
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1362
     * @throws SQLException if (1) the given column name does not match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1363
     *            name of a column in this rowset, (2) the cursor is not on
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1364
     *            one of this rowset's rows or its insert row, (3) the type
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1365
     *            of the designated column is not an SQL <code>DATE</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1366
     *            <code>TIME</code>, or <code>TIMESTAMP</code>, or (4) this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1367
     *            rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1368
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1369
   public void updateTimestamp(String columnName , Timestamp x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1370
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1371
      this.updateTimestamp(findColumn(columnName),x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1372
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1373
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1374
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1375
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1376
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1377
     * ASCII stream value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1378
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1379
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1380
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1381
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1382
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1383
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1384
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1385
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1386
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1387
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1388
     * @param columnIndex the first column is <code>1</code>, the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1389
     *        is <code>2</code>, and so on; must be <code>1</code> or larger
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1390
     *        and equal to or less than the number of columns in this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1391
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1392
     * @param length the number of one-byte ASCII characters in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1393
     * @throws SQLException if this method is invoked
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1394
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1395
   public void updateAsciiStream(int columnIndex , java.io.InputStream x ,int length) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1396
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1397
      boolean bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1398
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1399
      if(onInsertRow) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1400
         if(p != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1401
             bool = p.evaluate(x,columnIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1402
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1403
             if(!bool) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1404
                 throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.notallowed").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1405
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1406
         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1407
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1408
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1409
      super.updateAsciiStream(columnIndex,x,length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1410
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1411
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1412
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1413
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1414
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1415
     * ASCII stream value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1416
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1417
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1418
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1419
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1420
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1421
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1422
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1423
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1424
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1425
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1426
     * @param columnName a <code>String</code> object that must match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1427
     *        SQL name of a column in this rowset, ignoring case
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1428
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1429
     * @param length the number of one-byte ASCII characters in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1430
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1431
   public void updateAsciiStream(String columnName , java.io.InputStream x , int length) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1432
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1433
      this.updateAsciiStream(findColumn(columnName),x,length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1434
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1435
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1436
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1437
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1438
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1439
     * <code>java.io.Reader</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1440
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1441
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1442
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1443
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1444
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1445
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1446
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1447
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1448
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1449
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1450
     * @param columnIndex the first column is <code>1</code>, the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1451
     *        is <code>2</code>, and so on; must be <code>1</code> or larger
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1452
     *        and equal to or less than the number of columns in this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1453
     * @param x the new column value; must be a <code>java.io.Reader</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1454
     *          containing <code>BINARY</code>, <code>VARBINARY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1455
     *          <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1456
     *          or <code>LONGVARCHAR</code> data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1457
     * @param length the length of the stream in characters
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1458
     * @throws SQLException if (1) the given column index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1459
     *            (2) the cursor is not on one of this rowset's rows or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1460
     *            insert row, (3) the data in the stream is not a binary or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1461
     *            character type, or (4) this rowset is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1462
     *            <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1463
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1464
   public void updateCharacterStream(int columnIndex , java.io.Reader x , int length) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1465
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1466
      boolean bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1467
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1468
      if(onInsertRow) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1469
         if(p != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1470
             bool = p.evaluate(x,columnIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1471
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1472
             if(!bool) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1473
                 throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.notallowed").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1474
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1475
         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1476
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1477
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1478
      super.updateCharacterStream(columnIndex,x,length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1479
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1480
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1481
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1482
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1483
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1484
     * <code>java.io.Reader</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1485
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1486
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1487
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1488
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1489
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1490
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1491
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1492
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1493
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1494
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1495
     * @param columnName a <code>String</code> object that must match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1496
     *        SQL name of a column in this rowset, ignoring case
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1497
     * @param reader the new column value; must be a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1498
     * <code>java.io.Reader</code> containing <code>BINARY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1499
     * <code>VARBINARY</code>, <code>LONGVARBINARY</code>, <code>CHAR</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1500
     * <code>VARCHAR</code>, or <code>LONGVARCHAR</code> data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1501
     * @param length the length of the stream in characters
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1502
     * @throws SQLException if (1) the given column name does not match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1503
     *            name of a column in this rowset, (2) the cursor is not on
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1504
     *            one of this rowset's rows or its insert row, (3) the data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1505
     *            in the stream is not a binary or character type, or (4) this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1506
     *            rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1507
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1508
   public void updateCharacterStream(String columnName , java.io.Reader reader, int length) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1509
      this.updateCharacterStream(findColumn(columnName), reader, length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1510
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1511
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1512
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1513
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1514
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1515
     * <code>java.io.InputStream</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1516
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1517
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1518
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1519
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1520
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1521
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1522
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1523
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1524
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1525
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1526
     * @param columnIndex the first column is <code>1</code>, the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1527
     *        is <code>2</code>, and so on; must be <code>1</code> or larger
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1528
     *        and equal to or less than the number of columns in this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1529
     * @param x the new column value; must be a <code>java.io.InputStream</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1530
     *          containing <code>BINARY</code>, <code>VARBINARY</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1531
     *          <code>LONGVARBINARY</code> data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1532
     * @param length the length of the stream in bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1533
     * @throws SQLException if (1) the given column index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1534
     *            (2) the cursor is not on one of this rowset's rows or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1535
     *            insert row, (3) the data in the stream is not binary, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1536
     *            (4) this rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1537
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1538
   public void updateBinaryStream(int columnIndex , java.io.InputStream x , int length) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1539
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1540
      boolean bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1541
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1542
      if(onInsertRow) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1543
         if(p != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1544
             bool = p.evaluate(x,columnIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1545
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1546
             if(!bool) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1547
                 throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.notallowed").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1548
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1549
         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1550
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1551
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1552
      super.updateBinaryStream(columnIndex,x,length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1553
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1554
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1555
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1556
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1557
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1558
     * <code>java.io.InputStream</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1559
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1560
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1561
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1562
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1563
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1564
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1565
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1566
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1567
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1568
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1569
     * @param columnName a <code>String</code> object that must match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1570
     *        SQL name of a column in this rowset, ignoring case
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1571
     * @param x the new column value; must be a <code>java.io.InputStream</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1572
     *          containing <code>BINARY</code>, <code>VARBINARY</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1573
     *          <code>LONGVARBINARY</code> data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1574
     * @param length the length of the stream in bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1575
     * @throws SQLException if (1) the given column name does not match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1576
     *            name of a column in this rowset, (2) the cursor is not on
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1577
     *            one of this rowset's rows or its insert row, (3) the data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1578
     *            in the stream is not binary, or (4) this rowset is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1579
     *            <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1580
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1581
   public void updateBinaryStream(String columnName , java.io.InputStream x, int length) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1582
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1583
      this.updateBinaryStream(findColumn(columnName),x,length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1584
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1585
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1586
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1587
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1588
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1589
     * <code>Object</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1590
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1591
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1592
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1593
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1594
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1595
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1596
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1597
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1598
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1599
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1600
     * @param columnIndex the first column is <code>1</code>, the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1601
     *        is <code>2</code>, and so on; must be <code>1</code> or larger
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1602
     *        and equal to or less than the number of columns in this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1603
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1604
     * @throws SQLException if (1) the given column index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1605
     *            (2) the cursor is not on one of this rowset's rows or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1606
     *            insert row, or (3) this rowset is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1607
     *            <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1608
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1609
   public void updateObject(int columnIndex , Object x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1610
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1611
      boolean bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1612
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1613
      if(onInsertRow) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1614
         if(p != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1615
             bool = p.evaluate(x,columnIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1616
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1617
             if(!bool) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1618
                 throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.notallowed").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1619
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1620
         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1621
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1622
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1623
      super.updateObject(columnIndex,x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1624
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1625
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1626
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1627
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1628
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1629
     * <code>Object</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1630
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1631
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1632
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1633
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1634
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1635
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1636
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1637
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1638
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1639
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1640
     * @param columnName a <code>String</code> object that must match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1641
     *        SQL name of a column in this rowset, ignoring case
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1642
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1643
     * @throws SQLException if (1) the given column name does not match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1644
     *            name of a column in this rowset, (2) the cursor is not on
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1645
     *            one of this rowset's rows or its insert row, or (3) this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1646
     *            rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1647
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1648
   public void updateObject(String columnName , Object x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1649
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1650
      this.updateObject(findColumn(columnName),x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1651
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1652
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1653
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1654
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1655
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1656
     * <code>Object</code> value.  The <code>scale</code> parameter indicates
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1657
     * the number of digits to the right of the decimal point and is ignored
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1658
     * if the new column value is not a type that will be mapped to an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1659
     * <code>DECIMAL</code> or <code>NUMERIC</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1660
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1661
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1662
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1663
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1664
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1665
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1666
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1667
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1668
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1669
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1670
     * @param columnIndex the first column is <code>1</code>, the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1671
     *        is <code>2</code>, and so on; must be <code>1</code> or larger
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1672
     *        and equal to or less than the number of columns in this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1673
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1674
     * @param scale the number of digits to the right of the decimal point (for
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1675
     *              <code>DECIMAL</code> and <code>NUMERIC</code> types only)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1676
     * @throws SQLException if (1) the given column index is out of bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1677
     *            (2) the cursor is not on one of this rowset's rows or its
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1678
     *            insert row, or (3) this rowset is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1679
     *            <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1680
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1681
   public void updateObject(int columnIndex , Object x , int scale) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1682
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1683
      boolean bool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1684
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1685
      if(onInsertRow) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1686
         if(p != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1687
             bool = p.evaluate(x,columnIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1688
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1689
             if(!bool) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1690
                 throw new SQLException(resBundle.handleGetObject("filteredrowsetimpl.notallowed").toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1691
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1692
         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1693
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1694
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1695
      super.updateObject(columnIndex,x,scale);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1696
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1697
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1698
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1699
     * Sets the designated column in either the current row or the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1700
     * row of this <code>CachedRowSetImpl</code> object with the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1701
     * <code>Object</code> value.  The <code>scale</code> parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1702
     * indicates the number of digits to the right of the decimal point
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1703
     * and is ignored if the new column value is not a type that will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1704
     *  mapped to an SQL <code>DECIMAL</code> or <code>NUMERIC</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1705
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1706
     * This method updates a column value in either the current row or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1707
     * the insert row of this rowset, but it does not update the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1708
     * database.  If the cursor is on a row in the rowset, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1709
     * method {@link #updateRow} must be called to update the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1710
     * If the cursor is on the insert row, the method {@link #insertRow}
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1711
     * must be called, which will insert the new row into both this rowset
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1712
     * and the database. Both of these methods must be called before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1713
     * cursor moves to another row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1714
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1715
     * @param columnName a <code>String</code> object that must match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1716
     *        SQL name of a column in this rowset, ignoring case
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1717
     * @param x the new column value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1718
     * @param scale the number of digits to the right of the decimal point (for
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1719
     *              <code>DECIMAL</code> and <code>NUMERIC</code> types only)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1720
     * @throws SQLException if (1) the given column name does not match the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1721
     *            name of a column in this rowset, (2) the cursor is not on
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1722
     *            one of this rowset's rows or its insert row, or (3) this
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1723
     *            rowset is <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1724
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1725
   public void updateObject(String columnName , Object x, int scale) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1726
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1727
      this.updateObject(findColumn(columnName),x,scale);
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1728
   }
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1729
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1730
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1731
     * Inserts the contents of this <code>CachedRowSetImpl</code> object's insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1732
     * row into this rowset immediately following the current row.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1733
     * If the current row is the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1734
     * position after the last row or before the first row, the new row will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1735
     * be inserted at the end of the rowset.  This method also notifies
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1736
     * listeners registered with this rowset that the row has changed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1737
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1738
     * The cursor must be on the insert row when this method is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1739
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1740
     * @throws SQLException if (1) the cursor is not on the insert row,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1741
     *            (2) one or more of the non-nullable columns in the insert
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1742
     *            row has not been given a value, or (3) this rowset is
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1743
     *            <code>ResultSet.CONCUR_READ_ONLY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1744
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1745
   public void insertRow() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1746
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1747
      onInsertRow = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1748
      super.insertRow();
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1749
   }
6530
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
  1750
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
  1751
   /**
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
  1752
    * This method re populates the resBundle
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
  1753
    * during the deserialization process
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
  1754
    *
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
  1755
    */
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
  1756
   private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
  1757
       // Default state initialization happens here
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
  1758
       ois.defaultReadObject();
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
  1759
       // Initialization of transient Res Bundle happens here .
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
  1760
       try {
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
  1761
          resBundle = JdbcRowSetResourceBundle.getJdbcRowSetResourceBundle();
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
  1762
       } catch(IOException ioe) {
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
  1763
           throw new RuntimeException(ioe);
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
  1764
       }
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
  1765
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
  1766
   }
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
  1767
bfb7b294dd14 6680198: UnmarshalException caused by incompatible serialVersionUID
lancea
parents: 5506
diff changeset
  1768
   static final long serialVersionUID = 6178454588413509360L;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1769
} // end FilteredRowSetImpl class