1 /*
2 * CsvJdbc - a JDBC driver for CSV files
3 * Copyright (C) 2001 Jonathan Ackerman
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 package org.relique.jdbc.csv;
20
21 import java.io.ByteArrayInputStream;
22 import java.io.IOException;
23 import java.io.InputStream;
24 import java.io.Reader;
25 import java.io.StringReader;
26 import java.math.BigDecimal;
27 import java.net.URL;
28 import java.sql.*;
29 import java.util.Calendar;
30 import java.util.Map;
31
32 /***
33 * This class implements the ResultSet interface for the CsvJdbc driver.
34 *
35 * @author Jonathan Ackerman
36 * @author Michael Maraya
37 * @author Tomasz Skutnik
38 * @version $Id: CsvResultSet.html,v 1.1 2003/05/12 16:19:47 sinisa Exp $
39 */
40 public class CsvResultSet implements ResultSet {
41
42 /*** Metadata for this ResultSet */
43 protected ResultSetMetaData resultSetMetaData;
44
45 /*** Statement that produced this ResultSet */
46 protected CsvStatement statement;
47
48 /*** Helper class that performs the actual file reads */
49 protected CsvReader reader;
50
51 /*** Table referenced by the Statement */
52 protected String tableName;
53
54 /*** Array of available columns for referenced table */
55 protected String[] columnNames;
56
57 protected String[] whereColumnNames;
58
59 protected String[] whereColumnValues;
60
61
62 /*** Last column name index read */
63 protected int lastIndexRead = -1;
64
65 /*** InputStream to keep track of */
66 protected InputStream is;
67
68 /***
69 * Constructor for the CsvResultSet object
70 *
71 * @param statement Statement that produced this ResultSet
72 * @param reader Helper class that performs the actual file reads
73 * @param tableName Table referenced by the Statement
74 * @param columnNames Array of available columns for referenced table
75 */
76 protected CsvResultSet(CsvStatement statement, CsvReader reader,
77 String tableName, String[] columnNames) {
78 this.statement = statement;
79 this.reader = reader;
80 this.tableName = tableName;
81 this.columnNames = columnNames;
82 if(columnNames[0].equals("*")) {
83 this.columnNames = reader.getColumnNames();
84 }
85 }
86
87 /***
88 * Constructor for the CsvResultSet object
89 *
90 * @param statement Statement that produced this ResultSet
91 * @param reader Helper class that performs the actual file reads
92 * @param tableName Table referenced by the Statement
93 * @param columnNames Array of available columns for referenced table
94 */
95 protected CsvResultSet(CsvStatement statement, CsvReader reader,
96 String tableName, String[] columnNames, String[] columnWhereNames, String[] columnWhereValues) {
97 this.statement = statement;
98 this.reader = reader;
99 this.tableName = tableName;
100 this.columnNames = columnNames;
101 this.whereColumnNames = columnWhereNames;
102 this.whereColumnValues = columnWhereValues;
103 if(columnNames[0].equals("*")) {
104 this.columnNames = reader.getColumnNames();
105 }
106 }
107
108 /***
109 * Moves the cursor down one row from its current position.
110 * A <code>ResultSet</code> cursor is initially positioned
111 * before the first row; the first call to the method
112 * <code>next</code> makes the first row the current row; the
113 * second call makes the second row the current row, and so on.
114 *
115 * <P>If an input stream is open for the current row, a call
116 * to the method <code>next</code> will
117 * implicitly close it. A <code>ResultSet</code> object's
118 * warning chain is cleared when a new row is read.
119 *
120 * @return <code>true</code> if the new current row is valid;
121 * <code>false</code> if there are no more rows
122 * @exception SQLException if a database access error occurs
123 */
124 public boolean next() throws SQLException {
125 mainLoop:
126 while(reader.next()) {
127 boolean isRow = true;
128 out:
129 for(int i=0; i<this.whereColumnNames.length;i++) {
130 if(!(reader.getColumn(this.whereColumnNames[i]).equals(this.whereColumnValues[i]))){
131 isRow=false;
132 break out;
133 }
134 }
135 if(isRow==true)
136 return true;
137 }
138 return false;
139 }
140
141 /***
142 * Releases this <code>ResultSet</code> object's database and
143 * JDBC resources immediately instead of waiting for
144 * this to happen when it is automatically closed.
145 *
146 * <P><B>Note:</B> A <code>ResultSet</code> object
147 * is automatically closed by the
148 * <code>Statement</code> object that generated it when
149 * that <code>Statement</code> object is closed,
150 * re-executed, or is used to retrieve the next result from a
151 * sequence of multiple results. A <code>ResultSet</code> object
152 * is also automatically closed when it is garbage collected.
153 *
154 * @exception SQLException if a database access error occurs
155 */
156 public void close() throws SQLException {
157 reader.close();
158 }
159
160 /***
161 * Reports whether
162 * the last column read had a value of SQL <code>NULL</code>.
163 * Note that you must first call one of the getter methods
164 * on a column to try to read its value and then call
165 * the method <code>wasNull</code> to see if the value read was
166 * SQL <code>NULL</code>.
167 *
168 * @return <code>true</code> if the last column value read was SQL
169 * <code>NULL</code> and <code>false</code> otherwise
170 * @exception SQLException if a database access error occurs
171 */
172 public boolean wasNull() throws SQLException {
173 if(lastIndexRead >= 0) {
174 return getString(lastIndexRead) == null;
175 } else {
176 throw new SQLException("No previous getter method called");
177 }
178 }
179
180 //======================================================================
181 // Methods for accessing results by column index
182 //======================================================================
183
184 /***
185 * Retrieves the value of the designated column in the current row
186 * of this <code>ResultSet</code> object as
187 * a <code>String</code> in the Java programming language.
188 *
189 * @param columnIndex the first column is 1, the second is 2, ...
190 * @return the column value; if the value is SQL <code>NULL</code>, the
191 * value returned is <code>null</code>
192 * @exception SQLException if a database access error occurs
193 */
194 public String getString(int columnIndex) throws SQLException {
195 // perform pre-accessor method processing
196 preAccessor(columnIndex);
197 // use CsvReader.getColumn(String) to retrieve the column
198 if (columnIndex < 1 || columnIndex > columnNames.length) {
199 throw new SQLException("Column not found: invalid index: "+columnIndex);
200 }
201 return reader.getColumn(columnNames[columnIndex-1]);
202 }
203
204 /***
205 * Retrieves the value of the designated column in the current row
206 * of this <code>ResultSet</code> object as
207 * a <code>boolean</code> in the Java programming language.
208 *
209 * @param columnIndex the first column is 1, the second is 2, ...
210 * @return the column value; if the value is SQL <code>NULL</code>, the
211 * value returned is <code>false</code>
212 * @exception SQLException if a database access error occurs
213 */
214 public boolean getBoolean(int columnIndex) throws SQLException {
215 String str = getString(columnIndex);
216 return (str == null) ? false : Boolean.valueOf(str).booleanValue();
217 }
218
219 /***
220 * Retrieves the value of the designated column in the current row
221 * of this <code>ResultSet</code> object as
222 * a <code>byte</code> in the Java programming language.
223 *
224 * @param columnIndex the first column is 1, the second is 2, ...
225 * @return the column value; if the value is SQL <code>NULL</code>, the
226 * value returned is <code>0</code>
227 * @exception SQLException if a database access error occurs
228 */
229 public byte getByte(int columnIndex) throws SQLException {
230 String str = getString(columnIndex);
231 return (str == null) ? 0 : Byte.parseByte(str);
232 }
233
234 /***
235 * Retrieves the value of the designated column in the current row
236 * of this <code>ResultSet</code> object as
237 * a <code>short</code> in the Java programming language.
238 *
239 * @param columnIndex the first column is 1, the second is 2, ...
240 * @return the column value; if the value is SQL <code>NULL</code>, the
241 * value returned is <code>0</code>
242 * @exception SQLException if a database access error occurs
243 */
244 public short getShort(int columnIndex) throws SQLException {
245 String str = getString(columnIndex);
246 return (str == null) ? 0 : Short.parseShort(str);
247 }
248
249 /***
250 * Gets the value of the designated column in the current row
251 * of this <code>ResultSet</code> object as
252 * an <code>int</code> in the Java programming language.
253 *
254 * @param columnIndex the first column is 1, the second is 2, ...
255 * @return the column value; if the value is SQL <code>NULL</code>, the
256 * value returned is <code>0</code>
257 * @exception SQLException if a database access error occurs
258 */
259 public int getInt(int columnIndex) throws SQLException {
260 String str = getString(columnIndex);
261 return (str == null) ? 0 : Integer.parseInt(str);
262 }
263
264 /***
265 * Retrieves the value of the designated column in the current row
266 * of this <code>ResultSet</code> object as
267 * a <code>long</code> in the Java programming language.
268 *
269 * @param columnIndex the first column is 1, the second is 2, ...
270 * @return the column value; if the value is SQL <code>NULL</code>, the
271 * value returned is <code>0</code>
272 * @exception SQLException if a database access error occurs
273 */
274 public long getLong(int columnIndex) throws SQLException {
275 String str = getString(columnIndex);
276 return (str == null) ? 0L : Long.parseLong(str);
277 }
278
279 /***
280 * Gets the value of the designated column in the current row
281 * of this <code>ResultSet</code> object as
282 * a <code>float</code> in the Java programming language.
283 *
284 * @param columnIndex the first column is 1, the second is 2, ...
285 * @return the column value; if the value is SQL <code>NULL</code>, the
286 * value returned is <code>0</code>
287 * @exception SQLException if a database access error occurs
288 */
289 public float getFloat(int columnIndex) throws SQLException {
290 String str = getString(columnIndex);
291 return (str == null) ? 0F : Float.parseFloat(str);
292 }
293
294 /***
295 * Retrieves the value of the designated column in the current row
296 * of this <code>ResultSet</code> object as
297 * a <code>double</code> in the Java programming language.
298 *
299 * @param columnIndex the first column is 1, the second is 2, ...
300 * @return the column value; if the value is SQL <code>NULL</code>, the
301 * value returned is <code>0</code>
302 * @exception SQLException if a database access error occurs
303 */
304 public double getDouble(int columnIndex) throws SQLException {
305 String str = getString(columnIndex);
306 return (str == null) ? 0D : Double.parseDouble(str);
307 }
308
309 /***
310 * Retrieves the value of the designated column in the current row
311 * of this <code>ResultSet</code> object as
312 * a <code>java.sql.BigDecimal</code> in the Java programming language.
313 *
314 * @param columnIndex the first column is 1, the second is 2, ...
315 * @param scale the number of digits to the right of the decimal point
316 * @return the column value; if the value is SQL <code>NULL</code>, the
317 * value returned is <code>null</code>
318 * @exception SQLException if a database access error occurs
319 * @deprecated
320 */
321 public BigDecimal getBigDecimal(int columnIndex, int scale)
322 throws SQLException {
323 // let getBigDecimal(int) handle this for now
324 return getBigDecimal(columnIndex);
325 }
326
327 /***
328 * Retrieves the value of the designated column in the current row
329 * of this <code>ResultSet</code> object as
330 * a <code>byte</code> array in the Java programming language.
331 * The bytes represent the raw values returned by the driver.
332 *
333 * @param columnIndex the first column is 1, the second is 2, ...
334 * @return the column value; if the value is SQL <code>NULL</code>, the
335 * value returned is <code>null</code>
336 * @exception SQLException if a database access error occurs
337 */
338 public byte[] getBytes(int columnIndex) throws SQLException {
339 String str = getString(columnIndex);
340 return (str == null) ? null : str.getBytes();
341 }
342
343 /***
344 * Retrieves the value of the designated column in the current row
345 * of this <code>ResultSet</code> object as
346 * a <code>java.sql.Date</code> object in the Java programming language.
347 *
348 * @param columnIndex the first column is 1, the second is 2, ...
349 * @return the column value; if the value is SQL <code>NULL</code>, the
350 * value returned is <code>null</code>
351 * @exception SQLException if a database access error occurs
352 */
353 public Date getDate(int columnIndex) throws SQLException {
354 String str = getString(columnIndex);
355 return (str == null) ? null : Date.valueOf(str);
356 }
357
358 /***
359 * Retrieves the value of the designated column in the current row
360 * of this <code>ResultSet</code> object as
361 * a <code>java.sql.Time</code> object in the Java programming language.
362 *
363 * @param columnIndex the first column is 1, the second is 2, ...
364 * @return the column value; if the value is SQL <code>NULL</code>, the
365 * value returned is <code>null</code>
366 * @exception SQLException if a database access error occurs
367 */
368 public Time getTime(int columnIndex) throws SQLException {
369 String str = getString(columnIndex);
370 return (str == null) ? null : Time.valueOf(str);
371 }
372
373 /***
374 * Retrieves the value of the designated column in the current row
375 * of this <code>ResultSet</code> object as a
376 * <code>java.sql.Timestamp</code> object in the Java programming language.
377 *
378 * @param columnIndex the first column is 1, the second is 2, ...
379 * @return the column value; if the value is SQL <code>NULL</code>, the
380 * value returned is <code>null</code>
381 * @exception SQLException if a database access error occurs
382 */
383 public Timestamp getTimestamp(int columnIndex) throws SQLException {
384 String str = getString(columnIndex);
385 return (str == null) ? null : Timestamp.valueOf(str);
386 }
387
388 /***
389 * Retrieves the value of the designated column in the current row
390 * of this <code>ResultSet</code> object as a stream of ASCII characters.
391 * The value can then be read in chunks from the stream. This method is
392 * particularly suitable for retrieving large <char>LONGVARCHAR</char>
393 * values. The JDBC driver will do any necessary conversion from the
394 * database format into ASCII.
395 *
396 * <P><B>Note:</B> All the data in the returned stream must be
397 * read prior to getting the value of any other column. The next
398 * call to a getter method implicitly closes the stream. Also, a
399 * stream may return <code>0</code> when the method
400 * <code>InputStream.available</code>
401 * is called whether there is data available or not.
402 *
403 * @param columnIndex the first column is 1, the second is 2, ...
404 * @return a Java input stream that delivers the database column value
405 * as a stream of one-byte ASCII characters;
406 * if the value is SQL <code>NULL</code>, the
407 * value returned is <code>null</code>
408 * @exception SQLException if a database access error occurs
409 */
410 public InputStream getAsciiStream(int columnIndex) throws SQLException {
411 String str = getString(columnIndex);
412 is = new ByteArrayInputStream(str.getBytes());
413 return (str == null) ? null : is;
414 }
415
416 /***
417 * Retrieves the value of the designated column in the current row
418 * of this <code>ResultSet</code> object as
419 * as a stream of two-byte Unicode characters. The first byte is
420 * the high byte; the second byte is the low byte.
421 *
422 * The value can then be read in chunks from the
423 * stream. This method is particularly
424 * suitable for retrieving large <code>LONGVARCHAR</code>values. The
425 * JDBC driver will do any necessary conversion from the database
426 * format into Unicode.
427 *
428 * <P><B>Note:</B> All the data in the returned stream must be
429 * read prior to getting the value of any other column. The next
430 * call to a getter method implicitly closes the stream.
431 * Also, a stream may return <code>0</code> when the method
432 * <code>InputStream.available</code>
433 * is called, whether there is data available or not.
434 *
435 * @param columnIndex the first column is 1, the second is 2, ...
436 * @return a Java input stream that delivers the database column value
437 * as a stream of two-byte Unicode characters;
438 * if the value is SQL <code>NULL</code>, the value returned is
439 * <code>null</code>
440 *
441 * @exception SQLException if a database access error occurs
442 * @deprecated use <code>getCharacterStream</code> in place of
443 * <code>getUnicodeStream</code>
444 */
445 public InputStream getUnicodeStream(int columnIndex) throws SQLException {
446 // delegate to getAsciiStream(int)
447 return getAsciiStream(columnIndex);
448 }
449
450 /***
451 * Retrieves the value of the designated column in the current row
452 * of this <code>ResultSet</code> object as a binary stream of
453 * uninterpreted bytes. The value can then be read in chunks from the
454 * stream. This method is particularly
455 * suitable for retrieving large <code>LONGVARBINARY</code> values.
456 *
457 * <P><B>Note:</B> All the data in the returned stream must be
458 * read prior to getting the value of any other column. The next
459 * call to a getter method implicitly closes the stream. Also, a
460 * stream may return <code>0</code> when the method
461 * <code>InputStream.available</code>
462 * is called whether there is data available or not.
463 *
464 * @param columnIndex the first column is 1, the second is 2, ...
465 * @return a Java input stream that delivers the database column value
466 * as a stream of uninterpreted bytes;
467 * if the value is SQL <code>NULL</code>, the value returned is
468 * <code>null</code>
469 * @exception SQLException if a database access error occurs
470 */
471 public InputStream getBinaryStream(int columnIndex) throws SQLException {
472 // delegate to getAsciiStream(int)
473 return getAsciiStream(columnIndex);
474 }
475
476 //======================================================================
477 // Methods for accessing results by column name
478 //======================================================================
479
480 /***
481 * Retrieves the value of the designated column in the current row
482 * of this <code>ResultSet</code> object as
483 * a <code>String</code> in the Java programming language.
484 *
485 * @param columnName the SQL name of the column
486 * @return the column value; if the value is SQL <code>NULL</code>, the
487 * value returned is <code>null</code>
488 * @exception SQLException if a database access error occurs
489 */
490 public String getString(String columnName) throws SQLException {
491 // perform pre-accessor method processing
492 preAccessor(columnName);
493 // use CsvReader.getColumn(String) to retrieve the column
494 return reader.getColumn(columnName);
495 }
496
497 /***
498 * Retrieves the value of the designated column in the current row
499 * of this <code>ResultSet</code> object as
500 * a <code>boolean</code> in the Java programming language.
501 *
502 * @param columnName the SQL name of the column
503 * @return the column value; if the value is SQL <code>NULL</code>, the
504 * value returned is <code>false</code>
505 * @exception SQLException if a database access error occurs
506 */
507 public boolean getBoolean(String columnName) throws SQLException {
508 String str = getString(columnName);
509 return (str == null) ? false : Boolean.valueOf(str).booleanValue();
510 }
511
512 /***
513 * Retrieves the value of the designated column in the current row
514 * of this <code>ResultSet</code> object as
515 * a <code>byte</code> in the Java programming language.
516 *
517 * @param columnName the SQL name of the column
518 * @return the column value; if the value is SQL <code>NULL</code>, the
519 * value returned is <code>0</code>
520 * @exception SQLException if a database access error occurs
521 */
522 public byte getByte(String columnName) throws SQLException {
523 String str = getString(columnName);
524 return (str == null) ? 0 : Byte.parseByte(str);
525 }
526
527 /***
528 * Retrieves the value of the designated column in the current row
529 * of this <code>ResultSet</code> object as
530 * a <code>short</code> in the Java programming language.
531 *
532 * @param columnName the SQL name of the column
533 * @return the column value; if the value is SQL <code>NULL</code>, the
534 * value returned is <code>0</code>
535 * @exception SQLException if a database access error occurs
536 */
537 public short getShort(String columnName) throws SQLException {
538 String str = getString(columnName);
539 return (str == null) ? 0 : Short.parseShort(str);
540 }
541
542 /***
543 * Gets the value of the designated column in the current row
544 * of this <code>ResultSet</code> object as
545 * an <code>int</code> in the Java programming language.
546 *
547 * @param columnName the SQL name of the column
548 * @return the column value; if the value is SQL <code>NULL</code>, the
549 * value returned is <code>0</code>
550 * @exception SQLException if a database access error occurs
551 */
552 public int getInt(String columnName) throws SQLException {
553 String str = getString(columnName);
554 return (str == null) ? 0 : Integer.parseInt(str);
555 }
556
557 /***
558 * Retrieves the value of the designated column in the current row
559 * of this <code>ResultSet</code> object as
560 * a <code>long</code> in the Java programming language.
561 *
562 * @param columnName the SQL name of the column
563 * @return the column value; if the value is SQL <code>NULL</code>, the
564 * value returned is <code>0</code>
565 * @exception SQLException if a database access error occurs
566 */
567 public long getLong(String columnName) throws SQLException {
568 String str = getString(columnName);
569 return (str == null) ? 0L : Long.parseLong(str);
570 }
571
572 /***
573 * Gets the value of the designated column in the current row
574 * of this <code>ResultSet</code> object as
575 * a <code>float</code> in the Java programming language.
576 *
577 * @param columnName the SQL name of the column
578 * @return the column value; if the value is SQL <code>NULL</code>, the
579 * value returned is <code>0</code>
580 * @exception SQLException if a database access error occurs
581 */
582 public float getFloat(String columnName) throws SQLException {
583 String str = getString(columnName);
584 return (str == null) ? 0F : Float.parseFloat(str);
585 }
586
587 /***
588 * Retrieves the value of the designated column in the current row
589 * of this <code>ResultSet</code> object as
590 * a <code>double</code> in the Java programming language.
591 *
592 * @param columnName the SQL name of the column
593 * @return the column value; if the value is SQL <code>NULL</code>, the
594 * value returned is <code>0</code>
595 * @exception SQLException if a database access error occurs
596 */
597 public double getDouble(String columnName) throws SQLException {
598 String str = getString(columnName);
599 return (str == null) ? 0D : Double.parseDouble(str);
600 }
601
602 /***
603 * Retrieves the value of the designated column in the current row
604 * of this <code>ResultSet</code> object as
605 * a <code>java.math.BigDecimal</code> in the Java programming language.
606 *
607 * @param columnName the SQL name of the column
608 * @param scale the number of digits to the right of the decimal point
609 * @return the column value; if the value is SQL <code>NULL</code>, the
610 * value returned is <code>null</code>
611 * @exception SQLException if a database access error occurs
612 * @deprecated
613 */
614 public BigDecimal getBigDecimal(String columnName, int scale)
615 throws SQLException {
616 // let getBigDecimal(String) handle this for now
617 return getBigDecimal(columnName);
618 }
619
620 /***
621 * Retrieves the value of the designated column in the current row
622 * of this <code>ResultSet</code> object as
623 * a <code>byte</code> array in the Java programming language.
624 * The bytes represent the raw values returned by the driver.
625 *
626 * @param columnName the SQL name of the column
627 * @return the column value; if the value is SQL <code>NULL</code>, the
628 * value returned is <code>null</code>
629 * @exception SQLException if a database access error occurs
630 */
631 public byte[] getBytes(String columnName) throws SQLException {
632 String str = getString(columnName);
633 return (str == null) ? null : str.getBytes();
634 }
635
636 /***
637 * Retrieves the value of the designated column in the current row
638 * of this <code>ResultSet</code> object as
639 * a <code>java.sql.Date</code> object in the Java programming language.
640 *
641 * @param columnName the SQL name of the column
642 * @return the column value; if the value is SQL <code>NULL</code>, the
643 * value returned is <code>null</code>
644 * @exception SQLException if a database access error occurs
645 */
646 public Date getDate(String columnName) throws SQLException {
647 String str = getString(columnName);
648 return (str == null) ? null : Date.valueOf(str);
649 }
650
651 /***
652 * Retrieves the value of the designated column in the current row
653 * of this <code>ResultSet</code> object as
654 * a <code>java.sql.Time</code> object in the Java programming language.
655 *
656 * @param columnName the SQL name of the column
657 * @return the column value;
658 * if the value is SQL <code>NULL</code>,
659 * the value returned is <code>null</code>
660 * @exception SQLException if a database access error occurs
661 */
662 public Time getTime(String columnName) throws SQLException {
663 String str = getString(columnName);
664 return (str == null) ? null : Time.valueOf(str);
665 }
666
667 /***
668 * Retrieves the value of the designated column in the current row
669 * of this <code>ResultSet</code> object as
670 * a <code>java.sql.Timestamp</code> object.
671 *
672 * @param columnName the SQL name of the column
673 * @return the column value; if the value is SQL <code>NULL</code>, the
674 * value returned is <code>null</code>
675 * @exception SQLException if a database access error occurs
676 */
677 public Timestamp getTimestamp(String columnName) throws SQLException {
678 String str = getString(columnName);
679 return (str == null) ? null : Timestamp.valueOf(str);
680 }
681
682 /***
683 * Retrieves the value of the designated column in the current row
684 * of this <code>ResultSet</code> object as a stream of
685 * ASCII characters. The value can then be read in chunks from the
686 * stream. This method is particularly
687 * suitable for retrieving large <code>LONGVARCHAR</code> values.
688 * The JDBC driver will
689 * do any necessary conversion from the database format into ASCII.
690 *
691 * <P><B>Note:</B> All the data in the returned stream must be
692 * read prior to getting the value of any other column. The next
693 * call to a getter method implicitly closes the stream. Also, a
694 * stream may return <code>0</code> when the method <code>available</code>
695 * is called whether there is data available or not.
696 *
697 * @param columnName the SQL name of the column
698 * @return a Java input stream that delivers the database column value
699 * as a stream of one-byte ASCII characters.
700 * If the value is SQL <code>NULL</code>,
701 * the value returned is <code>null</code>.
702 * @exception SQLException if a database access error occurs
703 */
704 public InputStream getAsciiStream(String columnName) throws SQLException {
705 String str = getString(columnName);
706 is = new ByteArrayInputStream(str.getBytes());
707 return (str == null) ? null : is;
708 }
709
710 /***
711 * Retrieves the value of the designated column in the current row
712 * of this <code>ResultSet</code> object as a stream of two-byte
713 * Unicode characters. The first byte is the high byte; the second
714 * byte is the low byte.
715 *
716 * The value can then be read in chunks from the
717 * stream. This method is particularly
718 * suitable for retrieving large <code>LONGVARCHAR</code> values.
719 * The JDBC technology-enabled driver will
720 * do any necessary conversion from the database format into Unicode.
721 *
722 * <P><B>Note:</B> All the data in the returned stream must be
723 * read prior to getting the value of any other column. The next
724 * call to a getter method implicitly closes the stream.
725 * Also, a stream may return <code>0</code> when the method
726 * <code>InputStream.available</code> is called, whether there
727 * is data available or not.
728 *
729 * @param columnName the SQL name of the column
730 * @return a Java input stream that delivers the database column value
731 * as a stream of two-byte Unicode characters.
732 * If the value is SQL <code>NULL</code>, the value returned
733 * is <code>null</code>.
734 * @exception SQLException if a database access error occurs
735 * @deprecated use <code>getCharacterStream</code> instead
736 */
737 public InputStream getUnicodeStream(String columnName) throws SQLException {
738 // delegate to getAsciiStream(String)
739 return getAsciiStream(columnName);
740 }
741
742 /***
743 * Retrieves the value of the designated column in the current row
744 * of this <code>ResultSet</code> object as a stream of uninterpreted
745 * <code>byte</code>s.
746 * The value can then be read in chunks from the
747 * stream. This method is particularly
748 * suitable for retrieving large <code>LONGVARBINARY</code>
749 * values.
750 *
751 * <P><B>Note:</B> All the data in the returned stream must be
752 * read prior to getting the value of any other column. The next
753 * call to a getter method implicitly closes the stream. Also, a
754 * stream may return <code>0</code> when the method <code>available</code>
755 * is called whether there is data available or not.
756 *
757 * @param columnName the SQL name of the column
758 * @return a Java input stream that delivers the database column value
759 * as a stream of uninterpreted bytes;
760 * if the value is SQL <code>NULL</code>, the result is <code>null</code>
761 * @exception SQLException if a database access error occurs
762 */
763 public InputStream getBinaryStream(String columnName) throws SQLException {
764 // delegate to getAsciiStream(String)
765 return getAsciiStream(columnName);
766 }
767
768 //=====================================================================
769 // Advanced features:
770 //=====================================================================
771
772 /***
773 * Retrieves the first warning reported by calls on this
774 * <code>ResultSet</code> object.
775 * Subsequent warnings on this <code>ResultSet</code> object
776 * will be chained to the <code>SQLWarning</code> object that
777 * this method returns.
778 *
779 * <P>The warning chain is automatically cleared each time a new
780 * row is read. This method may not be called on a <code>ResultSet</code>
781 * object that has been closed; doing so will cause an
782 * <code>SQLException</code> to be thrown.
783 * <P>
784 * <B>Note:</B> This warning chain only covers warnings caused
785 * by <code>ResultSet</code> methods. Any warning caused by
786 * <code>Statement</code> methods
787 * (such as reading OUT parameters) will be chained on the
788 * <code>Statement</code> object.
789 *
790 * @return the first <code>SQLWarning</code> object reported or
791 * <code>null</code> if there are none
792 * @exception SQLException if a database access error occurs or this method
793 * is called on a closed result set
794 */
795 public SQLWarning getWarnings() throws SQLException {
796 throw new UnsupportedOperationException(
797 "ResultSet.getWarnings() unsupported");
798 }
799
800 /***
801 * Clears all warnings reported on this <code>ResultSet</code> object.
802 * After this method is called, the method <code>getWarnings</code>
803 * returns <code>null</code> until a new warning is
804 * reported for this <code>ResultSet</code> object.
805 *
806 * @exception SQLException if a database access error occurs
807 */
808 public void clearWarnings() throws SQLException {
809 throw new UnsupportedOperationException(
810 "ResultSet.clearWarnings() unsupported");
811 }
812
813 /***
814 * Retrieves the name of the SQL cursor used by this <code>ResultSet</code>
815 * object.
816 *
817 * <P>In SQL, a result table is retrieved through a cursor that is
818 * named. The current row of a result set can be updated or deleted
819 * using a positioned update/delete statement that references the
820 * cursor name. To insure that the cursor has the proper isolation
821 * level to support update, the cursor's <code>SELECT</code> statement
822 * should be of the form <code>SELECT FOR UPDATE</code>. If
823 * <code>FOR UPDATE</code> is omitted, the positioned updates may fail.
824 *
825 * <P>The JDBC API supports this SQL feature by providing the name of the
826 * SQL cursor used by a <code>ResultSet</code> object.
827 * The current row of a <code>ResultSet</code> object
828 * is also the current row of this SQL cursor.
829 *
830 * <P><B>Note:</B> If positioned update is not supported, a
831 * <code>SQLException</code> is thrown.
832 *
833 * @return the SQL name for this <code>ResultSet</code> object's cursor
834 * @exception SQLException if a database access error occurs
835 */
836 public String getCursorName() throws SQLException {
837 throw new UnsupportedOperationException(
838 "ResultSet.getCursorName() unsupported");
839 }
840
841 /***
842 * Retrieves the number, types and properties of
843 * this <code>ResultSet</code> object's columns.
844 *
845 * @return the description of this <code>ResultSet</code> object's columns
846 * @exception SQLException if a database access error occurs
847 */
848 public ResultSetMetaData getMetaData() throws SQLException {
849 if (resultSetMetaData == null) {
850 resultSetMetaData = new CsvResultSetMetaData(tableName,columnNames);
851 }
852 return resultSetMetaData;
853 }
854
855 /***
856 * <p>Gets the value of the designated column in the current row
857 * of this <code>ResultSet</code> object as
858 * an <code>Object</code> in the Java programming language.
859 *
860 * <p>This method will return the value of the given column as a
861 * Java object. The type of the Java object will be the default
862 * Java object type corresponding to the column's SQL type,
863 * following the mapping for built-in types specified in the JDBC
864 * specification. If the value is an SQL <code>NULL</code>,
865 * the driver returns a Java <code>null</code>.
866 *
867 * <p>This method may also be used to read datatabase-specific
868 * abstract data types.
869 *
870 * In the JDBC 2.0 API, the behavior of method
871 * <code>getObject</code> is extended to materialize
872 * data of SQL user-defined types. When a column contains
873 * a structured or distinct value, the behavior of this method is as
874 * if it were a call to: <code>getObject(columnIndex,
875 * this.getStatement().getConnection().getTypeMap())</code>.
876 *
877 * @param columnIndex the first column is 1, the second is 2, ...
878 * @return a <code>java.lang.Object</code> holding the column value
879 * @exception SQLException if a database access error occurs
880 */
881 public Object getObject(int columnIndex) throws SQLException {
882 // throw new UnsupportedOperationException(
883 // "ResultSet.getObject(int) unsupported");
884 return getString(columnIndex);
885 }
886 /***
887 * <p>Gets the value of the designated column in the current row
888 * of this <code>ResultSet</code> object as
889 * an <code>Object</code> in the Java programming language.
890 *
891 * <p>This method will return the value of the given column as a
892 * Java object. The type of the Java object will be the default
893 * Java object type corresponding to the column's SQL type,
894 * following the mapping for built-in types specified in the JDBC
895 * specification. If the value is an SQL <code>NULL</code>,
896 * the driver returns a Java <code>null</code>.
897 * <P>
898 * This method may also be used to read datatabase-specific
899 * abstract data types.
900 * <P>
901 * In the JDBC 2.0 API, the behavior of the method
902 * <code>getObject</code> is extended to materialize
903 * data of SQL user-defined types. When a column contains
904 * a structured or distinct value, the behavior of this method is as
905 * if it were a call to: <code>getObject(columnIndex,
906 * this.getStatement().getConnection().getTypeMap())</code>.
907 *
908 * @param columnName the SQL name of the column
909 * @return a <code>java.lang.Object</code> holding the column value
910 * @exception SQLException if a database access error occurs
911 */
912 public Object getObject(String columnName) throws SQLException {
913 // throw new UnsupportedOperationException(
914 // "ResultSet.getObject(String) unsupported");
915 return getString(columnName);
916 }
917
918 /***
919 * Maps the given <code>ResultSet</code> column name to its
920 * <code>ResultSet</code> column index.
921 *
922 * @param columnName the name of the column
923 * @return the column index of the given column name
924 * @exception SQLException if the <code>ResultSet</code> object does
925 * not contain <code>columnName</code> or a database access error occurs
926 */
927 public int findColumn(String columnName) throws SQLException {
928 throw new UnsupportedOperationException(
929 "ResultSet.findColumn(String) unsupported");
930 }
931
932 //--------------------------JDBC 2.0-----------------------------------
933
934 //---------------------------------------------------------------------
935 // Getters and Setters
936 //---------------------------------------------------------------------
937
938 /***
939 * Retrieves the value of the designated column in the current row
940 * of this <code>ResultSet</code> object as a
941 * <code>java.io.Reader</code> object.
942 *
943 * @param columnIndex the first column is 1, the second is 2, ...
944 * @return a <code>java.io.Reader</code> object that contains the column
945 * value; if the value is SQL <code>NULL</code>, the value returned is
946 * <code>null</code> in the Java programming language.
947 * @exception SQLException if a database access error occurs
948 */
949 public Reader getCharacterStream(int columnIndex) throws SQLException {
950 String str = getString(columnIndex);
951 return (str == null) ? null : new StringReader(str);
952 }
953
954 /***
955 * Retrieves the value of the designated column in the current row
956 * of this <code>ResultSet</code> object as a
957 * <code>java.io.Reader</code> object.
958 *
959 * @param columnName the name of the column
960 * @return a <code>java.io.Reader</code> object that contains the column
961 * value; if the value is SQL <code>NULL</code>, the value returned is
962 * <code>null</code> in the Java programming language
963 * @exception SQLException if a database access error occurs
964 */
965 public Reader getCharacterStream(String columnName) throws SQLException {
966 String str = getString(columnName);
967 return (str == null) ? null : new StringReader(str);
968 }
969
970 /***
971 * Retrieves the value of the designated column in the current row
972 * of this <code>ResultSet</code> object as a
973 * <code>java.math.BigDecimal</code> with full precision.
974 *
975 * @param columnIndex the first column is 1, the second is 2, ...
976 * @return the column value (full precision);
977 * if the value is SQL <code>NULL</code>, the value returned is
978 * <code>null</code> in the Java programming language.
979 * @exception SQLException if a database access error occurs
980 */
981 public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
982 BigDecimal retval = null;
983 String str = getString(columnIndex);
984 if(str != null) {
985 try {
986 retval = new BigDecimal(str);
987 }
988 catch (NumberFormatException e) {
989 throw new SQLException("Could not convert '" + str + "' to " +
990 "a java.math.BigDecimal object");
991 }
992 }
993 return retval;
994 }
995
996 /***
997 * Retrieves the value of the designated column in the current row
998 * of this <code>ResultSet</code> object as a
999 * <code>java.math.BigDecimal</code> with full precision.
1000 *
1001 * @param columnName the column name
1002 * @return the column value (full precision);
1003 * if the value is SQL <code>NULL</code>, the value returned is
1004 * <code>null</code> in the Java programming language.
1005 * @exception SQLException if a database access error occurs
1006 */
1007 public BigDecimal getBigDecimal(String columnName) throws SQLException {
1008 BigDecimal retval = null;
1009 String str = getString(columnName);
1010 if(str != null) {
1011 try {
1012 retval = new BigDecimal(str);
1013 }
1014 catch (NumberFormatException e) {
1015 throw new SQLException("Could not convert '" + str + "' to " +
1016 "a java.math.BigDecimal object");
1017 }
1018 }
1019 return retval;
1020 }
1021
1022 //---------------------------------------------------------------------
1023 // Traversal/Positioning
1024 //---------------------------------------------------------------------
1025
1026 /***
1027 * Retrieves whether the cursor is before the first row in
1028 * this <code>ResultSet</code> object.
1029 *
1030 * @return <code>true</code> if the cursor is before the first row;
1031 * <code>false</code> if the cursor is at any other position or the
1032 * result set contains no rows
1033 * @exception SQLException if a database access error occurs
1034 */
1035 public boolean isBeforeFirst() throws SQLException {
1036 throw new UnsupportedOperationException(
1037 "ResultSet.isBeforeFirst() unsupported");
1038 }
1039
1040 /***
1041 * Retrieves whether the cursor is after the last row in
1042 * this <code>ResultSet</code> object.
1043 *
1044 * @return <code>true</code> if the cursor is after the last row;
1045 * <code>false</code> if the cursor is at any other position or the
1046 * result set contains no rows
1047 * @exception SQLException if a database access error occurs
1048 */
1049 public boolean isAfterLast() throws SQLException {
1050 throw new UnsupportedOperationException(
1051 "ResultSet.isAfterLast() unsupported");
1052 }
1053
1054 /***
1055 * Retrieves whether the cursor is on the first row of
1056 * this <code>ResultSet</code> object.
1057 *
1058 * @return <code>true</code> if the cursor is on the first row;
1059 * <code>false</code> otherwise
1060 * @exception SQLException if a database access error occurs
1061 */
1062 public boolean isFirst() throws SQLException {
1063 throw new UnsupportedOperationException(
1064 "ResultSet.isFirst() unsupported");
1065 }
1066
1067 /***
1068 * Retrieves whether the cursor is on the last row of
1069 * this <code>ResultSet</code> object.
1070 * Note: Calling the method <code>isLast</code> may be expensive
1071 * because the JDBC driver
1072 * might need to fetch ahead one row in order to determine
1073 * whether the current row is the last row in the result set.
1074 *
1075 * @return <code>true</code> if the cursor is on the last row;
1076 * <code>false</code> otherwise
1077 * @exception SQLException if a database access error occurs
1078 */
1079 public boolean isLast() throws SQLException {
1080 throw new UnsupportedOperationException(
1081 "ResultSet.isLast() unsupported");
1082 }
1083
1084 /***
1085 * Moves the cursor to the front of
1086 * this <code>ResultSet</code> object, just before the
1087 * first row. This method has no effect if the result set contains no rows.
1088 *
1089 * @exception SQLException if a database access error
1090 * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
1091 */
1092 public void beforeFirst() throws SQLException {
1093 throw new UnsupportedOperationException(
1094 "ResultSet.beforeFirst() unsupported");
1095 }
1096
1097 /***
1098 * Moves the cursor to the end of
1099 * this <code>ResultSet</code> object, just after the
1100 * last row. This method has no effect if the result set contains no rows.
1101 * @exception SQLException if a database access error
1102 * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
1103 */
1104 public void afterLast() throws SQLException {
1105 throw new UnsupportedOperationException(
1106 "ResultSet.afterLast() unsupported");
1107 }
1108
1109 /***
1110 * Moves the cursor to the first row in
1111 * this <code>ResultSet</code> object.
1112 *
1113 * @return <code>true</code> if the cursor is on a valid row;
1114 * <code>false</code> if there are no rows in the result set
1115 * @exception SQLException if a database access error
1116 * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
1117 */
1118 public boolean first() throws SQLException {
1119 throw new UnsupportedOperationException(
1120 "ResultSet.first() unsupported");
1121 }
1122
1123 /***
1124 * Moves the cursor to the last row in
1125 * this <code>ResultSet</code> object.
1126 *
1127 * @return <code>true</code> if the cursor is on a valid row;
1128 * <code>false</code> if there are no rows in the result set
1129 * @exception SQLException if a database access error
1130 * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
1131 */
1132 public boolean last() throws SQLException {
1133 throw new UnsupportedOperationException("ResultSet.last() unsupported");
1134 }
1135
1136 /***
1137 * Retrieves the current row number. The first row is number 1, the
1138 * second number 2, and so on.
1139 *
1140 * @return the current row number; <code>0</code> if there is no current row
1141 * @exception SQLException if a database access error occurs
1142 */
1143 public int getRow() throws SQLException {
1144 throw new UnsupportedOperationException(
1145 "ResultSet.getRow() unsupported");
1146 }
1147
1148 /***
1149 * Moves the cursor to the given row number in
1150 * this <code>ResultSet</code> object.
1151 *
1152 * <p>If the row number is positive, the cursor moves to
1153 * the given row number with respect to the
1154 * beginning of the result set. The first row is row 1, the second
1155 * is row 2, and so on.
1156 *
1157 * <p>If the given row number is negative, the cursor moves to
1158 * an absolute row position with respect to
1159 * the end of the result set. For example, calling the method
1160 * <code>absolute(-1)</code> positions the
1161 * cursor on the last row; calling the method <code>absolute(-2)</code>
1162 * moves the cursor to the next-to-last row, and so on.
1163 *
1164 * <p>An attempt to position the cursor beyond the first/last row in
1165 * the result set leaves the cursor before the first row or after
1166 * the last row.
1167 *
1168 * <p><B>Note:</B> Calling <code>absolute(1)</code> is the same
1169 * as calling <code>first()</code>. Calling <code>absolute(-1)</code>
1170 * is the same as calling <code>last()</code>.
1171 *
1172 * @param row the number of the row to which the cursor should move.
1173 * A positive number indicates the row number counting from the
1174 * beginning of the result set; a negative number indicates the
1175 * row number counting from the end of the result set
1176 * @return <code>true</code> if the cursor is on the result set;
1177 * <code>false</code> otherwise
1178 * @exception SQLException if a database access error
1179 * occurs, or the result set type is <code>TYPE_FORWARD_ONLY</code>
1180 */
1181 public boolean absolute(int row) throws SQLException {
1182 throw new UnsupportedOperationException(
1183 "ResultSet.absolute() unsupported");
1184 }
1185
1186 /***
1187 * Moves the cursor a relative number of rows, either positive or negative.
1188 * Attempting to move beyond the first/last row in the
1189 * result set positions the cursor before/after the
1190 * the first/last row. Calling <code>relative(0)</code> is valid, but does
1191 * not change the cursor position.
1192 *
1193 * <p>Note: Calling the method <code>relative(1)</code>
1194 * is identical to calling the method <code>next()</code> and
1195 * calling the method <code>relative(-1)</code> is identical
1196 * to calling the method <code>previous()</code>.
1197 *
1198 * @param rows an <code>int</code> specifying the number of rows to
1199 * move from the current row; a positive number moves the cursor
1200 * forward; a negative number moves the cursor backward
1201 * @return <code>true</code> if the cursor is on a row;
1202 * <code>false</code> otherwise
1203 * @exception SQLException if a database access error occurs,
1204 * there is no current row, or the result set type is
1205 * <code>TYPE_FORWARD_ONLY</code>
1206 */
1207 public boolean relative(int rows) throws SQLException {
1208 throw new UnsupportedOperationException(
1209 "ResultSet.relative() unsupported");
1210 }
1211
1212 /***
1213 * Moves the cursor to the previous row in this
1214 * <code>ResultSet</code> object.
1215 *
1216 * @return <code>true</code> if the cursor is on a valid row;
1217 * <code>false</code> if it is off the result set
1218 * @exception SQLException if a database access error
1219 * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
1220 */
1221 public boolean previous() throws SQLException {
1222 throw new UnsupportedOperationException(
1223 "ResultSet.previous() unsupported");
1224 }
1225
1226 //---------------------------------------------------------------------
1227 // Properties
1228 //---------------------------------------------------------------------
1229
1230 /***
1231 * Gives a hint as to the direction in which the rows in this
1232 * <code>ResultSet</code> object will be processed. The initial value is
1233 * determined by the <code>Statement</code> object that produced this
1234 * <code>ResultSet</code> object. The fetch direction may be changed at
1235 * any time.
1236 *
1237 * @param direction an <code>int</code> specifying the suggested
1238 * fetch direction; one of <code>ResultSet.FETCH_FORWARD</code>,
1239 * <code>ResultSet.FETCH_REVERSE</code>, or
1240 * <code>ResultSet.FETCH_UNKNOWN</code>
1241 * @exception SQLException if a database access error occurs or
1242 * the result set type is <code>TYPE_FORWARD_ONLY</code>
1243 * and the fetch direction is not <code>FETCH_FORWARD</code>
1244 */
1245 public void setFetchDirection(int direction) throws SQLException {
1246 throw new UnsupportedOperationException(
1247 "ResultSet.setFetchDirection(int) unsupported");
1248 }
1249
1250 /***
1251 * Retrieves the fetch direction for this
1252 * <code>ResultSet</code> object.
1253 *
1254 * @return the current fetch direction for this <code>ResultSet</code>
1255 * object
1256 * @exception SQLException if a database access error occurs
1257 * @see #setFetchDirection
1258 */
1259 public int getFetchDirection() throws SQLException {
1260 throw new UnsupportedOperationException(
1261 "ResultSet.getFetchDirection() unsupported");
1262 }
1263
1264 /***
1265 * Gives the JDBC driver a hint as to the number of rows that should
1266 * be fetched from the database when more rows are needed for this
1267 * <code>ResultSet</code> object. If the fetch size specified is zero,
1268 * the JDBC driver ignores the value and is free to make its own best
1269 * guess as to what the fetch size should be. The default value is set
1270 * by the <code>Statement</code> object that created the result set.
1271 * The fetch size may be changed at any time.
1272 *
1273 * @param rows the number of rows to fetch
1274 * @exception SQLException if a database access error occurs or the
1275 * condition <code>0 <= rows <= this.getMaxRows()</code> is not satisfied
1276 */
1277 public void setFetchSize(int rows) throws SQLException {
1278 throw new UnsupportedOperationException(
1279 "ResultSet.setFetchSize(int) unsupported");
1280 }
1281
1282 /***
1283 * Retrieves the fetch size for this
1284 * <code>ResultSet</code> object.
1285 *
1286 * @return the current fetch size for this <code>ResultSet</code> object
1287 * @exception SQLException if a database access error occurs
1288 * @see #setFetchSize
1289 */
1290 public int getFetchSize() throws SQLException {
1291 throw new UnsupportedOperationException(
1292 "ResultSet.getFetchSize() unsupported");
1293 }
1294
1295 /***
1296 * Retrieves the type of this <code>ResultSet</code> object.
1297 * The type is determined by the <code>Statement</code> object
1298 * that created the result set.
1299 *
1300 * @return <code>ResultSet.TYPE_FORWARD_ONLY</code>,
1301 * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>,
1302 * or <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
1303 * @exception SQLException if a database access error occurs
1304 */
1305 public int getType() throws SQLException {
1306 throw new UnsupportedOperationException(
1307 "ResultSet.getType() unsupported");
1308 }
1309
1310 /***
1311 * Retrieves the concurrency mode of this <code>ResultSet</code> object.
1312 * The concurrency used is determined by the
1313 * <code>Statement</code> object that created the result set.
1314 *
1315 * @return the concurrency type, either
1316 * <code>ResultSet.CONCUR_READ_ONLY</code>
1317 * or <code>ResultSet.CONCUR_UPDATABLE</code>
1318 * @exception SQLException if a database access error occurs
1319 */
1320 public int getConcurrency() throws SQLException {
1321 return CONCUR_READ_ONLY;
1322 }
1323
1324 //---------------------------------------------------------------------
1325 // Updates
1326 //---------------------------------------------------------------------
1327
1328 /***
1329 * Retrieves whether the current row has been updated. The value returned
1330 * depends on whether or not the result set can detect updates.
1331 *
1332 * @return <code>true</code> if both (1) the row has been visibly updated
1333 * by the owner or another and (2) updates are detected
1334 * @exception SQLException if a database access error occurs
1335 * @see DatabaseMetaData#updatesAreDetected
1336 */
1337 public boolean rowUpdated() throws SQLException {
1338 throw new UnsupportedOperationException(
1339 "ResultSet.rowUpdated() unsupported");
1340 }
1341
1342 /***
1343 * Retrieves whether the current row has had an insertion.
1344 * The value returned depends on whether or not this
1345 * <code>ResultSet</code> object can detect visible inserts.
1346 *
1347 * @return <code>true</code> if a row has had an insertion
1348 * and insertions are detected; <code>false</code> otherwise
1349 * @exception SQLException if a database access error occurs
1350 *
1351 * @see DatabaseMetaData#insertsAreDetected
1352 */
1353 public boolean rowInserted() throws SQLException {
1354 throw new UnsupportedOperationException(
1355 "ResultSet.rowInserted() unsupported");
1356 }
1357
1358 /***
1359 * Retrieves whether a row has been deleted. A deleted row may leave
1360 * a visible "hole" in a result set. This method can be used to
1361 * detect holes in a result set. The value returned depends on whether
1362 * or not this <code>ResultSet</code> object can detect deletions.
1363 *
1364 * @return <code>true</code> if a row was deleted and deletions are
1365 * detected; <code>false</code> otherwise
1366 * @exception SQLException if a database access error occurs
1367 *
1368 * @see DatabaseMetaData#deletesAreDetected
1369 */
1370 public boolean rowDeleted() throws SQLException {
1371 throw new UnsupportedOperationException(
1372 "ResultSet.rowDeleted() unsupported");
1373 }
1374
1375 /***
1376 * Gives a nullable column a null value.
1377 *
1378 * The updater methods are used to update column values in the
1379 * current row or the insert row. The updater methods do not
1380 * update the underlying database; instead the <code>updateRow</code>
1381 * or <code>insertRow</code> methods are called to update the database.
1382 *
1383 * @param columnIndex the first column is 1, the second is 2, ...
1384 * @exception SQLException if a database access error occurs
1385 */
1386 public void updateNull(int columnIndex) throws SQLException {
1387 throw new UnsupportedOperationException(
1388 "ResultSet.updateNull() unsupported");
1389 }
1390
1391 /***
1392 * Updates the designated column with a <code>boolean</code> value.
1393 * The updater methods are used to update column values in the
1394 * current row or the insert row. The updater methods do not
1395 * update the underlying database; instead the <code>updateRow</code> or
1396 * <code>insertRow</code> methods are called to update the database.
1397 *
1398 * @param columnIndex the first column is 1, the second is 2, ...
1399 * @param x the new column value
1400 * @exception SQLException if a database access error occurs
1401 */
1402 public void updateBoolean(int columnIndex, boolean x) throws SQLException {
1403 throw new UnsupportedOperationException(
1404 "ResultSet.updateBoolean() unsupported");
1405 }
1406
1407 /***
1408 * Updates the designated column with a <code>byte</code> value.
1409 * The updater methods are used to update column values in the
1410 * current row or the insert row. The updater methods do not
1411 * update the underlying database; instead the <code>updateRow</code> or
1412 * <code>insertRow</code> methods are called to update the database.
1413 *
1414 *
1415 * @param columnIndex the first column is 1, the second is 2, ...
1416 * @param x the new column value
1417 * @exception SQLException if a database access error occurs
1418 */
1419 public void updateByte(int columnIndex, byte x) throws SQLException {
1420 throw new UnsupportedOperationException(
1421 "ResultSet.updateByte() unsupported");
1422 }
1423
1424 /***
1425 * Updates the designated column with a <code>short</code> value.
1426 * The updater methods are used to update column values in the
1427 * current row or the insert row. The updater methods do not
1428 * update the underlying database; instead the <code>updateRow</code> or
1429 * <code>insertRow</code> methods are called to update the database.
1430 *
1431 * @param columnIndex the first column is 1, the second is 2, ...
1432 * @param x the new column value
1433 * @exception SQLException if a database access error occurs
1434 */
1435 public void updateShort(int columnIndex, short x) throws SQLException {
1436 throw new UnsupportedOperationException(
1437 "ResultSet.updateShort() unsupported");
1438 }
1439
1440 /***
1441 * Updates the designated column with an <code>int</code> value.
1442 * The updater methods are used to update column values in the
1443 * current row or the insert row. The updater methods do not
1444 * update the underlying database; instead the <code>updateRow</code> or
1445 * <code>insertRow</code> methods are called to update the database.
1446 *
1447 * @param columnIndex the first column is 1, the second is 2, ...
1448 * @param x the new column value
1449 * @exception SQLException if a database access error occurs
1450 */
1451 public void updateInt(int columnIndex, int x) throws SQLException {
1452 throw new UnsupportedOperationException(
1453 "ResultSet.updateInt() unsupported");
1454 }
1455
1456 /***
1457 * Updates the designated column with a <code>long</code> value.
1458 * The updater methods are used to update column values in the
1459 * current row or the insert row. The updater methods do not
1460 * update the underlying database; instead the <code>updateRow</code> or
1461 * <code>insertRow</code> methods are called to update the database.
1462 *
1463 * @param columnIndex the first column is 1, the second is 2, ...
1464 * @param x the new column value
1465 * @exception SQLException if a database access error occurs
1466 */
1467 public void updateLong(int columnIndex, long x) throws SQLException {
1468 throw new UnsupportedOperationException(
1469 "ResultSet.updateLong(int, long) unsupported");
1470 }
1471
1472 /***
1473 * Updates the designated column with a <code>float</code> value.
1474 * The updater methods are used to update column values in the
1475 * current row or the insert row. The updater methods do not
1476 * update the underlying database; instead the <code>updateRow</code> or
1477 * <code>insertRow</code> methods are called to update the database.
1478 *
1479 * @param columnIndex the first column is 1, the second is 2, ...
1480 * @param x the new column value
1481 * @exception SQLException if a database access error occurs
1482 */
1483 public void updateFloat(int columnIndex, float x) throws SQLException {
1484 throw new UnsupportedOperationException(
1485 "ResultSet.updateFloat(int, float) unsupported");
1486 }
1487
1488 /***
1489 * Updates the designated column with a <code>double</code> value.
1490 * The updater methods are used to update column values in the
1491 * current row or the insert row. The updater methods do not
1492 * update the underlying database; instead the <code>updateRow</code> or
1493 * <code>insertRow</code> methods are called to update the database.
1494 *
1495 * @param columnIndex the first column is 1, the second is 2, ...
1496 * @param x the new column value
1497 * @exception SQLException if a database access error occurs
1498 */
1499 public void updateDouble(int columnIndex, double x) throws SQLException {
1500 throw new UnsupportedOperationException(
1501 "ResultSet.updateDouble(int, double) unsupported");
1502 }
1503
1504 /***
1505 * Updates the designated column with a <code>java.math.BigDecimal</code>
1506 * value.
1507 * The updater methods are used to update column values in the
1508 * current row or the insert row. The updater methods do not
1509 * update the underlying database; instead the <code>updateRow</code> or
1510 * <code>insertRow</code> methods are called to update the database.
1511 *
1512 * @param columnIndex the first column is 1, the second is 2, ...
1513 * @param x the new column value
1514 * @exception SQLException if a database access error occurs
1515 */
1516 public void updateBigDecimal(int columnIndex, BigDecimal x)
1517 throws SQLException {
1518 throw new UnsupportedOperationException(
1519 "ResultSet.updateBigDecimal(int, BigDecimal) unsupported");
1520 }
1521
1522 /***
1523 * Updates the designated column with a <code>String</code> value.
1524 * The updater methods are used to update column values in the
1525 * current row or the insert row. The updater methods do not
1526 * update the underlying database; instead the <code>updateRow</code> or
1527 * <code>insertRow</code> methods are called to update the database.
1528 *
1529 * @param columnIndex the first column is 1, the second is 2, ...
1530 * @param x the new column value
1531 * @exception SQLException if a database access error occurs
1532 */
1533 public void updateString(int columnIndex, String x) throws SQLException {
1534 throw new UnsupportedOperationException(
1535 "ResultSet.updateString(int, String) unsupported");
1536 }
1537
1538 /***
1539 * Updates the designated column with a <code>byte</code> array value.
1540 * The updater methods are used to update column values in the
1541 * current row or the insert row. The updater methods do not
1542 * update the underlying database; instead the <code>updateRow</code> or
1543 * <code>insertRow</code> methods are called to update the database.
1544 *
1545 * @param columnIndex the first column is 1, the second is 2, ...
1546 * @param x the new column value
1547 * @exception SQLException if a database access error occurs
1548 */
1549 public void updateBytes(int columnIndex, byte[] x) throws SQLException {
1550 throw new UnsupportedOperationException(
1551 "ResultSet.updateBytes(int, byte[]) unsupported");
1552 }
1553
1554 /***
1555 * Updates the designated column with a <code>java.sql.Date</code> value.
1556 * The updater methods are used to update column values in the
1557 * current row or the insert row. The updater methods do not
1558 * update the underlying database; instead the <code>updateRow</code> or
1559 * <code>insertRow</code> methods are called to update the database.
1560 *
1561 * @param columnIndex the first column is 1, the second is 2, ...
1562 * @param x the new column value
1563 * @exception SQLException if a database access error occurs
1564 */
1565 public void updateDate(int columnIndex, Date x) throws SQLException {
1566 throw new UnsupportedOperationException(
1567 "ResultSet.updateDate(int, Date) unsupported");
1568 }
1569
1570 /***
1571 * Updates the designated column with a <code>java.sql.Time</code> value.
1572 * The updater methods are used to update column values in the
1573 * current row or the insert row. The updater methods do not
1574 * update the underlying database; instead the <code>updateRow</code> or
1575 * <code>insertRow</code> methods are called to update the database.
1576 *
1577 * @param columnIndex the first column is 1, the second is 2, ...
1578 * @param x the new column value
1579 * @exception SQLException if a database access error occurs
1580 */
1581 public void updateTime(int columnIndex, Time x) throws SQLException {
1582 throw new UnsupportedOperationException(
1583 "ResultSet.updateTime(int, Time) unsupported");
1584 }
1585
1586 /***
1587 * Updates the designated column with a <code>java.sql.Timestamp</code>
1588 * value.
1589 * The updater methods are used to update column values in the
1590 * current row or the insert row. The updater methods do not
1591 * update the underlying database; instead the <code>updateRow</code> or
1592 * <code>insertRow</code> methods are called to update the database.
1593 *
1594 * @param columnIndex the first column is 1, the second is 2, ...
1595 * @param x the new column value
1596 * @exception SQLException if a database access error occurs
1597 */
1598 public void updateTimestamp(int columnIndex, Timestamp x)
1599 throws SQLException {
1600 throw new UnsupportedOperationException(
1601 "ResultSet.updateTimestamp(int, Timestamp) unsupported");
1602 }
1603
1604 /***
1605 * Updates the designated column with an ascii stream value.
1606 * The updater methods are used to update column values in the
1607 * current row or the insert row. The updater methods do not
1608 * update the underlying database; instead the <code>updateRow</code> or
1609 * <code>insertRow</code> methods are called to update the database.
1610 *
1611 * @param columnIndex the first column is 1, the second is 2, ...
1612 * @param x the new column value
1613 * @param length the length of the stream
1614 * @exception SQLException if a database access error occurs
1615 */
1616 public void updateAsciiStream(int columnIndex, InputStream x, int length)
1617 throws SQLException {
1618 throw new UnsupportedOperationException("ResultSet.updateAsciiStream " +
1619 "(int, InputStream, int) unsupported");
1620 }
1621
1622 /***
1623 * Updates the designated column with a binary stream value.
1624 * The updater methods are used to update column values in the
1625 * current row or the insert row. The updater methods do not
1626 * update the underlying database; instead the <code>updateRow</code> or
1627 * <code>insertRow</code> methods are called to update the database.
1628 *
1629 * @param columnIndex the first column is 1, the second is 2, ...
1630 * @param x the new column value
1631 * @param length the length of the stream
1632 * @exception SQLException if a database access error occurs
1633 */
1634 public void updateBinaryStream(int columnIndex, InputStream x, int length)
1635 throws SQLException {
1636 throw new UnsupportedOperationException("ResultSet.updateBinaryStream" +
1637 "(int, InputStream, int) unsupported");
1638 }
1639
1640 /***
1641 * Updates the designated column with a character stream value.
1642 * The updater methods are used to update column values in the
1643 * current row or the insert row. The updater methods do not
1644 * update the underlying database; instead the <code>updateRow</code> or
1645 * <code>insertRow</code> methods are called to update the database.
1646 *
1647 * @param columnIndex the first column is 1, the second is 2, ...
1648 * @param x the new column value
1649 * @param length the length of the stream
1650 * @exception SQLException if a database access error occurs
1651 */
1652 public void updateCharacterStream(int columnIndex, Reader x, int length)
1653 throws SQLException {
1654 throw new UnsupportedOperationException("ResultSet.updateCharacterStr" +
1655 "eam(int, Reader, int) unsupported");
1656 }
1657
1658 /***
1659 * Updates the designated column with an <code>Object</code> value.
1660 * The updater methods are used to update column values in the
1661 * current row or the insert row. The updater methods do not
1662 * update the underlying database; instead the <code>updateRow</code> or
1663 * <code>insertRow</code> methods are called to update the database.
1664 *
1665 * @param columnIndex the first column is 1, the second is 2, ...
1666 * @param x the new column value
1667 * @param scale for <code>java.sql.Types.DECIMA</code>
1668 * or <code>java.sql.Types.NUMERIC</code> types,
1669 * this is the number of digits after the decimal point. For all other
1670 * types this value will be ignored.
1671 * @exception SQLException if a database access error occurs
1672 */
1673 public void updateObject(int columnIndex, Object x, int scale)
1674 throws SQLException {
1675 throw new UnsupportedOperationException(
1676 "ResultSet.udpateObject(int, Object) unsupported");
1677 }
1678
1679 /***
1680 * Updates the designated column with an <code>Object</code> value.
1681 * The updater methods are used to update column values in the
1682 * current row or the insert row. The updater methods do not
1683 * update the underlying database; instead the <code>updateRow</code> or
1684 * <code>insertRow</code> methods are called to update the database.
1685 *
1686 * @param columnIndex the first column is 1, the second is 2, ...
1687 * @param x the new column value
1688 * @exception SQLException if a database access error occurs
1689 */
1690 public void updateObject(int columnIndex, Object x) throws SQLException {
1691 throw new UnsupportedOperationException(
1692 "ResultSet.updateObject(int, Object, int) unsupported");
1693 }
1694
1695 /***
1696 * Updates the designated column with a <code>null</code> value.
1697 * The updater methods are used to update column values in the
1698 * current row or the insert row. The updater methods do not
1699 * update the underlying database; instead the <code>updateRow</code> or
1700 * <code>insertRow</code> methods are called to update the database.
1701 *
1702 * @param columnName the name of the column
1703 * @exception SQLException if a database access error occurs
1704 */
1705 public void updateNull(String columnName) throws SQLException {
1706 throw new UnsupportedOperationException(
1707 "ResultSet.updateNull(String) unsupported");
1708 }
1709
1710 /***
1711 * Updates the designated column with a <code>boolean</code> value.
1712 * The updater methods are used to update column values in the
1713 * current row or the insert row. The updater methods do not
1714 * update the underlying database; instead the <code>updateRow</code> or
1715 * <code>insertRow</code> methods are called to update the database.
1716 *
1717 * @param columnName the name of the column
1718 * @param x the new column value
1719 * @exception SQLException if a database access error occurs
1720 */
1721 public void updateBoolean(String columnName, boolean x)
1722 throws SQLException {
1723 throw new UnsupportedOperationException(
1724 "ResultSet.updateBoolean(String, boolean) unsupported");
1725 }
1726
1727 /***
1728 * Updates the designated column with a <code>byte</code> value.
1729 * The updater methods are used to update column values in the
1730 * current row or the insert row. The updater methods do not
1731 * update the underlying database; instead the <code>updateRow</code> or
1732 * <code>insertRow</code> methods are called to update the database.
1733 *
1734 * @param columnName the name of the column
1735 * @param x the new column value
1736 * @exception SQLException if a database access error occurs
1737 */
1738 public void updateByte(String columnName, byte x) throws SQLException {
1739 throw new UnsupportedOperationException(
1740 "ResultSet.updateByte(String, byte) unsupported");
1741 }
1742
1743 /***
1744 * Updates the designated column with a <code>short</code> value.
1745 * The updater methods are used to update column values in the
1746 * current row or the insert row. The updater methods do not
1747 * update the underlying database; instead the <code>updateRow</code> or
1748 * <code>insertRow</code> methods are called to update the database.
1749 *
1750 * @param columnName the name of the column
1751 * @param x the new column value
1752 * @exception SQLException if a database access error occurs
1753 */
1754 public void updateShort(String columnName, short x) throws SQLException {
1755 throw new UnsupportedOperationException(
1756 "ResultSet.updateShort(String, short) unsupported");
1757 }
1758
1759 /***
1760 * Updates the designated column with an <code>int</code> value.
1761 * The updater methods are used to update column values in the
1762 * current row or the insert row. The updater methods do not
1763 * update the underlying database; instead the <code>updateRow</code> or
1764 * <code>insertRow</code> methods are called to update the database.
1765 *
1766 * @param columnName the name of the column
1767 * @param x the new column value
1768 * @exception SQLException if a database access error occurs
1769 */
1770 public void updateInt(String columnName, int x) throws SQLException {
1771 throw new UnsupportedOperationException(
1772 "ResultSet.updateInt(String, int) unsupported");
1773 }
1774
1775 /***
1776 * Updates the designated column with a <code>long</code> value.
1777 * The updater methods are used to update column values in the
1778 * current row or the insert row. The updater methods do not
1779 * update the underlying database; instead the <code>updateRow</code> or
1780 * <code>insertRow</code> methods are called to update the database.
1781 *
1782 * @param columnName the name of the column
1783 * @param x the new column value
1784 * @exception SQLException if a database access error occurs
1785 */
1786 public void updateLong(String columnName, long x) throws SQLException {
1787 throw new UnsupportedOperationException(
1788 "ResultSet.updateLong(String, long) unsupported");
1789 }
1790
1791 /***
1792 * Updates the designated column with a <code>float </code> value.
1793 * The updater methods are used to update column values in the
1794 * current row or the insert row. The updater methods do not
1795 * update the underlying database; instead the <code>updateRow</code> or
1796 * <code>insertRow</code> methods are called to update the database.
1797 *
1798 * @param columnName the name of the column
1799 * @param x the new column value
1800 * @exception SQLException if a database access error occurs
1801 */
1802 public void updateFloat(String columnName, float x) throws SQLException {
1803 throw new UnsupportedOperationException(
1804 "ResultSet.updateFloat(String, float) unsupported");
1805 }
1806
1807 /***
1808 * Updates the designated column with a <code>double</code> value.
1809 * The updater methods are used to update column values in the
1810 * current row or the insert row. The updater methods do not
1811 * update the underlying database; instead the <code>updateRow</code> or
1812 * <code>insertRow</code> methods are called to update the database.
1813 *
1814 * @param columnName the name of the column
1815 * @param x the new column value
1816 * @exception SQLException if a database access error occurs
1817 */
1818 public void updateDouble(String columnName, double x) throws SQLException {
1819 throw new UnsupportedOperationException(
1820 "ResultSet.updateDouble(String, double) unsupported");
1821 }
1822
1823 /***
1824 * Updates the designated column with a <code>java.sql.BigDecimal</code>
1825 * value.
1826 * The updater methods are used to update column values in the
1827 * current row or the insert row. The updater methods do not
1828 * update the underlying database; instead the <code>updateRow</code> or
1829 * <code>insertRow</code> methods are called to update the database.
1830 *
1831 * @param columnName the name of the column
1832 * @param x the new column value
1833 * @exception SQLException if a database access error occurs
1834 */
1835 public void updateBigDecimal(String columnName, BigDecimal x)
1836 throws SQLException {
1837 throw new UnsupportedOperationException(
1838 "ResultSet.updateBigDecimal(String, BigDecimal) unsupported");
1839 }
1840
1841 /***
1842 * Updates the designated column with a <code>String</code> value.
1843 * The updater methods are used to update column values in the
1844 * current row or the insert row. The updater methods do not
1845 * update the underlying database; instead the <code>updateRow</code> or
1846 * <code>insertRow</code> methods are called to update the database.
1847 *
1848 * @param columnName the name of the column
1849 * @param x the new column value
1850 * @exception SQLException if a database access error occurs
1851 */
1852 public void updateString(String columnName, String x) throws SQLException {
1853 throw new UnsupportedOperationException(
1854 "ResultSet.updateString(String, String) unsupported");
1855 }
1856
1857 /***
1858 * Updates the designated column with a byte array value.
1859 *
1860 * The updater methods are used to update column values in the
1861 * current row or the insert row. The updater methods do not
1862 * update the underlying database; instead the <code>updateRow</code>
1863 * or <code>insertRow</code> methods are called to update the database.
1864 *
1865 * @param columnName the name of the column
1866 * @param x the new column value
1867 * @exception SQLException if a database access error occurs
1868 */
1869 public void updateBytes(String columnName, byte[] x) throws SQLException {
1870 throw new UnsupportedOperationException(
1871 "ResultSet.updateBytes(String, byte[]) unsupported");
1872 }
1873
1874 /***
1875 * Updates the designated column with a <code>java.sql.Date</code> value.
1876 * The updater methods are used to update column values in the
1877 * current row or the insert row. The updater methods do not
1878 * update the underlying database; instead the <code>updateRow</code> or
1879 * <code>insertRow</code> methods are called to update the database.
1880 *
1881 * @param columnName the name of the column
1882 * @param x the new column value
1883 * @exception SQLException if a database access error occurs
1884 */
1885 public void updateDate(String columnName, Date x) throws SQLException {
1886 throw new UnsupportedOperationException(
1887 "ResultSet.updateDate(String, Date) unsupported");
1888 }
1889
1890 /***
1891 * Updates the designated column with a <code>java.sql.Time</code> value.
1892 * The updater methods are used to update column values in the
1893 * current row or the insert row. The updater methods do not
1894 * update the underlying database; instead the <code>updateRow</code> or
1895 * <code>insertRow</code> methods are called to update the database.
1896 *
1897 * @param columnName the name of the column
1898 * @param x the new column value
1899 * @exception SQLException if a database access error occurs
1900 */
1901 public void updateTime(String columnName, Time x) throws SQLException {
1902 throw new UnsupportedOperationException(
1903 "ResultSet.updateTime(String, Time) unsupported");
1904 }
1905
1906 /***
1907 * Updates the designated column with a <code>java.sql.Timestamp</code>
1908 * value.
1909 * The updater methods are used to update column values in the
1910 * current row or the insert row. The updater methods do not
1911 * update the underlying database; instead the <code>updateRow</code> or
1912 * <code>insertRow</code> methods are called to update the database.
1913 *
1914 * @param columnName the name of the column
1915 * @param x the new column value
1916 * @exception SQLException if a database access error occurs
1917 */
1918 public void updateTimestamp(String columnName, Timestamp x)
1919 throws SQLException {
1920 throw new UnsupportedOperationException(
1921 "ResultSet.updateTimestamp(String, Timestamp) unsupported");
1922 }
1923
1924 /***
1925 * Updates the designated column with an ascii stream value.
1926 * The updater methods are used to update column values in the
1927 * current row or the insert row. The updater methods do not
1928 * update the underlying database; instead the <code>updateRow</code> or
1929 * <code>insertRow</code> methods are called to update the database.
1930 *
1931 * @param columnName the name of the column
1932 * @param x the new column value
1933 * @param length the length of the stream
1934 * @exception SQLException if a database access error occurs
1935 */
1936 public void updateAsciiStream(String columnName, InputStream x, int length)
1937 throws SQLException {
1938 throw new UnsupportedOperationException("ResultSet.updateAsciiStream" +
1939 "(String, InputStream, int) unsupported");
1940 }
1941
1942 /***
1943 * Updates the designated column with a binary stream value.
1944 * The updater methods are used to update column values in the
1945 * current row or the insert row. The updater methods do not
1946 * update the underlying database; instead the <code>updateRow</code> or
1947 * <code>insertRow</code> methods are called to update the database.
1948 *
1949 * @param columnName the name of the column
1950 * @param x the new column value
1951 * @param length the length of the stream
1952 * @exception SQLException if a database access error occurs
1953 */
1954 public void updateBinaryStream(String columnName, InputStream x, int length)
1955 throws SQLException {
1956 throw new UnsupportedOperationException("ResultSet.updateBinaryStream" +
1957 "(String, InputStream, int) unsupported");
1958 }
1959
1960 /***
1961 * Updates the designated column with a character stream value.
1962 * The updater methods are used to update column values in the
1963 * current row or the insert row. The updater methods do not
1964 * update the underlying database; instead the <code>updateRow</code> or
1965 * <code>insertRow</code> methods are called to update the database.
1966 *
1967 * @param columnName the name of the column
1968 * @param reader the <code>java.io.Reader</code> object containing
1969 * the new column value
1970 * @param length the length of the stream
1971 * @exception SQLException if a database access error occurs
1972 */
1973 public void updateCharacterStream(String columnName, Reader reader,
1974 int length) throws SQLException {
1975 throw new UnsupportedOperationException("ResultSet.updateCharacterStr" +
1976 "eam(String, Reader, int) unsupported");
1977 }
1978
1979 /***
1980 * Updates the designated column with an <code>Object</code> value.
1981 * The updater methods are used to update column values in the
1982 * current row or the insert row. The updater methods do not
1983 * update the underlying database; instead the <code>updateRow</code> or
1984 * <code>insertRow</code> methods are called to update the database.
1985 *
1986 * @param columnName the name of the column
1987 * @param x the new column value
1988 * @param scale for <code>java.sql.Types.DECIMAL</code>
1989 * or <code>java.sql.Types.NUMERIC</code> types,
1990 * this is the number of digits after the decimal point. For all other
1991 * types this value will be ignored.
1992 * @exception SQLException if a database access error occurs
1993 */
1994 public void updateObject(String columnName, Object x, int scale)
1995 throws SQLException {
1996 throw new UnsupportedOperationException(
1997 "ResultSet.updateObject(String, Object, int) unsupported");
1998 }
1999
2000 /***
2001 * Updates the designated column with an <code>Object</code> value.
2002 * The updater methods are used to update column values in the
2003 * current row or the insert row. The updater methods do not
2004 * update the underlying database; instead the <code>updateRow</code> or
2005 * <code>insertRow</code> methods are called to update the database.
2006 *
2007 * @param columnName the name of the column
2008 * @param x the new column value
2009 * @exception SQLException if a database access error occurs
2010 */
2011 public void updateObject(String columnName, Object x) throws SQLException {
2012 throw new UnsupportedOperationException(
2013 "ResultSet.updateObject(String, Object) unsupported");
2014 }
2015
2016 /***
2017 * Inserts the contents of the insert row into this
2018 * <code>ResultSet</code> object and into the database.
2019 * The cursor must be on the insert row when this method is called.
2020 *
2021 * @exception SQLException if a database access error occurs,
2022 * if this method is called when the cursor is not on the insert row,
2023 * or if not all of non-nullable columns in
2024 * the insert row have been given a value
2025 */
2026 public void insertRow() throws SQLException {
2027 throw new UnsupportedOperationException(
2028 "ResultSet.insertRow() unsupported");
2029 }
2030
2031 /***
2032 * Updates the underlying database with the new contents of the
2033 * current row of this <code>ResultSet</code> object.
2034 * This method cannot be called when the cursor is on the insert row.
2035 *
2036 * @exception SQLException if a database access error occurs or
2037 * if this method is called when the cursor is on the insert row
2038 */
2039 public void updateRow() throws SQLException {
2040 throw new UnsupportedOperationException(
2041 "ResultSet.updateRow() unsupported");
2042 }
2043
2044 /***
2045 * Deletes the current row from this <code>ResultSet</code> object
2046 * and from the underlying database. This method cannot be called when
2047 * the cursor is on the insert row.
2048 *
2049 * @exception SQLException if a database access error occurs
2050 * or if this method is called when the cursor is on the insert row
2051 */
2052 public void deleteRow() throws SQLException {
2053 throw new UnsupportedOperationException(
2054 "ResultSet.deleteRow() unsupported");
2055 }
2056
2057 /***
2058 * Refreshes the current row with its most recent value in
2059 * the database. This method cannot be called when
2060 * the cursor is on the insert row.
2061 *
2062 * <P>The <code>refreshRow</code> method provides a way for an
2063 * application to
2064 * explicitly tell the JDBC driver to refetch a row(s) from the
2065 * database. An application may want to call <code>refreshRow</code> when
2066 * caching or prefetching is being done by the JDBC driver to
2067 * fetch the latest value of a row from the database. The JDBC driver
2068 * may actually refresh multiple rows at once if the fetch size is
2069 * greater than one.
2070 *
2071 * <P> All values are refetched subject to the transaction isolation
2072 * level and cursor sensitivity. If <code>refreshRow</code> is called after
2073 * calling an updater method, but before calling
2074 * the method <code>updateRow</code>, then the
2075 * updates made to the row are lost. Calling the method
2076 * <code>refreshRow</code> frequently will likely slow performance.
2077 *
2078 * @exception SQLException if a database access error
2079 * occurs or if this method is called when the cursor is on the insert row
2080 */
2081 public void refreshRow() throws SQLException {
2082 throw new UnsupportedOperationException(
2083 "ResultSet.refreshRow() unsupported");
2084 }
2085
2086 /***
2087 * Cancels the updates made to the current row in this
2088 * <code>ResultSet</code> object.
2089 * This method may be called after calling an
2090 * updater method(s) and before calling
2091 * the method <code>updateRow</code> to roll back
2092 * the updates made to a row. If no updates have been made or
2093 * <code>updateRow</code> has already been called, this method has no
2094 * effect.
2095 *
2096 * @exception SQLException if a database access error
2097 * occurs or if this method is called when the cursor is
2098 * on the insert row
2099 */
2100 public void cancelRowUpdates() throws SQLException {
2101 throw new UnsupportedOperationException(
2102 "ResultSet.cancelRowUpdates() unsupported");
2103 }
2104
2105 /***
2106 * Moves the cursor to the insert row. The current cursor position is
2107 * remembered while the cursor is positioned on the insert row.
2108 *
2109 * The insert row is a special row associated with an updatable
2110 * result set. It is essentially a buffer where a new row may
2111 * be constructed by calling the updater methods prior to
2112 * inserting the row into the result set.
2113 *
2114 * Only the updater, getter,
2115 * and <code>insertRow</code> methods may be
2116 * called when the cursor is on the insert row. All of the columns in
2117 * a result set must be given a value each time this method is
2118 * called before calling <code>insertRow</code>.
2119 * An updater method must be called before a
2120 * getter method can be called on a column value.
2121 *
2122 * @exception SQLException if a database access error occurs
2123 * or the result set is not updatable
2124 */
2125 public void moveToInsertRow() throws SQLException {
2126 throw new UnsupportedOperationException(
2127 "ResultSet.moveToInsertRow() unsupported");
2128 }
2129
2130 /***
2131 * Moves the cursor to the remembered cursor position, usually the
2132 * current row. This method has no effect if the cursor is not on
2133 * the insert row.
2134 *
2135 * @exception SQLException if a database access error occurs
2136 * or the result set is not updatable
2137 */
2138 public void moveToCurrentRow() throws SQLException {
2139 throw new UnsupportedOperationException(
2140 "ResultSet.moveToeCurrentRow() unsupported");
2141 }
2142
2143 /***
2144 * Retrieves the <code>Statement</code> object that produced this
2145 * <code>ResultSet</code> object.
2146 * If the result set was generated some other way, such as by a
2147 * <code>DatabaseMetaData</code> method, this method returns
2148 * <code>null</code>.
2149 *
2150 * @return the <code>Statment</code> object that produced
2151 * this <code>ResultSet</code> object or <code>null</code>
2152 * if the result set was produced some other way
2153 * @exception SQLException if a database access error occurs
2154 */
2155 public Statement getStatement() throws SQLException {
2156 return statement;
2157 }
2158
2159 /***
2160 * Retrieves the value of the designated column in the current row
2161 * of this <code>ResultSet</code> object as an <code>Object</code>
2162 * in the Java programming language.
2163 * If the value is an SQL <code>NULL</code>,
2164 * the driver returns a Java <code>null</code>.
2165 * This method uses the given <code>Map</code> object
2166 * for the custom mapping of the
2167 * SQL structured or distinct type that is being retrieved.
2168 *
2169 * @param i the first column is 1, the second is 2, ...
2170 * @param map a <code>java.util.Map</code> object that contains the mapping
2171 * from SQL type names to classes in the Java programming language
2172 * @return an <code>Object</code> in the Java programming language
2173 * representing the SQL value
2174 * @exception SQLException if a database access error occurs
2175 */
2176 public Object getObject(int i, Map map) throws SQLException {
2177 throw new UnsupportedOperationException(
2178 "ResultSet.getObject(int, Map) unsupported");
2179 }
2180
2181 /***
2182 * Retrieves the value of the designated column in the current row
2183 * of this <code>ResultSet</code> object as a <code>Ref</code> object
2184 * in the Java programming language.
2185 *
2186 * @param i the first column is 1, the second is 2, ...
2187 * @return a <code>Ref</code> object representing an SQL <code>REF</code>
2188 * value
2189 * @exception SQLException if a database access error occurs
2190 */
2191 public Ref getRef(int i) throws SQLException {
2192 throw new UnsupportedOperationException(
2193 "ResultSet.getRef(int) unsupported");
2194 }
2195
2196 /***
2197 * Retrieves the value of the designated column in the current row
2198 * of this <code>ResultSet</code> object as a <code>Blob</code> object
2199 * in the Java programming language.
2200 *
2201 * @param i the first column is 1, the second is 2, ...
2202 * @return a <code>Blob</code> object representing the SQL
2203 * <code>BLOB</code> value in the specified column
2204 * @exception SQLException if a database access error occurs
2205 */
2206 public Blob getBlob(int i) throws SQLException {
2207 throw new UnsupportedOperationException(
2208 "ResultSet.getBlob(int) unsupported");
2209 }
2210
2211 /***
2212 * Retrieves the value of the designated column in the current row
2213 * of this <code>ResultSet</code> object as a <code>Clob</code> object
2214 * in the Java programming language.
2215 *
2216 * @param i the first column is 1, the second is 2, ...
2217 * @return a <code>Clob</code> object representing the SQL
2218 * <code>CLOB</code> value in the specified column
2219 * @exception SQLException if a database access error occurs
2220 */
2221 public Clob getClob(int i) throws SQLException {
2222 throw new UnsupportedOperationException(
2223 "ResultSet.getClob(int) unsupported");
2224 }
2225
2226 /***
2227 * Retrieves the value of the designated column in the current row
2228 * of this <code>ResultSet</code> object as an <code>Array</code> object
2229 * in the Java programming language.
2230 *
2231 * @param i the first column is 1, the second is 2, ...
2232 * @return an <code>Array</code> object representing the SQL
2233 * <code>ARRAY</code> value in the specified column
2234 * @exception SQLException if a database access error occurs
2235 */
2236 public Array getArray(int i) throws SQLException {
2237 throw new UnsupportedOperationException(
2238 "ResultSet.getArray(int) unsupported");
2239 }
2240
2241 /***
2242 * Retrieves the value of the designated column in the current row
2243 * of this <code>ResultSet</code> object as an <code>Object</code>
2244 * in the Java programming language.
2245 * If the value is an SQL <code>NULL</code>,
2246 * the driver returns a Java <code>null</code>.
2247 * This method uses the specified <code>Map</code> object for
2248 * custom mapping if appropriate.
2249 *
2250 * @param colName the name of the column from which to retrieve the value
2251 * @param map a <code>java.util.Map</code> object that contains the mapping
2252 * from SQL type names to classes in the Java programming language
2253 * @return an <code>Object</code> representing the SQL value in the
2254 * specified column
2255 * @exception SQLException if a database access error occurs
2256 */
2257 public Object getObject(String colName, Map map) throws SQLException {
2258 throw new UnsupportedOperationException(
2259 "ResultSet.getObject(String, Map) unsupported");
2260 }
2261
2262 /***
2263 * Retrieves the value of the designated column in the current row
2264 * of this <code>ResultSet</code> object as a <code>Ref</code> object
2265 * in the Java programming language.
2266 *
2267 * @param colName the column name
2268 * @return a <code>Ref</code> object representing the SQL <code>REF</code>
2269 * value in the specified column
2270 * @exception SQLException if a database access error occurs
2271 */
2272 public Ref getRef(String colName) throws SQLException {
2273 throw new UnsupportedOperationException(
2274 "ResultSet.getRef(String) unsupported");
2275 }
2276
2277 /***
2278 * Retrieves the value of the designated column in the current row
2279 * of this <code>ResultSet</code> object as a <code>Blob</code> object
2280 * in the Java programming language.
2281 *
2282 * @param colName the name of the column from which to retrieve the value
2283 * @return a <code>Blob</code> object representing the SQL <code>BLOB</code>
2284 * value in the specified column
2285 * @exception SQLException if a database access error occurs
2286 */
2287 public Blob getBlob(String colName) throws SQLException {
2288 throw new UnsupportedOperationException(
2289 "ResultSet.getBlob(String) unsupported");
2290 }
2291
2292 /***
2293 * Retrieves the value of the designated column in the current row
2294 * of this <code>ResultSet</code> object as a <code>Clob</code> object
2295 * in the Java programming language.
2296 *
2297 * @param colName the name of the column from which to retrieve the value
2298 * @return a <code>Clob</code> object representing the SQL <code>CLOB</code>
2299 * value in the specified column
2300 * @exception SQLException if a database access error occurs
2301 */
2302 public Clob getClob(String colName) throws SQLException {
2303 throw new UnsupportedOperationException(
2304 "ResultSet.getClob(String) unsupported");
2305 }
2306
2307 /***
2308 * Retrieves the value of the designated column in the current row
2309 * of this <code>ResultSet</code> object as an <code>Array</code> object
2310 * in the Java programming language.
2311 *
2312 * @param colName the name of the column from which to retrieve the value
2313 * @return an <code>Array</code> object representing the SQL
2314 * <code>ARRAY</code> value in the specified column
2315 * @exception SQLException if a database access error occurs
2316 */
2317 public Array getArray(String colName) throws SQLException {
2318 throw new UnsupportedOperationException(
2319 "ResultSet.getArray(String) unsupported");
2320 }
2321
2322 /***
2323 * Retrieves the value of the designated column in the current row
2324 * of this <code>ResultSet</code> object as a <code>java.sql.Date</code>
2325 * object in the Java programming language.
2326 * This method uses the given calendar to construct an appropriate
2327 * millisecond value for the date if the underlying database does not store
2328 * timezone information.
2329 *
2330 * @param columnIndex the first column is 1, the second is 2, ...
2331 * @param cal the <code>java.util.Calendar</code> object
2332 * to use in constructing the date
2333 * @return the column value as a <code>java.sql.Date</code> object;
2334 * if the value is SQL <code>NULL</code>,
2335 * the value returned is <code>null</code> in the Java programming language
2336 * @exception SQLException if a database access error occurs
2337 */
2338 public Date getDate(int columnIndex, Calendar cal) throws SQLException {
2339 throw new UnsupportedOperationException(
2340 "ResultSet.getDate(int, Calendar) unsupported");
2341 }
2342
2343 /***
2344 * Retrieves the value of the designated column in the current row
2345 * of this <code>ResultSet</code> object as a <code>java.sql.Date</code>
2346 * object in the Java programming language.
2347 * This method uses the given calendar to construct an appropriate
2348 * millisecond value for the date if the underlying database does not store
2349 * timezone information.
2350 *
2351 * @param columnName the SQL name of the column from which to retrieve the
2352 * value
2353 * @param cal the <code>java.util.Calendar</code> object
2354 * to use in constructing the date
2355 * @return the column value as a <code>java.sql.Date</code> object;
2356 * if the value is SQL <code>NULL</code>,
2357 * the value returned is <code>null</code> in the Java programming language
2358 * @exception SQLException if a database access error occurs
2359 */
2360 public Date getDate(String columnName, Calendar cal) throws SQLException {
2361 throw new UnsupportedOperationException(
2362 "ResultSet.getDate(String, Calendar) unsupported");
2363 }
2364
2365 /***
2366 * Retrieves the value of the designated column in the current row
2367 * of this <code>ResultSet</code> object as a <code>java.sql.Time</code>
2368 * object in the Java programming language.
2369 * This method uses the given calendar to construct an appropriate
2370 * millisecond value for the time if the underlying database does not store
2371 * timezone information.
2372 *
2373 * @param columnIndex the first column is 1, the second is 2, ...
2374 * @param cal the <code>java.util.Calendar</code> object
2375 * to use in constructing the time
2376 * @return the column value as a <code>java.sql.Time</code> object;
2377 * if the value is SQL <code>NULL</code>,
2378 * the value returned is <code>null</code> in the Java programming language
2379 * @exception SQLException if a database access error occurs
2380 */
2381 public Time getTime(int columnIndex, Calendar cal) throws SQLException {
2382 throw new UnsupportedOperationException(
2383 "ResultSet.getTime(int, Calendar) unsupported");
2384 }
2385
2386 /***
2387 * Retrieves the value of the designated column in the current row
2388 * of this <code>ResultSet</code> object as a <code>java.sql.Time</code>
2389 * object in the Java programming language.
2390 * This method uses the given calendar to construct an appropriate
2391 * millisecond value for the time if the underlying database does not store
2392 * timezone information.
2393 *
2394 * @param columnName the SQL name of the column
2395 * @param cal the <code>java.util.Calendar</code> object
2396 * to use in constructing the time
2397 * @return the column value as a <code>java.sql.Time</code> object;
2398 * if the value is SQL <code>NULL</code>,
2399 * the value returned is <code>null</code> in the Java programming language
2400 * @exception SQLException if a database access error occurs
2401 */
2402 public Time getTime(String columnName, Calendar cal) throws SQLException {
2403 throw new UnsupportedOperationException(
2404 "ResultSet.getTime(String, Calendar) unsupported");
2405 }
2406
2407 /***
2408 * Retrieves the value of the designated column in the current row
2409 * of this <code>ResultSet</code> object as a
2410 * <code>java.sql.Timestamp</code> object in the Java programming language.
2411 * This method uses the given calendar to construct an appropriate
2412 * millisecond value for the timestamp if the underlying database does not
2413 * store timezone information.
2414 *
2415 * @param columnIndex the first column is 1, the second is 2, ...
2416 * @param cal the <code>java.util.Calendar</code> object
2417 * to use in constructing the timestamp
2418 * @return the column value as a <code>java.sql.Timestamp</code> object;
2419 * if the value is SQL <code>NULL</code>,
2420 * the value returned is <code>null</code> in the Java programming language
2421 * @exception SQLException if a database access error occurs
2422 */
2423 public Timestamp getTimestamp(int columnIndex, Calendar cal)
2424 throws SQLException {
2425 throw new UnsupportedOperationException(
2426 "ResultSet.getTimestamp(int, Calendar) unsupported");
2427 }
2428
2429 /***
2430 * Retrieves the value of the designated column in the current row
2431 * of this <code>ResultSet</code> object as a <code>java.sql.Time</code>
2432 * object in the Java programming language.
2433 * This method uses the given calendar to construct an appropriate
2434 * millisecond value for the time if the underlying database does not store
2435 * timezone information.
2436 *
2437 * @param columnName the SQL name of the column
2438 * @param cal the <code>java.util.Calendar</code> object
2439 * to use in constructing the time
2440 * @return the column value as a <code>java.sql.Time</code> object;
2441 * if the value is SQL <code>NULL</code>,
2442 * the value returned is <code>null</code> in the Java programming language
2443 * @exception SQLException if a database access error occurs
2444 */
2445 public Timestamp getTimestamp(String columnName, Calendar cal)
2446 throws SQLException {
2447 throw new UnsupportedOperationException(
2448 "ResultSet.getTimestamp(String, Calendar) unsupported");
2449 }
2450
2451 //---------------------------------------------------------------------
2452 // CSV JDBC private helper methods
2453 //---------------------------------------------------------------------
2454
2455 /***
2456 * Perform pre-accessor method processing
2457 * @param columnIndex the first column is 1, the second is 2, ...
2458 * @exception SQLException if a database access error occurs
2459 */
2460 private void preAccessor(int columnIndex) throws SQLException {
2461 // set last read column index for wasNull()
2462 lastIndexRead = columnIndex;
2463 // implicitly close InputStream for get*Stream() between accessors
2464 if(is != null) {
2465 try {
2466 is.close();
2467 } catch (IOException e) {
2468 throw new SQLException("Could not close InputStream: " + e);
2469 }
2470 is = null;
2471 }
2472 }
2473
2474 /***
2475 * Perform pre-accessor method processing
2476 * @param columnName the SQL name of the column
2477 * @exception SQLException if a database access error occurs
2478 */
2479 private void preAccessor(String columnName) throws SQLException {
2480 // locate the index number and delegate to preAccessor(int)
2481 for (int i = 0; i < columnNames.length; i++) {
2482 if (columnName.equalsIgnoreCase(columnNames[i])) {
2483 preAccessor(i+1);
2484 }
2485 }
2486 }
2487
2488 //---------------------------------------------------------------------
2489 // JDBC 3.0
2490 //---------------------------------------------------------------------
2491
2492 public URL getURL(int columnIndex) throws SQLException {
2493 throw new UnsupportedOperationException("ResultSet.getURL(int) unsupported");
2494 }
2495
2496 public URL getURL(String columnName) throws SQLException {
2497 throw new UnsupportedOperationException("ResultSet.getURL(String) unsupported");
2498 }
2499
2500 public void updateRef(int columnIndex, Ref x) throws SQLException {
2501 throw new UnsupportedOperationException("ResultSet.updateRef(int,java.sql.Ref) unsupported");
2502 }
2503
2504 public void updateRef(String columnName, Ref x) throws SQLException {
2505 throw new UnsupportedOperationException("ResultSet.updateRef(String,java.sql.Ref) unsupported");
2506 }
2507
2508 public void updateBlob(int columnIndex, Blob x) throws SQLException {
2509 throw new UnsupportedOperationException("ResultSet.updateBlob(int,java.sql.Blob) unsupported");
2510 }
2511
2512 public void updateBlob(String columnName, Blob x) throws SQLException {
2513 throw new UnsupportedOperationException("ResultSet.updateBlob(String,java.sql.Blob) unsupported");
2514 }
2515
2516 public void updateClob(int columnIndex, Clob x) throws SQLException {
2517 throw new UnsupportedOperationException("ResultSet.updateClob(int,java.sql.Clob) unsupported");
2518 }
2519
2520 public void updateClob(String columnName, Clob x) throws SQLException {
2521 throw new UnsupportedOperationException("ResultSet.updateClob(String,java.sql.Clob) unsupported");
2522 }
2523
2524 public void updateArray(int columnIndex, Array x) throws SQLException {
2525 throw new UnsupportedOperationException("ResultSet.updateArray(int,java.sql.Array) unsupported");
2526 }
2527
2528 public void updateArray(String columnName, Array x) throws SQLException {
2529 throw new UnsupportedOperationException("ResultSet.updateArray(String,java.sql.Array) unsupported");
2530 }
2531
2532 }
2533
This page automatically generated by Maven