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