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