Source Code Cross Referenced for jdbcResultSet.java in  » Database-DBMS » hsql » org » hsqldb » jdbc » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » hsql » org.hsqldb.jdbc 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        /* Copyright (c) 1995-2000, The Hypersonic SQL Group.
0002:         * All rights reserved.
0003:         *
0004:         * Redistribution and use in source and binary forms, with or without
0005:         * modification, are permitted provided that the following conditions are met:
0006:         *
0007:         * Redistributions of source code must retain the above copyright notice, this
0008:         * list of conditions and the following disclaimer.
0009:         *
0010:         * Redistributions in binary form must reproduce the above copyright notice,
0011:         * this list of conditions and the following disclaimer in the documentation
0012:         * and/or other materials provided with the distribution.
0013:         *
0014:         * Neither the name of the Hypersonic SQL Group nor the names of its
0015:         * contributors may be used to endorse or promote products derived from this
0016:         * software without specific prior written permission.
0017:         *
0018:         * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0019:         * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0020:         * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0021:         * ARE DISCLAIMED. IN NO EVENT SHALL THE HYPERSONIC SQL GROUP,
0022:         * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
0023:         * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
0024:         * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
0025:         * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
0026:         * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0027:         * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
0028:         * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0029:         *
0030:         * This software consists of voluntary contributions made by many individuals 
0031:         * on behalf of the Hypersonic SQL Group.
0032:         *
0033:         *
0034:         * For work added by the HSQL Development Group:
0035:         *
0036:         * Copyright (c) 2001-2005, The HSQL Development Group
0037:         * All rights reserved.
0038:         *
0039:         * Redistribution and use in source and binary forms, with or without
0040:         * modification, are permitted provided that the following conditions are met:
0041:         *
0042:         * Redistributions of source code must retain the above copyright notice, this
0043:         * list of conditions and the following disclaimer.
0044:         *
0045:         * Redistributions in binary form must reproduce the above copyright notice,
0046:         * this list of conditions and the following disclaimer in the documentation
0047:         * and/or other materials provided with the distribution.
0048:         *
0049:         * Neither the name of the HSQL Development Group nor the names of its
0050:         * contributors may be used to endorse or promote products derived from this
0051:         * software without specific prior written permission.
0052:         *
0053:         * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0054:         * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0055:         * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0056:         * ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
0057:         * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
0058:         * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
0059:         * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
0060:         * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
0061:         * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0062:         * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
0063:         * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0064:         */
0065:
0066:        package org.hsqldb.jdbc;
0067:
0068:        import java.io.ByteArrayInputStream;
0069:        import java.io.StringReader;
0070:        import java.math.BigDecimal;
0071:        import java.sql.Date;
0072:        import java.sql.ResultSet;
0073:        import java.sql.ResultSetMetaData;
0074:        import java.sql.SQLException;
0075:        import java.sql.SQLWarning;
0076:        import java.sql.Statement;
0077:        import java.sql.Time;
0078:        import java.sql.Timestamp;
0079:        import java.util.Calendar;
0080:
0081:        //#ifdef JAVA2
0082:        import java.sql.Array;
0083:        import java.sql.Blob;
0084:        import java.sql.Clob;
0085:        import java.sql.Ref;
0086:        import java.util.Map;
0087:
0088:        //#endif JAVA2
0089:        import org.hsqldb.Column;
0090:        import org.hsqldb.HsqlDateTime;
0091:        import org.hsqldb.HsqlException;
0092:        import org.hsqldb.Record;
0093:        import org.hsqldb.Result;
0094:        import org.hsqldb.ResultConstants;
0095:        import org.hsqldb.Trace;
0096:        import org.hsqldb.Types;
0097:        import org.hsqldb.lib.AsciiStringInputStream;
0098:        import org.hsqldb.lib.StringInputStream;
0099:        import org.hsqldb.persist.HsqlProperties;
0100:        import org.hsqldb.types.Binary;
0101:        import org.hsqldb.types.JavaObject;
0102:
0103:        // fredt@users 20020320 - patch 1.7.0 - JDBC 2 support and error trapping
0104:        // JDBC 2 methods can now be called from jdk 1.1.x - see javadoc comments
0105:        // SCROLL_INSENSITIVE and FORWARD_ONLY types for ResultSet are now supported
0106:        // fredt@users 20020315 - patch 497714 by lakuhns@users - scrollable ResultSet
0107:        // all absolute and relative positioning methods defined
0108:        // boucherb@users 20020409 - added "throws SQLException" to all methods where
0109:        // it was missing here but specified in the java.sql.ResultSet and
0110:        // java.sql.ResultSetMetaData interfaces, updated generic documentation to
0111:        // JDK 1.4, and added JDBC3 methods and docs
0112:        // boucherb@users and fredt@users 20020505 extensive review and update
0113:        // of docs and behaviour to comply with java.sql specification
0114:        // tony_lai@users 20020820 - patch 595073 - duplicated exception msg
0115:        // fredt@users 20030622 - patch 1.7.2 - columns and labels are case sensitive
0116:        // boucherb@users 200404xx - javadoc updates
0117:
0118:        /**
0119:         * <!-- start generic documentation -->
0120:         * A table of data representing a database result set, which
0121:         * is usually generated by executing a statement that queries the database.
0122:         *
0123:         * <P>A <code>ResultSet</code> object  maintains a cursor pointing
0124:         * to its current row of data.  Initially the cursor is positioned
0125:         * before the first row. The <code>next</code> method moves the
0126:         * cursor to the next row, and because it returns <code>false</code>
0127:         * when there are no more rows in the <code>ResultSet</code> object,
0128:         * it can be used in a <code>while</code> loop to iterate through
0129:         * the result set.
0130:         * <P>
0131:         * A default <code>ResultSet</code> object is not updatable and
0132:         * has a cursor that moves forward only.  Thus, you can
0133:         * iterate through it only once and only from the first row to the
0134:         * last row. It is possible to
0135:         * produce <code>ResultSet</code> objects that are scrollable and/or
0136:         * updatable.  The following code fragment, in which <code>con</code>
0137:         * is a valid <code>Connection</code> object, illustrates how to make
0138:         * a result set that is scrollable and insensitive to updates by others,
0139:         * and that is updatable. See <code>ResultSet</code> fields for other
0140:         * options.
0141:         * <PRE>
0142:         *
0143:         * Statement stmt = con.createStatement(
0144:         *                            ResultSet.TYPE_SCROLL_INSENSITIVE,
0145:         *                            ResultSet.CONCUR_UPDATABLE);
0146:         * ResultSet rs = stmt.executeQuery("SELECT a, b FROM TABLE2");
0147:         * // rs will be scrollable, will not show changes made by others,
0148:         * // and will be updatable
0149:         *
0150:         * </PRE>
0151:         * The <code>ResultSet</code> interface provides
0152:         * <i>getter</i> methods (<code>getBoolean</code>, <code>getLong</code>,
0153:         * and so on) for retrieving column values from the current row.
0154:         * Values can be retrieved using either the index number of the
0155:         * column or the name of the column.  In general, using the
0156:         * column index will be more efficient.  Columns are numbered from 1.
0157:         * For maximum portability, result set columns within each row should be
0158:         * read in left-to-right order, and each column should be read only once.
0159:         *
0160:         * <P>For the getter methods, a JDBC driver attempts
0161:         * to convert the underlying data to the Java type specified in the
0162:         * getter method and returns a suitable Java value.  The JDBC specification
0163:         * has a table showing the allowable mappings from SQL types to Java types
0164:         * that can be used by the <code>ResultSet</code> getter methods.
0165:         * <P>
0166:         * <P>Column names used as input to getter methods are case
0167:         * insensitive.  When a getter method is called  with
0168:         * a column name and several columns have the same name,
0169:         * the value of the first matching column will be returned.
0170:         * The column name option is
0171:         * designed to be used when column names are used in the SQL
0172:         * query that generated the result set.
0173:         * For columns that are NOT explicitly named in the query, it
0174:         * is best to use column numbers. If column names are used, there is
0175:         * no way for the programmer to guarantee that they actually refer to
0176:         * the intended columns.
0177:         * <P>
0178:         * A set of updater methods were added to this interface
0179:         * in the JDBC 2.0 API (Java<sup><font size=-2>TM</font></sup> 2 SDK,
0180:         * Standard Edition, version 1.2). The comments regarding parameters
0181:         * to the getter methods also apply to parameters to the
0182:         * updater methods.
0183:         * <P>
0184:         * The updater methods may be used in two ways:
0185:         * <ol>
0186:         * <LI>to update a column value in the current row.  In a scrollable
0187:         * <code>ResultSet</code> object, the cursor can be moved backwards
0188:         * and forwards, to an absolute position, or to a position
0189:         * relative to the current row.
0190:         * The following code fragment updates the <code>NAME</code> column
0191:         * in the fifth row of the <code>ResultSet</code> object
0192:         * <code>rs</code> and then uses the method <code>updateRow</code>
0193:         * to update the data source table from which <code>rs</code> was
0194:         * derived.
0195:         * <PRE>
0196:         *
0197:         * rs.absolute(5); // moves the cursor to the fifth row of rs
0198:         * rs.updateString("NAME", "AINSWORTH"); // updates the
0199:         * // <code>NAME</code> column of row 5 to be <code>AINSWORTH</code>
0200:         * rs.updateRow(); // updates the row in the data source
0201:         *
0202:         * </PRE>
0203:         * <LI>to insert column values into the insert row.  An updatable
0204:         * <code>ResultSet</code> object has a special row associated with
0205:         * it that serves as a staging area for building a row to be inserted.
0206:         * The following code fragment moves the cursor to the insert row, builds
0207:         * a three-column row, and inserts it into <code>rs</code> and into
0208:         * the data source table using the method <code>insertRow</code>.
0209:         * <PRE>
0210:         *
0211:         * rs.moveToInsertRow(); // moves cursor to the insert row
0212:         * rs.updateString(1, "AINSWORTH"); // updates the
0213:         * // first column of the insert row to be <code>AINSWORTH</code>
0214:         * rs.updateInt(2,35); // updates the second column to be <code>35</code>
0215:         * rs.updateBoolean(3, true); // updates the third row to <code>true</code>
0216:         * rs.insertRow();
0217:         * rs.moveToCurrentRow();
0218:         *
0219:         * </PRE>
0220:         * </ol>
0221:         * <P>A <code>ResultSet</code> object is automatically closed when the
0222:         * <code>Statement</code> object that
0223:         * generated it is closed, re-executed, or used
0224:         * to retrieve the next result from a sequence of multiple results.
0225:         *
0226:         * <P>The number, types and properties of a <code>ResultSet</code>
0227:         * object's columns are provided by the <code>ResulSetMetaData</code>
0228:         * object returned by the <code>ResultSet.getMetaData</code> method. <p>
0229:         * <!-- end generic documentation -->
0230:         *
0231:         * <!-- start release-specific documentation -->
0232:         * <div class="ReleaseSpecificDocumentation">
0233:         * <h3>HSQLDB-Specific Information:</h3> <p>
0234:         *
0235:         * A <code>ResultSet</code> object generated by HSQLDB is by default of
0236:         * <code>ResultSet.TYPE_FORWARD_ONLY</code> (as is standard JDBC behavior)
0237:         * and does not allow the use of absolute and relative positioning
0238:         * methods.  However, since 1.7.0, if a statement is created
0239:         * with:<p>
0240:         *
0241:         * <pre class="JavaCodeExample">
0242:         * Statement stmt = conn.<b>createStatement</b>(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
0243:         * </pre>
0244:         *
0245:         * then the <code>ResultSet</code> objects it produces support
0246:         * using all of  the absolute and relative positioning methods of JDBC2
0247:         * to set the position of the current row, for example:<p>
0248:         *
0249:         * <pre class="JavaCodeExample">
0250:         * rs.<b>absolute</b>(<span class="JavaNumericLiteral">5</span>);
0251:         * String fifthRowValue = rs.<b>getString</b>(<span class="JavaNumericLiteral">1</span>);
0252:         * rs.<b>relative</b>(<span class="JavaNumericLiteral">4</span>);
0253:         * String ninthRowValue = rs.<b>getString</b>(<span class="JavaNumericLiteral">1</span>);
0254:         * </pre>
0255:         *
0256:         * Note: An HSQLDB <code>ResultSet</code> object persists, even after its
0257:         * connection is closed.  This is regardless of the operational mode of
0258:         * the {@link Database Database} from which it came.  That is, they
0259:         * persist whether originating from a <code>Server</code>,
0260:         * <code>WebServer</code> or in-process mode <code>Database.</code>
0261:         * <p>
0262:         *
0263:         * Including HSQLDB 1.7.2, there is no support for any of the methods
0264:         * introduced in JDBC 2 relating to updateable result sets. These methods
0265:         * include all updateXXX methods, as well as the {@link #insertRow},
0266:         * {@link #updateRow}, {@link #deleteRow}, {@link #moveToInsertRow} (and so on)
0267:         * methods; invoking any such method throws an <code>SQLException</code>
0268:         * stating that the operation is not supported.
0269:         *
0270:         * <b>JRE 1.1.x Notes:</b> <p>
0271:         *
0272:         * In general, JDBC 2 support requires Java 1.2 and above, and JDBC 3 requires
0273:         * Java 1.4 and above. In HSQLDB, support for methods introduced in different
0274:         * versions of JDBC depends on the JDK version used for compiling and building
0275:         * HSQLDB.<p>
0276:         *
0277:         * Since 1.7.0, it is possible to build the product so that
0278:         * all JDBC 2 methods can be called while executing under the version 1.1.x
0279:         * <em>Java Runtime Environment</em><sup><font size="-2">TM</font></sup>.
0280:         * However, some of these method calls require <code>int</code> values that
0281:         * are defined only in the JDBC 2 or greater version of the
0282:         * <a href="http://java.sun.com/j2se/1.4/docs/api/java/sql/ResultSet.html">
0283:         * <code>ResultSet</code></a> interface.  For this reason, when the
0284:         * product is compiled under JDK 1.1.x, these values are defined here, in this
0285:         * class. <p>
0286:         *
0287:         * In a JRE 1.1.x environment, calling JDBC 2 methods that take or return the
0288:         * JDBC2-only <code>ResultSet</code> values can be achieved by referring
0289:         * to them in parameter specifications and return value comparisons,
0290:         * respectively, as follows: <p>
0291:         *
0292:         * <pre class="JavaCodeExample">
0293:         * jdbcResultSet.FETCH_FORWARD
0294:         * jdbcResultSet.TYPE_FORWARD_ONLY
0295:         * jdbcResultSet.TYPE_SCROLL_INSENSITIVE
0296:         * jdbcResultSet.CONCUR_READ_ONLY
0297:         * // etc.
0298:         * </pre>
0299:         *
0300:         * However, please note that code written in such a manner will not be
0301:         * compatible for use with other JDBC 2 drivers, since they expect and use
0302:         * <code>ResultSet</code>, rather than <code>jdbcResultSet</code>.  Also
0303:         * note, this feature is offered solely as a convenience to developers
0304:         * who must work under JDK 1.1.x due to operating constraints, yet wish to
0305:         * use some of the more advanced features available under the JDBC 2
0306:         * specification.<p>
0307:         *
0308:         * (fredt@users) <br>
0309:         * (boucherb@users)<p>
0310:         *
0311:         * </div>
0312:         * @see jdbcStatement#executeQuery
0313:         * @see jdbcStatement#getResultSet
0314:         * @see <a href=
0315:         * "http://java.sun.com/j2se/1.4/docs/api/java/sql/ResultSetMetaData.html">
0316:         * <code>ResultSetMetaData</code></a>
0317:         *
0318:         * Extensively rewritten and extended in successive versions of HSQLDB.
0319:         *
0320:         * @author Thomas Mueller (Hypersonic SQL Group)
0321:         * @version 1.8.0
0322:         * @since Hypersonic SQL
0323:         */
0324:        public class jdbcResultSet implements  ResultSet {
0325:
0326:            // fredt@users 20020320 - patch 497714 by lakuhns@users - scrollable ResultSet
0327:            // variable values in different states
0328:            // Condition definitions
0329:            //                  bInit  iCurrentRow  nCurrent  nCurrent.next
0330:            //                  -----  -----------  --------  -------------
0331:            // beforeFirst      false       0         N/A          N/A
0332:            // first            true        1        !null    next or null
0333:            // last             true    last row #   !null        null
0334:            // afterLast        true   last row + 1   N/A         N/A
0335:            //------------------------ Private Attributes --------------------------
0336:            /*
0337:             * Campbell's comments
0338:             * Future Development Information for Developers and Contributors<p>
0339:             * Providing a
0340:             * full and robust implementation guaranteeing consistently accurate
0341:             * results and behaviour depends upon introducing several new engine
0342:             * features for which the internals of the product currently have no
0343:             * infrastructure: <p>
0344:             *
0345:             * <OL>
0346:             * <LI>a unique rowid for each row in the database which lasts the life
0347:             *  of a row, independent of any updates made to that row</LI>
0348:             * <LI>the ability to explicitly lock either the tables or the
0349:             *  individual rows of an updateable result, for the duration that
0350:             *  the result is open</LI>
0351:             * <LI>the ability to choose between transactions supporting repeatable
0352:             *  reads, committed reads, and uncommitted reads
0353:             * <LI>the ability to map an updated result row's columns back to
0354:             *  specific updateable objects on the database.<p>
0355:             *
0356:             *  <B>Note:</B> Typically, it is easy to do this mapping if all the
0357:             *  rows of a result consist of columns from a single table.  And it
0358:             *  is especially easy if the result's columns are a superset of the
0359:             *  primary key columns of that table.  The ability to
0360:             *  update a result consisting of any combintation of join, union,
0361:             *  intersect, difference and grouping operations, however, is much more
0362:             *  complex to implement and often impossible, especially under
0363:             *  grouping and non-natural joins.  Also, it is not even guaranteed
0364:             *  that the columns of a result map back to *any* updateable object
0365:             *  on the database, for instance in the cases where the
0366:             *  result's column values are general expressions or the result
0367:             *  comes from a stored procedure where the data may not even come,
0368:             *  directly or indirectly, from updateable database objects such as
0369:             *  columns in table rows.
0370:             * </OL>
0371:             *
0372:             * For developers working under a JDBC3 environment,
0373:             * it is gently recommended to take a look at Sun's early access
0374:             * <a href="http://developer.java.sun.com/developer/earlyAccess/crs/">
0375:             * <code>RowSet</code></a> implementation, as this can be used to add
0376:             * JDBC driver independent scrollablility and updateability.
0377:             * However, as a driver independent implementation, it obviously cannot
0378:             * guarantee to use the traditional table and/or row locking features
0379:             * that many DBMS make available to ensure the success of all
0380:             * valid updates against updateable results sets.  As such, performing
0381:             * updates through Sun's early access <code>RowSet</code> implementation
0382:             * may not always succeed, even when it is generally expected that they
0383:             * should.  This is because the condition used to find the original row
0384:             * on the database to update (which, for a driver independent
0385:             * implementation, would have to be equality on all columns values of
0386:             * the originally retrieved row) can become invalid if another
0387:             * transaction modifies or deletes that row on the database at some
0388:             * point between the time the row was last retrieved or refreshed in
0389:             * the RowSet and the time the RowSet attempts to make its next
0390:             * update to that row.  Also, any driver independent implementation
0391:             * of RowSet is still dependent on each driver guaranteeing that its
0392:             * <code>ResultSet</code> objects return completely accurate
0393:             * <code>ResultSetMetaData</code> that fulfills all of the
0394:             * JDBC <code>ResultSetMetaData</code> contracts under all circumstances.
0395:             * However, up to and including 1.7.0, HSQLDB does not make such guarantees
0396:             * under all conditions. See the discussion at {@link #getMetaData}.
0397:             * (boucherb@users) (version 1.7.0)<p>
0398:             */
0399:
0400:            // boucherb@users/hiep256@users 20010829 - patch 1.7.2 - allow expression to
0401:            // return Results as Object, where object is Result or jdbcResultSet.
0402:            // - rResult access changed to allow getting internal result object
0403:            // from Parser.processCall()
0404:            /** Statement is closed when its result set is closed */
0405:            boolean autoClose;
0406:
0407:            /** The internal representation. */
0408:            public Result rResult;
0409:
0410:            /**
0411:             * The current record containing the data for the row
0412:             */
0413:            private Record nCurrent;
0414:
0415:            /** The row upon which this ResultSet is currently positioned. */
0416:            private int iCurrentRow;
0417:
0418:            /** When the result of updating the database, the number of updated rows. */
0419:            private int iUpdateCount;
0420:
0421:            /** Is current row before the first row? */
0422:            private boolean bInit; // false if before first row
0423:
0424:            /** How many columns does this ResultSet have? */
0425:            int iColumnCount;
0426:
0427:            /** Did the last getXXX method encounter a null value? */
0428:            private boolean bWasNull;
0429:
0430:            /** The ResultSetMetaData object for this ResultSet */
0431:            private ResultSetMetaData rsmd;
0432:
0433:            /** Properties of this ResultSet's parent Connection. */
0434:            private HsqlProperties connProperties;
0435:
0436:            /** is the connection via network */
0437:            private boolean isNetConn;
0438:
0439:            /**
0440:             * The Statement that generated this result. Null if the result is
0441:             * from DatabaseMetaData<p>
0442:             */
0443:            jdbcStatement sqlStatement;
0444:
0445:            //------------------------ Package Attributes --------------------------
0446:
0447:            /**
0448:             * The scrollability / scroll sensitivity type of this result.
0449:             */
0450:            int rsType = TYPE_FORWARD_ONLY;
0451:
0452:            /**
0453:             * <!-- start generic documentation -->
0454:             * Moves the cursor down one row from its current position.
0455:             * A <code>ResultSet</code> cursor is initially positioned
0456:             * before the first row; the first call to the method
0457:             * <code>next</code> makes the first row the current row; the
0458:             * second call makes the second row the current row, and so on.
0459:             *
0460:             * <P>If an input stream is open for the current row, a call
0461:             * to the method <code>next</code> will
0462:             * implicitly close it. A <code>ResultSet</code> object's
0463:             * warning chain is cleared when a new row is read. <p>
0464:             *
0465:             * <!-- end generic documentation -->
0466:             *
0467:             * @return <code>true</code> if the new current row is valid;
0468:             * <code>false</code> if there are no more rows
0469:             * @exception SQLException if a database access error occurs
0470:             */
0471:            public boolean next() throws SQLException {
0472:
0473:                bWasNull = false;
0474:
0475:                // Have an empty resultset so exit with false
0476:                if (rResult == null || rResult.isEmpty()) {
0477:                    return false;
0478:                }
0479:
0480:                if (!bInit) {
0481:
0482:                    // The resultset has not been traversed, so set the cursor
0483:                    // to the first row (1)
0484:                    nCurrent = rResult.rRoot;
0485:                    bInit = true;
0486:                    iCurrentRow = 1;
0487:                } else {
0488:
0489:                    // The resultset has been traversed, if afterLast, return false
0490:                    if (nCurrent == null) {
0491:                        return false;
0492:                    }
0493:
0494:                    // On a valid row so go to next
0495:                    nCurrent = nCurrent.next;
0496:
0497:                    iCurrentRow++;
0498:                }
0499:
0500:                // finally test to see if we are in an afterLast situation
0501:                if (nCurrent == null) {
0502:
0503:                    // Yes, set the current row to after last and exit with false
0504:                    iCurrentRow = rResult.getSize() + 1;
0505:
0506:                    return false;
0507:                } else {
0508:
0509:                    // Not afterLast, so success
0510:                    return true;
0511:                }
0512:            }
0513:
0514:            /**
0515:             * <!-- start generic documentation -->
0516:             * Releases this <code>ResultSet</code> object's database and
0517:             * JDBC resources immediately instead of waiting for
0518:             * this to happen when it is automatically closed.
0519:             *
0520:             * <P><B>Note:</B> A <code>ResultSet</code> object
0521:             * is automatically closed by the
0522:             * <code>Statement</code> object that generated it when
0523:             * that <code>Statement</code> object is closed,
0524:             * re-executed, or is used to retrieve the next result from a
0525:             * sequence of multiple results. A <code>ResultSet</code> object
0526:             * is also automatically closed when it is garbage collected. <p>
0527:             * <!-- end generic documentation -->
0528:             *
0529:             * @exception SQLException if a database access error occurs
0530:             */
0531:            public void close() throws SQLException {
0532:
0533:                iUpdateCount = -1;
0534:                rResult = null;
0535:
0536:                if (autoClose) {
0537:                    sqlStatement.close();
0538:                }
0539:            }
0540:
0541:            /**
0542:             * <!-- start generic documentation -->
0543:             * Reports whether
0544:             * the last column read had a value of SQL <code>NULL</code>.
0545:             * Note that you must first call one of the getter methods
0546:             * on a column to try to read its value and then call
0547:             * the method <code>wasNull</code> to see if the value read was
0548:             * SQL <code>NULL</code>. <p>
0549:             * <!-- end generic documentation -->
0550:             *
0551:             * @return <code>true</code> if the last column value read was SQL
0552:             *     <code>NULL</code> and <code>false</code> otherwise
0553:             * @exception SQLException if a database access error occurs
0554:             */
0555:            public boolean wasNull() throws SQLException {
0556:                return bWasNull;
0557:            }
0558:
0559:            //======================================================================
0560:            // Methods for accessing results by column index
0561:            //======================================================================
0562:
0563:            /**
0564:             * <!-- start generic documentation -->
0565:             * Retrieves the value of the designated column in the current row
0566:             * of this <code>ResultSet</code> object as
0567:             * a <code>String</code> in the Java programming language. <p>
0568:             * <!-- end generic documentation -->
0569:             *
0570:             * @param columnIndex the first column is 1, the second is 2, ...
0571:             * @return the column value; if the value is SQL <code>NULL</code>, the
0572:             * value returned is <code>null</code>
0573:             * @exception SQLException if a database access error occurs
0574:             */
0575:            public String getString(int columnIndex) throws SQLException {
0576:                return (String) getColumnInType(columnIndex, Types.CHAR);
0577:            }
0578:
0579:            /**
0580:             * <!-- start generic documentation -->
0581:             * Retrieves the value of the designated column in the current row
0582:             * of this <code>ResultSet</code> object as
0583:             * a <code>boolean</code> in the Java programming language. <p>
0584:             * <!-- end generic documentation -->
0585:             *
0586:             * @param columnIndex the first column is 1, the second is 2, ...
0587:             * @return the column value; if the value is SQL <code>NULL</code>, the
0588:             * value returned is <code>false</code>
0589:             * @exception SQLException if a database access error occurs
0590:             */
0591:            public boolean getBoolean(int columnIndex) throws SQLException {
0592:
0593:                Object o = getColumnInType(columnIndex, Types.BOOLEAN);
0594:
0595:                return o == null ? false : ((Boolean) o).booleanValue();
0596:            }
0597:
0598:            /**
0599:             * <!-- start generic documentation -->
0600:             * Retrieves the value of the designated column in the current row
0601:             * of this <code>ResultSet</code> object as
0602:             * a <code>byte</code> in the Java programming language. <p>
0603:             * <!-- end generic documentation -->
0604:             *
0605:             * @param columnIndex the first column is 1, the second is 2, ...
0606:             * @return the column value; if the value is SQL <code>NULL</code>, the
0607:             * value returned is <code>0</code>
0608:             * @exception SQLException if a database access error occurs
0609:             */
0610:            public byte getByte(int columnIndex) throws SQLException {
0611:
0612:                Object o = getColumnInType(columnIndex, Types.TINYINT);
0613:
0614:                return o == null ? 0 : ((Number) o).byteValue();
0615:            }
0616:
0617:            /**
0618:             * <!-- start generic documentation -->
0619:             * Retrieves the value of the designated column in the current row
0620:             * of this <code>ResultSet</code> object as
0621:             * a <code>short</code> in the Java programming language. <p>
0622:             * <!-- end generic documentation -->
0623:             *
0624:             * @param columnIndex the first column is 1, the second is 2, ...
0625:             * @return the column value; if the value is SQL <code>NULL</code>, the
0626:             * value returned is <code>0</code>
0627:             * @exception SQLException if a database access error occurs
0628:             */
0629:            public short getShort(int columnIndex) throws SQLException {
0630:
0631:                Object o = getColumnInType(columnIndex, Types.SMALLINT);
0632:
0633:                return o == null ? 0 : ((Number) o).shortValue();
0634:            }
0635:
0636:            /**
0637:             * <!-- start generic documentation -->
0638:             * Retrieves the value of the designated column in the current row
0639:             * of this <code>ResultSet</code> object as
0640:             * an <code>int</code> in the Java programming language. <p>
0641:             * <!-- end generic documentation -->
0642:             *
0643:             * @param columnIndex the first column is 1, the second is 2, ...
0644:             * @return the column value; if the value is SQL <code>NULL</code>, the
0645:             * value returned is <code>0</code>
0646:             * @exception SQLException if a database access error occurs
0647:             */
0648:            public int getInt(int columnIndex) throws SQLException {
0649:
0650:                Object o = getColumnInType(columnIndex, Types.INTEGER);
0651:
0652:                return o == null ? 0 : ((Number) o).intValue();
0653:            }
0654:
0655:            /**
0656:             * <!-- start generic documentation -->
0657:             * Retrieves the value of the designated column in the current row
0658:             * of this <code>ResultSet</code> object as
0659:             * a <code>long</code> in the Java programming language. <p>
0660:             * <!-- end generic documentation -->
0661:             *
0662:             * @param columnIndex the first column is 1, the second is 2, ...
0663:             * @return the column value; if the value is SQL <code>NULL</code>, the
0664:             * value returned is <code>0</code>
0665:             * @exception SQLException if a database access error occurs
0666:             */
0667:            public long getLong(int columnIndex) throws SQLException {
0668:
0669:                Object o = getColumnInType(columnIndex, Types.BIGINT);
0670:
0671:                return o == null ? 0 : ((Number) o).longValue();
0672:            }
0673:
0674:            /**
0675:             * <!-- start generic documentation -->
0676:             * Retrieves the value of the designated column in the current row
0677:             * of this <code>ResultSet</code> object as
0678:             * a <code>float</code> in the Java programming language. <p>
0679:             * <!-- end generic documentation -->
0680:             *
0681:             * @param columnIndex the first column is 1, the second is 2, ...
0682:             * @return the column value; if the value is SQL <code>NULL</code>, the
0683:             * value returned is <code>0</code>
0684:             * @exception SQLException if a database access error occurs
0685:             */
0686:            public float getFloat(int columnIndex) throws SQLException {
0687:
0688:                Object o = getColumnInType(columnIndex, Types.REAL);
0689:
0690:                return o == null ? (float) 0.0 : ((Number) o).floatValue();
0691:            }
0692:
0693:            /**
0694:             * <!-- start generic documentation -->
0695:             * Retrieves the value of the designated column in the current row
0696:             * of this <code>ResultSet</code> object as
0697:             * a <code>double</code> in the Java programming language. <p>
0698:             * <!-- end generic documentation -->
0699:             *
0700:             * @param columnIndex the first column is 1, the second is 2, ...
0701:             * @return the column value; if the value is SQL <code>NULL</code>, the
0702:             * value returned is <code>0</code>
0703:             * @exception SQLException if a database access error occurs
0704:             */
0705:            public double getDouble(int columnIndex) throws SQLException {
0706:
0707:                Object o = getColumnInType(columnIndex, Types.DOUBLE);
0708:
0709:                return o == null ? 0.0 : ((Number) o).doubleValue();
0710:            }
0711:
0712:            /**
0713:             * <!-- start generic documentation -->
0714:             * Retrieves the value of the designated column in the current row
0715:             * of this <code>ResultSet</code> object as
0716:             * a <code>java.sql.BigDecimal</code> in the Java programming language.<p>
0717:             * <!-- end generic documentation -->
0718:             *
0719:             * <!-- start release-specific documentation -->
0720:             * <div class="ReleaseSpecificDocumentation">
0721:             * <h3>HSQLDB-Specific Information:</h3> <p>
0722:             *
0723:             * Beginning with 1.7.0, HSQLDB converts the result and sets the scale
0724:             * with BigDecimal.ROUND_HALF_DOWN.
0725:             * </div>
0726:             * <!-- end release-specific documentation -->
0727:             *
0728:             * @param columnIndex the first column is 1, the second is 2, ...
0729:             * @param scale the number of digits to the right of the decimal point
0730:             * @return the column value; if the value is SQL <code>NULL</code>, the
0731:             * value returned is <code>null</code>
0732:             * @exception SQLException if a database access error occurs
0733:             * @deprecated by java.sun.com as of JDK 1.2
0734:             */
0735:
0736:            //#ifdef DEPRECATEDJDBC
0737:            public BigDecimal getBigDecimal(int columnIndex, int scale)
0738:                    throws SQLException {
0739:
0740:                // boucherb@users 20020502 - added conversion
0741:                BigDecimal bd = (BigDecimal) getColumnInType(columnIndex,
0742:                        Types.DECIMAL);
0743:
0744:                if (scale < 0) {
0745:                    throw Util.sqlException(Trace.INVALID_JDBC_ARGUMENT);
0746:                }
0747:
0748:                if (bd != null) {
0749:                    bd = bd.setScale(scale, BigDecimal.ROUND_HALF_DOWN);
0750:                }
0751:
0752:                return bd;
0753:            }
0754:
0755:            //#endif
0756:
0757:            /**
0758:             * <!-- start generic documentation -->
0759:             * Retrieves the value of the designated column in the current row
0760:             * of this <code>ResultSet</code> object as
0761:             * a <code>byte</code> array in the Java programming language.
0762:             * The bytes represent the raw values returned by the driver. <p>
0763:             * <!-- end generic documentation -->
0764:             *
0765:             * <!-- start release-specific documentation -->
0766:             * <div class="ReleaseSpecificDocumentation">
0767:             * <h3>HSQLDB-Specific Information:</h3> <p>
0768:             *
0769:             * HSQLDB returns correct values for columns of type <code>BINARY</code>,
0770:             * <code>CHAR</code> and their variations. For other types, it returns
0771:             * the <code>byte[]</code> for the <code>String</code> representation
0772:             * of the value.
0773:             * </div>
0774:             * <!-- end release-specific documentation -->
0775:             *
0776:             * @param columnIndex the first column is 1, the second is 2, ...
0777:             * @return the column value; if the value is SQL <code>NULL</code>, the
0778:             * value returned is <code>null</code>
0779:             * @exception SQLException if a database access error occurs
0780:             */
0781:            public byte[] getBytes(int columnIndex) throws SQLException {
0782:
0783:                Object x = getObject(columnIndex);
0784:
0785:                if (x == null) {
0786:                    return null;
0787:                }
0788:
0789:                if (x instanceof  byte[]) {
0790:                    return (byte[]) x;
0791:                }
0792:
0793:                if (x instanceof  java.lang.String) {
0794:                    return ((String) x).getBytes();
0795:                }
0796:
0797:                x = getColumnInType(columnIndex, Types.BINARY);
0798:
0799:                return (byte[]) x;
0800:            }
0801:
0802:            /**
0803:             * <!-- start generic documentation -->
0804:             * Retrieves the value of the designated column in the current row
0805:             * of this <code>ResultSet</code> object as a
0806:             * <code>java.sql.Date</code> object in the Java programming language.<p>
0807:             * <!-- end generic documentation -->
0808:             *
0809:             * @param columnIndex the first column is 1, the second is 2, ...
0810:             * @return the column value; if the value is SQL <code>NULL</code>, the
0811:             * value returned is <code>null</code>
0812:             * @exception SQLException if a database access error occurs
0813:             */
0814:            public Date getDate(int columnIndex) throws SQLException {
0815:                return (Date) getColumnInType(columnIndex, Types.DATE);
0816:            }
0817:
0818:            /**
0819:             * <!-- start generic documentation -->
0820:             * Retrieves the value of the designated column in the current row
0821:             * of this <code>ResultSet</code> object as a <code>java.sql.Time</code>
0822:             * object in the Java programming language. <p>
0823:             * <!-- end generic documentation -->
0824:             *
0825:             * @param columnIndex the first column is 1, the second is 2, ...
0826:             * @return the column value; if the value is SQL <code>NULL</code>, the
0827:             * value returned is <code>null</code>
0828:             * @exception SQLException if a database access error occurs
0829:             */
0830:            public Time getTime(int columnIndex) throws SQLException {
0831:                return (Time) getColumnInType(columnIndex, Types.TIME);
0832:            }
0833:
0834:            /**
0835:             * <!-- start generic documentation -->
0836:             * Retrieves the value of the designated column in the current row
0837:             * of this <code>ResultSet</code> object as
0838:             * a <code>java.sql.Timestamp</code> object in the Java programming
0839:             * language. <p>
0840:             * <!-- end generic documentation -->
0841:             *
0842:             * @param columnIndex the first column is 1, the second is 2, ...
0843:             * @return the column value; if the value is SQL <code>NULL</code>, the
0844:             * value returned is <code>null</code>
0845:             * @exception SQLException if a database access error occurs
0846:             */
0847:            public Timestamp getTimestamp(int columnIndex) throws SQLException {
0848:                return (Timestamp) getColumnInType(columnIndex, Types.TIMESTAMP);
0849:            }
0850:
0851:            /**
0852:             * <!-- start generic documentation -->
0853:             * Retrieves the value of the designated column in the current row
0854:             * of this <code>ResultSet</code> object as
0855:             * a stream of ASCII characters. The value can then be read in chunks
0856:             * from the stream. This method is particularly
0857:             * suitable for retrieving large <char>LONGVARCHAR</char> values.
0858:             * The JDBC driver will
0859:             * do any necessary conversion from the database format into ASCII.
0860:             *
0861:             * <P><B>Note:</B> All the data in the returned stream must be
0862:             * read prior to getting the value of any other column. The next
0863:             * call to a getter method implicitly closes the stream.  Also, a
0864:             * stream may return <code>0</code> when the method
0865:             * <code>InputStream.available</code>
0866:             * is called whether there is data available or not. <p>
0867:             * <!-- end generic documentation -->
0868:             *
0869:             * <!-- start release-specific documentation -->
0870:             * <div class="ReleaseSpecificDocumentation">
0871:             * <h3>HSQLDB-Specific Information:</h3> <p>
0872:             *
0873:             * The limitation noted above does not apply to HSQLDB.<p>
0874:             *
0875:             * In 1.6.1 and previous, getAsciiStream was identical to
0876:             * getUnicodeStream and both simply returned a byte stream
0877:             * constructed from the raw {@link #getBytes(int) getBytes}
0878:             * representation.
0879:             *
0880:             * Starting with 1.7.0, this has been updated to comply with the
0881:             * java.sql specification.
0882:             *
0883:             * When the column is of type CHAR and its variations, it requires no
0884:             * conversion since it is represented internally already as a
0885:             * Java String object. When the column is not of type CHAR and its
0886:             * variations, the returned stream is based on a conversion to the
0887:             * Java <code>String</code> representation of the value. In either case,
0888:             * the obtained stream is always equivalent to a stream of the low order
0889:             * bytes from the value's String representation. <p>
0890:             *
0891:             * HSQLDB SQL <code>CHAR</code> and its variations are all Unicode strings
0892:             * internally, so the recommended alternatives to this method are
0893:             * {@link #getString(int) getString},
0894:             * {@link #getUnicodeStream(int) getUnicodeStream} (<b>deprecated</b>)
0895:             * and new to 1.7.0: {@link #getCharacterStream(int) getCharacterStream}
0896:             * (now prefered over the deprecated getUnicodeStream alternative).
0897:             * </div>
0898:             * <!-- end release-specific documentation -->
0899:             *
0900:             * @param columnIndex the first column is 1, the second is 2, ...
0901:             * @return a Java input stream that delivers the database column value
0902:             * as a stream of one-byte ASCII characters;
0903:             * if the value is SQL <code>NULL</code>, the
0904:             * value returned is <code>null</code>
0905:             * @exception SQLException if a database access error occurs
0906:             */
0907:            public java.io.InputStream getAsciiStream(int columnIndex)
0908:                    throws SQLException {
0909:
0910:                String s = getString(columnIndex);
0911:
0912:                if (s == null) {
0913:                    return null;
0914:                }
0915:
0916:                return new AsciiStringInputStream(s);
0917:            }
0918:
0919:            /**
0920:             * <!-- start generic documentation -->
0921:             * Retrieves the value of the designated column in the current row
0922:             * of this <code>ResultSet</code> object as
0923:             * as a stream of two-byte Unicode characters. The first byte is
0924:             * the high byte; the second byte is the low byte.
0925:             *
0926:             * The value can then be read in chunks from the
0927:             * stream. This method is particularly
0928:             * suitable for retrieving large <code>LONGVARCHAR</code>values.  The
0929:             * JDBC driver will do any necessary conversion from the database
0930:             * format into Unicode.
0931:             *
0932:             * <P><B>Note:</B> All the data in the returned stream must be
0933:             * read prior to getting the value of any other column. The next
0934:             * call to a getter method implicitly closes the stream.
0935:             * Also, a stream may return <code>0</code> when the method
0936:             * <code>InputStream.available</code>
0937:             * is called, whether there is data available or not. <p>
0938:             * <!-- end generic documentation -->
0939:             *
0940:             * <!-- start release-specific documentation -->
0941:             * <div class="ReleaseSpecificDocumentation">
0942:             * <h3>HSQLDB-Specific Information:</h3> <p>
0943:             *
0944:             * The limitation noted above does not apply to HSQLDB.<p>
0945:             *
0946:             * Up to and including 1.6.1, getUnicodeStream (and getAsciiStream)
0947:             * both simply returned a byte stream constructed from the
0948:             * raw {@link #getBytes(int) getBytes} representation.
0949:             *
0950:             * Starting with 1.7.0, this has been corrected to comply with the
0951:             * java.sql specification.
0952:             *
0953:             * When the column is of type CHAR and its variations, it requires no
0954:             * conversion since it is represented internally already as
0955:             * Java Strings. When the column is not of type CHAR and its variations,
0956:             * the returned stream is based on a conversion to the
0957:             * Java <code>String</code> representation of the value. In either case,
0958:             * the obtained stream is always equivalent to a stream of
0959:             * bytes from the value's String representation, with high-byte first.
0960:             * </div>
0961:             * <!-- end release-specific documentation -->
0962:             *
0963:             * @param columnIndex the first column is 1, the second is 2, ...
0964:             * @return a Java input stream that delivers the database column value
0965:             *   as a stream of two-byte Unicode characters;
0966:             *   if the value is SQL <code>NULL</code>, the value returned is
0967:             *   <code>null</code>
0968:             * @exception SQLException if a database access error occurs
0969:             * @deprecated use <code>getCharacterStream</code> in place of
0970:             *        <code>getUnicodeStream</code>
0971:             */
0972:
0973:            //#ifdef DEPRECATEDJDBC
0974:            public java.io.InputStream getUnicodeStream(int columnIndex)
0975:                    throws SQLException {
0976:
0977:                String s = getString(columnIndex);
0978:
0979:                if (s == null) {
0980:                    return null;
0981:                }
0982:
0983:                return new StringInputStream(s);
0984:            }
0985:
0986:            //#endif
0987:
0988:            /**
0989:             * <!-- start generic documentation -->
0990:             * Retrieves the value of the designated column in the current row
0991:             * of this <code>ResultSet</code> object as a binary stream of
0992:             * uninterpreted bytes. The value can then be read in chunks from the
0993:             * stream. This method is particularly
0994:             * suitable for retrieving large <code>LONGVARBINARY</code> values.
0995:             *
0996:             * <P><B>Note:</B> All the data in the returned stream must be
0997:             * read prior to getting the value of any other column. The next
0998:             * call to a getter method implicitly closes the stream.  Also, a
0999:             * stream may return <code>0</code> when the method
1000:             * <code>InputStream.available</code>
1001:             * is called whether there is data available or not. <p>
1002:             * <!-- end generic documentation -->
1003:             *
1004:             * @param columnIndex the first column is 1, the second is 2, ...
1005:             * @return a Java input stream that delivers the database column value
1006:             *     as a stream of uninterpreted bytes;
1007:             *     if the value is SQL <code>NULL</code>, the value returned is
1008:             *     <code>null</code>
1009:             * @exception SQLException if a database access error occurs
1010:             */
1011:            // fredt@users 20020215 - patch 485704 by boucherb@users
1012:            public java.io.InputStream getBinaryStream(int columnIndex)
1013:                    throws SQLException {
1014:
1015:                byte[] b = getBytes(columnIndex);
1016:
1017:                return wasNull() ? null : new ByteArrayInputStream(b);
1018:            }
1019:
1020:            //======================================================================
1021:            // Methods for accessing results by column name
1022:            //======================================================================
1023:
1024:            /**
1025:             * <!-- start generic documentation -->
1026:             * Retrieves the value of the designated column in the current row
1027:             * of this <code>ResultSet</code> object as
1028:             * a <code>String</code> in the Java programming language. <p>
1029:             * <!-- end generic documentation -->
1030:             *
1031:             * @param columnName the SQL name of the column
1032:             * @return the column value; if the value is SQL <code>NULL</code>, the
1033:             * value returned is <code>null</code>
1034:             * @exception SQLException if a database access error occurs
1035:             */
1036:            public String getString(String columnName) throws SQLException {
1037:                return getString(findColumn(columnName));
1038:            }
1039:
1040:            /**
1041:             * <!-- start generic documentation -->
1042:             * Retrieves the value of the designated column in the current row
1043:             * of this <code>ResultSet</code> object as
1044:             * a <code>boolean</code> in the Java programming language. <p>
1045:             * <!-- end generic documentation -->
1046:             *
1047:             * @param columnName the SQL name of the column
1048:             * @return the column value; if the value is SQL <code>NULL</code>, the
1049:             * value returned is <code>false</code>
1050:             * @exception SQLException if a database access error occurs
1051:             */
1052:            public boolean getBoolean(String columnName) throws SQLException {
1053:                return getBoolean(findColumn(columnName));
1054:            }
1055:
1056:            /**
1057:             * <!-- start generic documentation -->
1058:             * Retrieves the value of the designated column in the current row
1059:             * of this <code>ResultSet</code> object as
1060:             * a <code>byte</code> in the Java programming language. <p>
1061:             * <!-- end generic documentation -->
1062:             *
1063:             * @param columnName the SQL name of the column
1064:             * @return the column value; if the value is SQL <code>NULL</code>, the
1065:             * value returned is <code>0</code>
1066:             * @exception SQLException if a database access error occurs
1067:             */
1068:            public byte getByte(String columnName) throws SQLException {
1069:                return getByte(findColumn(columnName));
1070:            }
1071:
1072:            /**
1073:             * <!-- start generic documentation -->
1074:             * Retrieves the value of the designated column in the current row
1075:             * of this <code>ResultSet</code> object as
1076:             * a <code>short</code> in the Java programming language. <p>
1077:             * <!-- end generic documentation -->
1078:             *
1079:             * @param columnName the SQL name of the column
1080:             * @return the column value; if the value is SQL <code>NULL</code>, the
1081:             * value returned is <code>0</code>
1082:             * @exception SQLException if a database access error occurs
1083:             */
1084:            public short getShort(String columnName) throws SQLException {
1085:                return getShort(findColumn(columnName));
1086:            }
1087:
1088:            /**
1089:             * <!-- start generic documentation -->
1090:             * Retrieves the value of the designated column in the current row
1091:             * of this <code>ResultSet</code> object as
1092:             * an <code>int</code> in the Java programming language. <p>
1093:             * <!-- end generic documentation -->
1094:             *
1095:             * @param columnName the SQL name of the column
1096:             * @return the column value; if the value is SQL <code>NULL</code>, the
1097:             * value returned is <code>0</code>
1098:             * @exception SQLException if a database access error occurs
1099:             */
1100:            public int getInt(String columnName) throws SQLException {
1101:                return getInt(findColumn(columnName));
1102:            }
1103:
1104:            /**
1105:             * <!-- start generic documentation -->
1106:             * Retrieves the value of the designated column in the current row
1107:             * of this <code>ResultSet</code> object as
1108:             * a <code>long</code> in the Java programming language. <p>
1109:             * <!-- end generic documentation -->
1110:             *
1111:             * @param columnName the SQL name of the column
1112:             * @return the column value; if the value is SQL <code>NULL</code>, the
1113:             * value returned is <code>0</code>
1114:             * @exception SQLException if a database access error occurs
1115:             */
1116:            public long getLong(String columnName) throws SQLException {
1117:                return getLong(findColumn(columnName));
1118:            }
1119:
1120:            /**
1121:             * <!-- start generic documentation -->
1122:             * Retrieves the value of the designated column in the current row
1123:             * of this <code>ResultSet</code> object as
1124:             * a <code>float</code> in the Java programming language. <p>
1125:             * <!-- end generic documentation -->
1126:             *
1127:             * @param columnName the SQL name of the column
1128:             * @return the column value; if the value is SQL <code>NULL</code>, the
1129:             * value returned is <code>0</code>
1130:             * @exception SQLException if a database access error occurs
1131:             */
1132:            public float getFloat(String columnName) throws SQLException {
1133:                return getFloat(findColumn(columnName));
1134:            }
1135:
1136:            /**
1137:             * <!-- start generic documentation -->
1138:             * Retrieves the value of the designated column in the current row
1139:             * of this <code>ResultSet</code> object as
1140:             * a <code>double</code> in the Java programming language. <p>
1141:             * <!-- end generic documentation -->
1142:             *
1143:             * @param columnName the SQL name of the column
1144:             * @return the column value; if the value is SQL <code>NULL</code>, the
1145:             * value returned is <code>0</code>
1146:             * @exception SQLException if a database access error occurs
1147:             */
1148:            public double getDouble(String columnName) throws SQLException {
1149:                return getDouble(findColumn(columnName));
1150:            }
1151:
1152:            /**
1153:             * <!-- start generic documentation -->
1154:             * Retrieves the value of the designated column in the current row
1155:             * of this <code>ResultSet</code> object as a
1156:             * <code>java.math.BigDecimal</code> in the Java programming language.<p>
1157:             * <!-- end generic documentation -->
1158:             *
1159:             * <!-- start release-specific documentation -->
1160:             * <div class="ReleaseSpecificDocumentation">
1161:             * <h3>HSQLDB-Specific Information:</h3> <p>
1162:             *
1163:             * Beginning with 1.7.0, HSQLDB converts the result and sets the scale
1164:             * with BigDecimal.ROUND_HALF_DOWN.
1165:             * </div>
1166:             * <!-- end release-specific documentation -->
1167:             *
1168:             * @param columnName the SQL name of the column
1169:             * @param scale the number of digits to the right of the decimal point
1170:             * @return the column value; if the value is SQL <code>NULL</code>, the
1171:             * value returned is <code>null</code>
1172:             * @exception SQLException if a database access error occurs
1173:             * @deprecated by java.sun.com as of JDK 1.2
1174:             */
1175:
1176:            //#ifdef DEPRECATEDJDBC
1177:            public BigDecimal getBigDecimal(String columnName, int scale)
1178:                    throws SQLException {
1179:                return getBigDecimal(findColumn(columnName), scale);
1180:            }
1181:
1182:            //#endif
1183:
1184:            /**
1185:             * <!-- start generic documentation -->
1186:             * Retrieves the value of the designated column in the current row
1187:             * of this <code>ResultSet</code> object as
1188:             * a <code>byte</code> array in the Java programming language.
1189:             * The bytes represent the raw values returned by the driver. <p>
1190:             * <!-- end generic documentation -->
1191:             *
1192:             * @param columnName the SQL name of the column
1193:             * @return the column value; if the value is SQL <code>NULL</code>, the
1194:             * value returned is <code>null</code>
1195:             * @exception SQLException if a database access error occurs
1196:             */
1197:            public byte[] getBytes(String columnName) throws SQLException {
1198:                return getBytes(findColumn(columnName));
1199:            }
1200:
1201:            /**
1202:             * <!-- start generic documentation -->
1203:             * Retrieves the value of the designated column in the current row
1204:             * of this <code>ResultSet</code> object as a
1205:             * <code>java.sql.Date</code> object in the Java programming language.<p>
1206:             * <!-- end generic documentation -->
1207:             *
1208:             * @param columnName the SQL name of the column
1209:             * @return the column value; if the value is SQL <code>NULL</code>, the
1210:             * value returned is <code>null</code>
1211:             * @exception SQLException if a database access error occurs
1212:             */
1213:            public Date getDate(String columnName) throws SQLException {
1214:                return getDate(findColumn(columnName));
1215:            }
1216:
1217:            /**
1218:             * <!-- start generic documentation -->
1219:             * Retrieves the value of the designated column in the current row
1220:             * of this <code>ResultSet</code> object as a <code>java.sql.Time</code>
1221:             * object in the Java programming language. <p>
1222:             * <!-- end generic documentation -->
1223:             *
1224:             * @param columnName the SQL name of the column
1225:             * @return the column value;
1226:             * if the value is SQL <code>NULL</code>,
1227:             * the value returned is <code>null</code>
1228:             * @exception SQLException if a database access error occurs
1229:             */
1230:            public Time getTime(String columnName) throws SQLException {
1231:                return getTime(findColumn(columnName));
1232:            }
1233:
1234:            /**
1235:             * <!-- start generic documentation -->
1236:             * Retrieves the value of the designated column in the current row
1237:             * of this <code>ResultSet</code> object as
1238:             * a <code>java.sql.Timestamp</code> object. <p>
1239:             * <!-- end generic documentation -->
1240:             *
1241:             * @param columnName the SQL name of the column
1242:             * @return the column value; if the value is SQL <code>NULL</code>, the
1243:             * value returned is <code>null</code>
1244:             * @exception SQLException if a database access error occurs
1245:             */
1246:            public Timestamp getTimestamp(String columnName)
1247:                    throws SQLException {
1248:                return getTimestamp(findColumn(columnName));
1249:            }
1250:
1251:            /**
1252:             * <!-- start generic documentation -->
1253:             * Retrieves the value of the designated column in the current row
1254:             * of this <code>ResultSet</code> object as a stream of
1255:             * ASCII characters. The value can then be read in chunks from the
1256:             * stream. This method is particularly
1257:             * suitable for retrieving large <code>LONGVARCHAR</code> values.
1258:             * The JDBC driver will
1259:             * do any necessary conversion from the database format into ASCII.
1260:             *
1261:             * <P><B>Note:</B> All the data in the returned stream must be
1262:             * read prior to getting the value of any other column. The next
1263:             * call to a getter method implicitly closes the stream. Also, a
1264:             * stream may return <code>0</code> when the method <code>available</code>
1265:             * is called whether there is data available or not. <p>
1266:             * <!-- end generic documentation -->
1267:             *
1268:             * @param columnName the SQL name of the column
1269:             * @return a Java input stream that delivers the database column value
1270:             * as a stream of one-byte ASCII characters.
1271:             * If the value is SQL <code>NULL</code>,
1272:             * the value returned is <code>null</code>.
1273:             * @exception SQLException if a database access error occurs
1274:             * @see #getAsciiStream(int)
1275:             */
1276:            public java.io.InputStream getAsciiStream(String columnName)
1277:                    throws SQLException {
1278:                return getAsciiStream(findColumn(columnName));
1279:            }
1280:
1281:            /**
1282:             * <!-- start generic documentation -->
1283:             * Retrieves the value of the designated column in the current row
1284:             * of this <code>ResultSet</code> object as a stream of two-byte
1285:             * Unicode characters. The first byte is the high byte; the second
1286:             * byte is the low byte.
1287:             *
1288:             * The value can then be read in chunks from the
1289:             * stream. This method is particularly
1290:             * suitable for retrieving large <code>LONGVARCHAR</code> values.
1291:             * The JDBC technology-enabled driver will
1292:             * do any necessary conversion from the database format into Unicode.
1293:             *
1294:             * <P><B>Note:</B> All the data in the returned stream must be
1295:             * read prior to getting the value of any other column. The next
1296:             * call to a getter method implicitly closes the stream.
1297:             * Also, a stream may return <code>0</code> when the method
1298:             * <code>InputStream.available</code> is called, whether there
1299:             * is data available or not. <p>
1300:             * <!-- end generic documentation -->
1301:             *
1302:             * @param columnName the SQL name of the column
1303:             * @return a Java input stream that delivers the database column value
1304:             *    as a stream of two-byte Unicode characters.
1305:             *    If the value is SQL <code>NULL</code>, the value returned
1306:             *    is <code>null</code>.
1307:             * @exception SQLException if a database access error occurs
1308:             * @deprecated use <code>getCharacterStream</code> instead
1309:             * @see #getUnicodeStream(int)
1310:             */
1311:
1312:            //#ifdef DEPRECATEDJDBC
1313:            public java.io.InputStream getUnicodeStream(String columnName)
1314:                    throws SQLException {
1315:                return getUnicodeStream(findColumn(columnName));
1316:            }
1317:
1318:            //#endif
1319:
1320:            /**
1321:             * <!-- start generic documentation -->
1322:             * Retrieves the value of the designated column in the current row
1323:             * of this <code>ResultSet</code> object as a stream of uninterpreted
1324:             * <code>byte</code>s.
1325:             * The value can then be read in chunks from the
1326:             * stream. This method is particularly
1327:             * suitable for retrieving large <code>LONGVARBINARY</code>
1328:             * values.
1329:             *
1330:             * <P><B>Note:</B> All the data in the returned stream must be
1331:             * read prior to getting the value of any other column. The next
1332:             * call to a getter method implicitly closes the stream. Also, a
1333:             * stream may return <code>0</code> when the method <code>available</code>
1334:             * is called whether there is data available or not. <p>
1335:             * <!-- end generic documentation -->
1336:             *
1337:             * @param columnName the SQL name of the column
1338:             * @return a Java input stream that delivers the database column value
1339:             * as a stream of uninterpreted bytes;
1340:             * if the value is SQL <code>NULL</code>, the result is <code>null</code>
1341:             * @exception SQLException if a database access error occurs
1342:             */
1343:            public java.io.InputStream getBinaryStream(String columnName)
1344:                    throws SQLException {
1345:                return getBinaryStream(findColumn(columnName));
1346:            }
1347:
1348:            //=====================================================================
1349:            // Advanced features:
1350:            //=====================================================================
1351:
1352:            /**
1353:             * <!-- start generic documentation -->
1354:             * Retrieves the first warning reported by calls on this
1355:             * <code>ResultSet</code> object.
1356:             * Subsequent warnings on this <code>ResultSet</code> object
1357:             * will be chained to the <code>SQLWarning</code> object that
1358:             * this method returns.
1359:             *
1360:             * <P>The warning chain is automatically cleared each time a new
1361:             * row is read.  This method may not be called on a <code>ResultSet</code>
1362:             * object that has been closed; doing so will cause an
1363:             * <code>SQLException</code> to be thrown.
1364:             * <P>
1365:             * <B>Note:</B> This warning chain only covers warnings caused
1366:             * by <code>ResultSet</code> methods.  Any warning caused by
1367:             * <code>Statement</code> methods
1368:             * (such as reading OUT parameters) will be chained on the
1369:             * <code>Statement</code> object. <p>
1370:             * <!-- end generic documentation -->
1371:             *
1372:             * <!-- start release-specific documentation -->
1373:             * <div class="ReleaseSpecificDocumentation">
1374:             * <h3>HSQLDB-Specific Information:</h3> <p>
1375:             *
1376:             * Up to and including 1.7.1, HSQLDB does not produce
1377:             * <code>SQLWarning</code> objects. This method always returns
1378:             * <code>null</code>.
1379:             * </div>
1380:             * <!-- end release-specific documentation -->
1381:             *
1382:             * @return the first <code>SQLWarning</code> object reported or
1383:             *    <code>null</code> if there are none <p>
1384:             *
1385:             * Up to and including 1.7.1, HSQLDB always returns null. <p>
1386:             * @exception SQLException if a database access error occurs or this
1387:             *    method is called on a closed result set
1388:             */
1389:            public SQLWarning getWarnings() throws SQLException {
1390:                return null;
1391:            }
1392:
1393:            /**
1394:             * <!-- start generic documentation -->
1395:             * Clears all warnings reported on this <code>ResultSet</code> object.
1396:             * After this method is called, the method <code>getWarnings</code>
1397:             * returns <code>null</code> until a new warning is
1398:             * reported for this <code>ResultSet</code> object. <p>
1399:             * <!-- end generic documentation -->
1400:             *
1401:             * <!-- start release-specific documentation -->
1402:             * <div class="ReleaseSpecificDocumentation">
1403:             * <h3>HSQLDB-Specific Information:</h3> <p>
1404:             *
1405:             * Including 1.7.1, HSQLDB does not produce <code>SQLWarning</code>
1406:             * objects on any ResultSet object warning chain; calls to this method
1407:             * are ignored.
1408:             * </div>
1409:             * <!-- end release-specific documentation -->
1410:             *
1411:             * @exception SQLException if a database access error occurs
1412:             */
1413:            public void clearWarnings() throws SQLException {
1414:            }
1415:
1416:            /**
1417:             * <!-- start generic documentation -->
1418:             * Retrieves the name of the SQL cursor used by this
1419:             * <code>ResultSet</code> object.
1420:             *
1421:             * <P>In SQL, a result table is retrieved through a cursor that is
1422:             * named. The current row of a result set can be updated or deleted
1423:             * using a positioned update/delete statement that references the
1424:             * cursor name. To insure that the cursor has the proper isolation
1425:             * level to support update, the cursor's <code>SELECT</code> statement
1426:             * should be of the form <code>SELECT FOR UPDATE</code>. If
1427:             * <code>FOR UPDATE</code> is omitted, the positioned updates may fail.
1428:             *
1429:             * <P>The JDBC API supports this SQL feature by providing the name of the
1430:             * SQL cursor used by a <code>ResultSet</code> object.
1431:             * The current row of a <code>ResultSet</code> object
1432:             * is also the current row of this SQL cursor.
1433:             *
1434:             * <P><B>Note:</B> If positioned update is not supported, a
1435:             * <code>SQLException</code> is thrown. <p>
1436:             * <!-- end generic documentation -->
1437:             *
1438:             * <!-- start release-specific documentation -->
1439:             * <div class="ReleaseSpecificDocumentation">
1440:             * <h3>HSQLDB-Specific Information:</h3> <p>
1441:             *
1442:             * Including 1.7.2, HSQLDB does not support this feature.  <p>
1443:             *
1444:             * Calling this method always throws an <code>SQLException</code>,
1445:             * stating that the operation is not supported.
1446:             * </div>
1447:             * <!-- end release-specific documentation -->
1448:             *
1449:             * @return the SQL name for this <code>ResultSet</code> object's cursor
1450:             * @exception SQLException if a database access error occurs
1451:             */
1452:            public String getCursorName() throws SQLException {
1453:                throw Util.notSupported();
1454:            }
1455:
1456:            /**
1457:             * <!-- start generic documentation -->
1458:             * Retrieves the  number, types and properties of
1459:             * this <code>ResultSet</code> object's columns. <p>
1460:             * <!-- end generic documentation -->
1461:             *
1462:             * <!-- start release-specific documentation -->
1463:             * <div class="ReleaseSpecificDocumentation">
1464:             * <h3>HSQLDB-Specific Information:</h3> <p>
1465:             *
1466:             * <B>Example:</B> <p>
1467:             *
1468:             * The following code fragment creates a <code>ResultSet</code> object rs,
1469:             * creates a <code>ResultSetMetaData</code> object rsmd, and uses rsmd
1470:             * to find out how many columns rs has and whether the first column
1471:             * in rs can be used in a <code>WHERE</code> clause. <p>
1472:             *
1473:             * <pre class="JavaCodeExample">
1474:             * ResultSet         rs              = stmt.<b>executeQuery</b>(<span class="JavaStringLiteral">"SELECT a, b, c FROM TABLE2"</span>);
1475:             * ResultSetMetaData rsmd = rs.<b>getMetaData</b>();<br>
1476:             * int numberOfColumns = rsmd.<b>getColumnCount</b>();<br>
1477:             * boolean b = rsmd.<b>isSearchable</b>(1);<br>
1478:             * </pre>
1479:             *
1480:             * <hr>
1481:             *
1482:             * <B>Warning:</B> <p>
1483:             *
1484:             * Including 1.7.1, HSQLDB did not generate accurate
1485:             * <code>ResultSetMetaData</code>.  Below were the the most important
1486:             * methods to consider: <p>
1487:             *
1488:             * <ol>
1489:             * <li>isAutoIncrement(int) <i>always</i> returned <code>false</code></li>
1490:             * <li>isCurrency(int) <i>always</i> returned <code>false</code></li>
1491:             * <li>isNullable(int) <i>always</i> returned
1492:             *     <code>columnNullableUnknown</code></li>
1493:             * <li>getColumnDisplaySize(int) returned zero for all valid column
1494:             *     numbers</li>
1495:             * <li>getSchemaName(int) <i>always</i> returned
1496:             *  <span class="JavaStringLiteral">""</span></li>
1497:             * <li>getPrecision(int) <i>always</i> returned zero</li>
1498:             * <li>getScale(int) <i>always</i> returned zero</li>
1499:             * <li>getCatalogName(int) <i>always</i> returned
1500:             *  <span class="JavaStringLiteral">""</span></li>
1501:             * </ol> <p>
1502:             *
1503:             * <hr>
1504:             *
1505:             * Starting with 1.7.2, ResultSetMetaData has been split out into its own
1506:             * interface implemenation (jdbcResultSetMetaData), support has been
1507:             * improved considerably for a number of methods and behaviour has
1508:             * been altered slightly in many areas.
1509:             * </div>
1510:             * <!-- end release-specific documentation -->
1511:             *
1512:             * @return the description of this <code>ResultSet</code> object's columns
1513:             * @exception SQLException if a database access error occurs
1514:             * @see jdbcResultSetMetaData
1515:             */
1516:            public ResultSetMetaData getMetaData() throws SQLException {
1517:
1518:                if (rsmd == null) {
1519:                    rsmd = new jdbcResultSetMetaData(this , connProperties);
1520:                }
1521:
1522:                return rsmd;
1523:            }
1524:
1525:            /**
1526:             * <!-- start generic documentation -->
1527:             * Gets the value of the designated column in the current row
1528:             * of this <code>ResultSet</code> object as
1529:             * an <code>Object</code> in the Java programming language.
1530:             *
1531:             * <p>This method will return the value of the given column as a
1532:             * Java object.  The type of the Java object will be the default
1533:             * Java object type corresponding to the column's SQL type,
1534:             * following the mapping for built-in types specified in the JDBC
1535:             * specification. If the value is an SQL <code>NULL</code>,
1536:             * the driver returns a Java <code>null</code>.
1537:             *
1538:             * <p>This method may also be used to read datatabase-specific
1539:             * abstract data types.
1540:             *
1541:             * In the JDBC 2.0 API, the behavior of method
1542:             * <code>getObject</code> is extended to materialize
1543:             * data of SQL user-defined types.  When a column contains
1544:             * a structured or distinct value, the behavior of this method is as
1545:             * if it were a call to: <code>getObject(columnIndex,
1546:             * this.getStatement().getConnection().getTypeMap())</code>. <p>
1547:             * <!-- end generic documentation -->
1548:             *
1549:             * @param columnIndex the first column is 1, the second is 2, ...
1550:             * @return a <code>java.lang.Object</code> holding the column value
1551:             * @exception SQLException if a database access error occurs
1552:             */
1553:            public Object getObject(int columnIndex) throws SQLException {
1554:
1555:                checkAvailable();
1556:
1557:                Object o;
1558:                int t;
1559:
1560:                try {
1561:                    o = nCurrent.data[--columnIndex];
1562:                    t = rResult.metaData.colTypes[columnIndex];
1563:                } catch (ArrayIndexOutOfBoundsException e) {
1564:                    throw Util.sqlException(Trace.COLUMN_NOT_FOUND, String
1565:                            .valueOf(++columnIndex));
1566:                }
1567:
1568:                // use checknull because getColumnInType is not used
1569:                if (checkNull(o)) {
1570:                    return null;
1571:                }
1572:
1573:                switch (t) {
1574:
1575:                case Types.DATE:
1576:                    return new Date(((Date) o).getTime());
1577:
1578:                case Types.TIME:
1579:                    return new Time(((Time) o).getTime());
1580:
1581:                case Types.TIMESTAMP:
1582:                    long m = ((Timestamp) o).getTime();
1583:                    int n = ((Timestamp) o).getNanos();
1584:                    Timestamp ts = new Timestamp(m);
1585:
1586:                    ts.setNanos(n);
1587:
1588:                    return ts;
1589:
1590:                case Types.OTHER:
1591:                case Types.JAVA_OBJECT:
1592:                    try {
1593:                        return ((JavaObject) o).getObject();
1594:                    } catch (HsqlException e) {
1595:                        throw Util.sqlException(Trace
1596:                                .error(Trace.SERIALIZATION_FAILURE));
1597:                    }
1598:                case Types.BINARY:
1599:                case Types.VARBINARY:
1600:                case Types.LONGVARBINARY:
1601:                    return ((Binary) o).getClonedBytes();
1602:
1603:                default:
1604:                    return o;
1605:                }
1606:            }
1607:
1608:            /**
1609:             * <!-- start generic documentation -->
1610:             * Gets the value of the designated column in the current row
1611:             * of this <code>ResultSet</code> object as
1612:             * an <code>Object</code> in the Java programming language.
1613:             *
1614:             * <p>This method will return the value of the given column as a
1615:             * Java object.  The type of the Java object will be the default
1616:             * Java object type corresponding to the column's SQL type,
1617:             * following the mapping for built-in types specified in the JDBC
1618:             * specification. If the value is an SQL <code>NULL</code>,
1619:             * the driver returns a Java <code>null</code>.
1620:             * <P>
1621:             * This method may also be used to read datatabase-specific
1622:             * abstract data types.
1623:             * <P>
1624:             * In the JDBC 2.0 API, the behavior of the method
1625:             * <code>getObject</code> is extended to materialize
1626:             * data of SQL user-defined types.  When a column contains
1627:             * a structured or distinct value, the behavior of this method is as
1628:             * if it were a call to: <code>getObject(columnIndex,
1629:             * this.getStatement().getConnection().getTypeMap())</code>. <p>
1630:             * <!-- end generic documentation -->
1631:             *
1632:             * @param columnName the SQL name of the column
1633:             * @return a <code>java.lang.Object</code> holding the column value
1634:             * @exception SQLException if a database access error occurs
1635:             */
1636:            public Object getObject(String columnName) throws SQLException {
1637:                return getObject(findColumn(columnName));
1638:            }
1639:
1640:            //----------------------------------------------------------------
1641:
1642:            /**
1643:             * <!-- start generic documentation -->
1644:             * Maps the given <code>ResultSet</code> column name to its
1645:             * <code>ResultSet</code> column index. <p>
1646:             * <!-- end generic documentation -->
1647:             *
1648:             * @param columnName the name of the column
1649:             * @return the column index of the given column name
1650:             * @exception SQLException if the <code>ResultSet</code> object does not
1651:             *    contain <code>columnName</code> or a database access error occurs
1652:             */
1653:            public int findColumn(String columnName) throws SQLException {
1654:
1655:                for (int i = 0; i < iColumnCount; i++) {
1656:                    String name = rResult.metaData.colLabels[i];
1657:
1658:                    if (columnName.equalsIgnoreCase(name)) {
1659:                        return i + 1;
1660:                    }
1661:                }
1662:
1663:                throw Util.sqlException(Trace.COLUMN_NOT_FOUND, columnName);
1664:            }
1665:
1666:            //--------------------------JDBC 2.0-----------------------------------
1667:            //---------------------------------------------------------------------
1668:            // Getters and Setters
1669:            //---------------------------------------------------------------------
1670:
1671:            /**
1672:             * <!-- start generic documentation -->
1673:             * Retrieves the value of the designated column in the current row
1674:             * of this <code>ResultSet</code> object as a
1675:             * <code>java.io.Reader</code> object. <p>
1676:             * <!-- end generic documentation -->
1677:             *
1678:             * <!-- start release-specific documentation -->
1679:             * <div class="ReleaseSpecificDocumentation">
1680:             * <h3>HSQLDB-Specific Information:</h3> <p>
1681:             *
1682:             * Starting with 1.7.0. HSQLDB supports this.
1683:             * </div>
1684:             * <!-- end release-specific documentation -->
1685:             *
1686:             * @return a <code>java.io.Reader</code> object that contains the column
1687:             *   value; if the value is SQL <code>NULL</code>, the value returned
1688:             *   is <code>null</code> in the Java programming language.
1689:             * @param columnIndex the first column is 1, the second is 2, ...
1690:             * @exception SQLException if a database access error occurs
1691:             * @since JDK 1.2
1692:             */
1693:            public java.io.Reader getCharacterStream(int columnIndex)
1694:                    throws SQLException {
1695:
1696:                String s = getString(columnIndex);
1697:
1698:                if (s == null) {
1699:                    return null;
1700:                }
1701:
1702:                return new StringReader(s);
1703:            }
1704:
1705:            /**
1706:             * <!-- start generic documentation -->
1707:             * Retrieves the value of the designated column in the current row
1708:             * of this <code>ResultSet</code> object as a
1709:             * <code>java.io.Reader</code> object. <p>
1710:             * <!-- end generic documentation -->
1711:             *
1712:             * <!-- start release-specific documentation -->
1713:             * <div class="ReleaseSpecificDocumentation">
1714:             * <h3>HSQLDB-Specific Information:</h3> <p>
1715:             *
1716:             * Starting with 1.7.0, HSQLDB supports this.
1717:             * </div>
1718:             * <!-- end release-specific documentation -->
1719:             *
1720:             * @param columnName the name of the column
1721:             * @return a <code>java.io.Reader</code> object that contains the column
1722:             * value; if the value is SQL <code>NULL</code>, the value returned is
1723:             * <code>null</code> in the Java programming language
1724:             * @exception SQLException if a database access error occurs
1725:             * @since JDK 1.2
1726:             */
1727:            public java.io.Reader getCharacterStream(String columnName)
1728:                    throws SQLException {
1729:                return getCharacterStream(findColumn(columnName));
1730:            }
1731:
1732:            /**
1733:             * <!-- start generic documentation -->
1734:             * Retrieves the value of the designated column in the current row
1735:             * of this <code>ResultSet</code> object as a
1736:             * <code>java.math.BigDecimal</code> with full precision. <p>
1737:             * <!-- end generic documentation -->
1738:             *
1739:             * @param columnIndex the first column is 1, the second is 2, ...
1740:             * @return the column value (full precision);
1741:             * if the value is SQL <code>NULL</code>, the value returned is
1742:             * <code>null</code> in the Java programming language.
1743:             * @exception SQLException if a database access error occurs
1744:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
1745:             *    jdbcResultSet)
1746:             */
1747:            public BigDecimal getBigDecimal(int columnIndex)
1748:                    throws SQLException {
1749:                return (BigDecimal) getColumnInType(columnIndex, Types.DECIMAL);
1750:            }
1751:
1752:            /**
1753:             * <!-- start generic documentation -->
1754:             * Retrieves the value of the designated column in the current row
1755:             * of this <code>ResultSet</code> object as a
1756:             * <code>java.math.BigDecimal</code> with full precision. <p>
1757:             * <!-- end generic documentation -->
1758:             *
1759:             * @param columnName the column name
1760:             * @return the column value (full precision);
1761:             * if the value is SQL <code>NULL</code>, the value returned is
1762:             * <code>null</code> in the Java programming language.
1763:             * @exception SQLException if a database access error occurs
1764:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
1765:             *    jdbcResultSet)
1766:             */
1767:            public BigDecimal getBigDecimal(String columnName)
1768:                    throws SQLException {
1769:                return getBigDecimal(findColumn(columnName));
1770:            }
1771:
1772:            //---------------------------------------------------------------------
1773:            // Traversal/Positioning
1774:            //---------------------------------------------------------------------
1775:
1776:            /**
1777:             * <!-- start generic documentation -->
1778:             * Retrieves whether the cursor is before the first row in
1779:             * this <code>ResultSet</code> object. <p>
1780:             * <!-- end generic documentation -->
1781:             *
1782:             * @return <code>true</code> if the cursor is before the first row;
1783:             * <code>false</code> if the cursor is at any other position or the
1784:             * result set contains no rows
1785:             * @exception SQLException if a database access error occurs
1786:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
1787:             *    jdbcResultSet)
1788:             */
1789:            public boolean isBeforeFirst() throws SQLException {
1790:
1791:                // bInit indicates whether the resultset has not been traversed or not
1792:                // true - it has ---- false it hasn't
1793:                checkClosed();
1794:
1795:                return rResult.rRoot != null && !bInit;
1796:
1797:                // End New Cose
1798:            }
1799:
1800:            /**
1801:             * <!-- start generic documentation -->
1802:             * Retrieves whether the cursor is after the last row in
1803:             * this <code>ResultSet</code> object. <p>
1804:             * <!-- end generic documentation -->
1805:             *
1806:             * @return <code>true</code> if the cursor is after the last row;
1807:             * <code>false</code> if the cursor is at any other position or the
1808:             * result set contains no rows
1809:             * @exception SQLException if a database access error occurs
1810:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
1811:             *    jdbcResultSet)
1812:             */
1813:            public boolean isAfterLast() throws SQLException {
1814:
1815:                // At afterLast condition exists when resultset has been traversed and
1816:                // the current row is null.  iCurrentRow should also be set to
1817:                // afterlast but no need to test
1818:                checkClosed();
1819:
1820:                return rResult.rRoot != null && bInit && nCurrent == null;
1821:            }
1822:
1823:            /**
1824:             * <!-- start generic documentation -->
1825:             * Retrieves whether the cursor is on the first row of
1826:             * this <code>ResultSet</code> object. <p>
1827:             * <!-- end generic documentation -->
1828:             *
1829:             * @return <code>true</code> if the cursor is on the first row;
1830:             * <code>false</code> otherwise
1831:             * @exception SQLException if a database access error occurs
1832:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
1833:             *    jdbcResultSet)
1834:             */
1835:            public boolean isFirst() throws SQLException {
1836:
1837:                checkClosed();
1838:
1839:                return iCurrentRow == 1;
1840:            }
1841:
1842:            /**
1843:             * <!-- start generic documentation -->
1844:             * Retrieves whether the cursor is on the last row of
1845:             * this <code>ResultSet</code> object.
1846:             * Note: Calling the method <code>isLast</code> may be expensive
1847:             * because the JDBC driver
1848:             * might need to fetch ahead one row in order to determine
1849:             * whether the current row is the last row in the result set. <p>
1850:             * <!-- end generic documentation -->
1851:             *
1852:             * <!-- start release-specific documentation -->
1853:             * <div class="ReleaseSpecificDocumentation">
1854:             * <h3>HSQLDB-Specific Information:</h3> <p>
1855:             *
1856:             * Including 1.7.2, this method is not terribly expensive;
1857:             * the entire result is fetched internally before this object
1858:             * is returned to a caller.
1859:             * </div>
1860:             * <!-- end release-specific documentation -->
1861:             *
1862:             * @return <code>true</code> if the cursor is on the last row;
1863:             * <code>false</code> otherwise
1864:             * @exception SQLException if a database access error occurs
1865:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
1866:             *  jdbcResultSet)
1867:             */
1868:            public boolean isLast() throws SQLException {
1869:
1870:                checkClosed();
1871:
1872:                // If the resultset has not been traversed, then exit with false
1873:                // At the last row if the next row is null
1874:                return rResult.rRoot != null && bInit && nCurrent != null
1875:                        && nCurrent.next == null;
1876:            }
1877:
1878:            /**
1879:             * <!-- start generic documentation -->
1880:             * Moves the cursor to the front of
1881:             * this <code>ResultSet</code> object, just before the
1882:             * first row. This method has no effect if the result set contains
1883:             * no rows.<p>
1884:             * <!-- end generic documentation -->
1885:             *
1886:             * @exception SQLException if a database access error
1887:             * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
1888:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
1889:             *    jdbcResultSet)
1890:             */
1891:            public void beforeFirst() throws SQLException {
1892:
1893:                checkClosed();
1894:
1895:                if (this .getType() == TYPE_FORWARD_ONLY) {
1896:                    throw Util.sqlException(Trace.RESULTSET_FORWARD_ONLY);
1897:                }
1898:
1899:                // Set to beforeFirst status
1900:                bInit = false;
1901:                nCurrent = null;
1902:                iCurrentRow = 0;
1903:            }
1904:
1905:            /**
1906:             * <!-- start generic documentation -->
1907:             * Moves the cursor to the end of
1908:             * this <code>ResultSet</code> object, just after the last row. This
1909:             * method has no effect if the result set contains no rows. <p>
1910:             * <!-- end generic documentation -->
1911:             *
1912:             * @exception SQLException if a database access error
1913:             * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
1914:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
1915:             *    jdbcResultSet)
1916:             */
1917:            public void afterLast() throws SQLException {
1918:
1919:                checkClosed();
1920:
1921:                if (this .getType() == TYPE_FORWARD_ONLY) {
1922:                    throw Util.sqlException(Trace.RESULTSET_FORWARD_ONLY);
1923:                }
1924:
1925:                if (rResult != null && rResult.rRoot != null) {
1926:
1927:                    // not an empty resultset, so set the afterLast status
1928:                    bInit = true;
1929:                    iCurrentRow = rResult.getSize() + 1;
1930:                    nCurrent = null;
1931:                }
1932:            }
1933:
1934:            /**
1935:             * <!-- start generic documentation -->
1936:             * Moves the cursor to the first row in
1937:             * this <code>ResultSet</code> object. <p>
1938:             * <!-- end generic documentation -->
1939:             *
1940:             * @return <code>true</code> if the cursor is on a valid row;
1941:             * <code>false</code> if there are no rows in the result set
1942:             * @exception SQLException if a database access error
1943:             * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
1944:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
1945:             *    jdbcResultSet)
1946:             */
1947:            public boolean first() throws SQLException {
1948:
1949:                checkClosed();
1950:
1951:                if (this .getType() == TYPE_FORWARD_ONLY) {
1952:                    throw Util.sqlException(Trace.RESULTSET_FORWARD_ONLY);
1953:                }
1954:
1955:                if (rResult == null) {
1956:                    return false;
1957:                }
1958:
1959:                bInit = false;
1960:
1961:                if (rResult.rRoot != null) {
1962:                    bInit = true;
1963:                    nCurrent = rResult.rRoot;
1964:                    iCurrentRow = 1;
1965:                }
1966:
1967:                return bInit;
1968:            }
1969:
1970:            /**
1971:             * <!-- start generic documentation -->
1972:             * Moves the cursor to the last row in
1973:             * this <code>ResultSet</code> object. <p>
1974:             * <!-- end generic documentation -->
1975:             *
1976:             * @return <code>true</code> if the cursor is on a valid row;
1977:             * <code>false</code> if there are no rows in the result set
1978:             * @exception SQLException if a database access error
1979:             * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
1980:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
1981:             *    jdbcResultSet)
1982:             */
1983:            public boolean last() throws SQLException {
1984:
1985:                checkClosed();
1986:
1987:                if (this .getType() == TYPE_FORWARD_ONLY) {
1988:                    throw Util.sqlException(Trace.RESULTSET_FORWARD_ONLY);
1989:                }
1990:
1991:                if (rResult == null) {
1992:                    return false;
1993:                }
1994:
1995:                if (rResult.rRoot == null) {
1996:                    return false;
1997:                }
1998:
1999:                // it resultset not traversed yet, set to first row
2000:                if (!bInit || nCurrent == null) {
2001:                    first();
2002:                }
2003:
2004:                // go to the last row
2005:                while (nCurrent.next != null) {
2006:                    iCurrentRow++;
2007:
2008:                    nCurrent = nCurrent.next;
2009:                }
2010:
2011:                return true;
2012:            }
2013:
2014:            /**
2015:             * <!-- start generic documentation -->
2016:             * Retrieves the current row number.  The first row is number 1, the
2017:             * second number 2, and so on. <p>
2018:             * <!-- end generic documentation -->
2019:             *
2020:             * @return the current row number; <code>0</code> if there is no current
2021:             *    row
2022:             * @exception SQLException if a database access error occurs
2023:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2024:             *    jdbcResultSet)
2025:             */
2026:            public int getRow() throws SQLException {
2027:
2028:                checkClosed();
2029:
2030:                return iCurrentRow;
2031:            }
2032:
2033:            /**
2034:             * <!-- start generic documentation -->
2035:             * Moves the cursor to the given row number in
2036:             * this <code>ResultSet</code> object.
2037:             *
2038:             * <p>If the row number is positive, the cursor moves to
2039:             * the given row number with respect to the
2040:             * beginning of the result set.  The first row is row 1, the second
2041:             * is row 2, and so on.
2042:             *
2043:             * <p>If the given row number is negative, the cursor moves to
2044:             * an absolute row position with respect to
2045:             * the end of the result set.  For example, calling the method
2046:             * <code>absolute(-1)</code> positions the
2047:             * cursor on the last row; calling the method <code>absolute(-2)</code>
2048:             * moves the cursor to the next-to-last row, and so on.
2049:             *
2050:             * <p>An attempt to position the cursor beyond the first/last row in
2051:             * the result set leaves the cursor before the first row or after
2052:             * the last row.
2053:             *
2054:             * <p><B>Note:</B> Calling <code>absolute(1)</code> is the same
2055:             * as calling <code>first()</code>. Calling <code>absolute(-1)</code>
2056:             * is the same as calling <code>last()</code>. <p>
2057:             * <!-- end generic documentation -->
2058:             *
2059:             * @param row the number of the row to which the cursor should move.
2060:             *    A positive number indicates the row number counting from the
2061:             *    beginning of the result set; a negative number indicates the
2062:             *    row number counting from the end of the result set
2063:             * @return <code>true</code> if the cursor is on the result set;
2064:             * <code>false</code> otherwise
2065:             * @exception SQLException if a database access error
2066:             * occurs, or the result set type is <code>TYPE_FORWARD_ONLY</code>
2067:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2068:             *    jdbcResultSet)
2069:             */
2070:            public boolean absolute(int row) throws SQLException {
2071:
2072:                checkClosed();
2073:
2074:                if (this .getType() == TYPE_FORWARD_ONLY) {
2075:                    throw Util.sqlException(Trace.RESULTSET_FORWARD_ONLY);
2076:                }
2077:
2078:                if (rResult == null) {
2079:                    return false;
2080:                }
2081:
2082:                if (rResult.rRoot == null || row == 0) {
2083:
2084:                    // No rows in the resultset or tried to execute absolute(0)
2085:                    // which is not valid
2086:                    return false;
2087:                }
2088:
2089:                // A couple of special cases
2090:                switch (row) {
2091:
2092:                case 1:
2093:                    return first(); // absolute(1) is same as first()
2094:
2095:                case -1:
2096:                    return last(); // absolute(-1) is same as last()
2097:                }
2098:
2099:                // If the row variable is negative, calculate the target
2100:                // row from the end of the resultset.
2101:                if (row < 0) {
2102:
2103:                    // we know there are rows in resultset, so get the last
2104:                    last();
2105:
2106:                    // calculate the target row
2107:                    row = iCurrentRow + row + 1;
2108:
2109:                    // Exit if the target row is before the beginning of the resultset
2110:                    if (row <= 0) {
2111:                        beforeFirst();
2112:
2113:                        return false;
2114:                    }
2115:                }
2116:
2117:                if (row < iCurrentRow || iCurrentRow == 0) {
2118:
2119:                    // Need to go back and start from the beginning of the resultset
2120:                    beforeFirst();
2121:                }
2122:
2123:                // go to the tagget row;
2124:                while (row > iCurrentRow) {
2125:                    next();
2126:
2127:                    if (nCurrent == null) {
2128:                        break;
2129:                    }
2130:                }
2131:
2132:                return nCurrent != null;
2133:            }
2134:
2135:            /**
2136:             * <!-- start generic documentation -->
2137:             * Moves the cursor a relative number of rows, either positive or
2138:             * negative. Attempting to move beyond the first/last row in the
2139:             * result set positions the cursor before/after the
2140:             * the first/last row. Calling <code>relative(0)</code> is valid, but does
2141:             * not change the cursor position.
2142:             *
2143:             * <p>Note: Calling the method <code>relative(1)</code>
2144:             * is identical to calling the method <code>next()</code> and
2145:             * calling the method <code>relative(-1)</code> is identical
2146:             * to calling the method <code>previous()</code>. <p>
2147:             * <!-- end generic documentation -->
2148:             *
2149:             * @param rows an <code>int</code> specifying the number of rows to
2150:             *    move from the current row; a positive number moves the cursor
2151:             *    forward; a negative number moves the cursor backward
2152:             * @return <code>true</code> if the cursor is on a row;
2153:             *     <code>false</code> otherwise
2154:             * @exception SQLException if a database access error occurs,
2155:             *        there is no current row, or the result set type is
2156:             *        <code>TYPE_FORWARD_ONLY</code>
2157:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2158:             *    jdbcResultSet)
2159:             */
2160:            public boolean relative(int rows) throws SQLException {
2161:
2162:                checkClosed();
2163:
2164:                if (this .getType() == TYPE_FORWARD_ONLY) {
2165:                    throw Util.sqlException(Trace.RESULTSET_FORWARD_ONLY);
2166:                }
2167:
2168:                if (rResult == null) {
2169:                    return false;
2170:                }
2171:
2172:                if (rResult.rRoot == null) {
2173:                    return false;
2174:                }
2175:
2176:                // if the direction is backward calculate the target row
2177:                if (rows < 0) {
2178:                    rows = iCurrentRow + rows;
2179:
2180:                    // set status to beforeFirst status
2181:                    beforeFirst();
2182:
2183:                    // Exit if the target row is before the beginning of the resultset
2184:                    if (rows <= 0) {
2185:                        return false;
2186:                    }
2187:                }
2188:
2189:                while (rows-- > 0) {
2190:                    next();
2191:
2192:                    if (nCurrent == null) {
2193:                        break;
2194:                    }
2195:                }
2196:
2197:                // if nCurrent is null, the postion will be afterLast
2198:                return nCurrent != null;
2199:            }
2200:
2201:            /**
2202:             * <!-- start generic documentation -->
2203:             * Moves the cursor to the previous row in this
2204:             * <code>ResultSet</code> object. <p>
2205:             * <!-- end generic documentation -->
2206:             *
2207:             * @return <code>true</code> if the cursor is on a valid row;
2208:             * <code>false</code> if it is off the result set
2209:             * @exception SQLException if a database access error
2210:             * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
2211:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2212:             *    jdbcResultSet)
2213:             */
2214:            public boolean previous() throws SQLException {
2215:
2216:                checkClosed();
2217:
2218:                if (this .getType() == TYPE_FORWARD_ONLY) {
2219:                    throw Util.sqlException(Trace.RESULTSET_FORWARD_ONLY);
2220:                }
2221:
2222:                if (rResult == null || rResult.rRoot == null
2223:                        || iCurrentRow == 0) {
2224:
2225:                    // Empty resultset or no valid row
2226:                    return false;
2227:                }
2228:
2229:                if (bInit && nCurrent == null) {
2230:
2231:                    // Special condition: in an afterlast condition so go to last
2232:                    // row in the resultset
2233:                    return last();
2234:                }
2235:
2236:                int targetRow = iCurrentRow - 1;
2237:
2238:                if (targetRow == 0) {
2239:
2240:                    // Have gone to a beforeFirst status. Not sure if the
2241:                    // beforeFirst status should be set or not.
2242:                    // The spec is not very clear.
2243:                    beforeFirst();
2244:
2245:                    return false;
2246:                }
2247:
2248:                // Go to the target row.  We always have to start from the first row
2249:                // since the resultset is a forward direction list only
2250:                first();
2251:
2252:                while (targetRow != iCurrentRow) {
2253:                    nCurrent = nCurrent.next;
2254:
2255:                    iCurrentRow++;
2256:                }
2257:
2258:                return nCurrent != null;
2259:            }
2260:
2261:            //---------------------------------------------------------------------
2262:            // Properties
2263:            //---------------------------------------------------------------------
2264:            // fredt@users - 20020902 - patch 1.7.1 - fetch size and direction
2265:            // We now interpret fetch size and direction as irrelevent to HSQLDB because
2266:            // the result set is built and returned as one whole data structure.
2267:            // Exceptions thrown are adjusted to mimimal and the javadoc updated.
2268:
2269:            /**
2270:             * <!-- start generic documentation -->
2271:             * Gives a hint as to the direction in which the rows in this
2272:             * <code>ResultSet</code> object will be processed.
2273:             * The initial value is determined by the
2274:             * <code>Statement</code> object
2275:             * that produced this <code>ResultSet</code> object.
2276:             * The fetch direction may be changed at any time. <p>
2277:             * <!-- end generic documentation -->
2278:             *
2279:             * <!-- start release-specific documentation -->
2280:             * <div class="ReleaseSpecificDocumentation">
2281:             * <h3>HSQLDB-Specific Information:</h3> <p>
2282:             *
2283:             * Including 1.7.2, HSQLDB builds and returns result sets as a whole;
2284:             * this method does nothing. However, as mandated by the JDBC standard,
2285:             * an SQLException is thrown if the result set type is TYPE_FORWARD_ONLY
2286:             * and a fetch direction other than FETCH_FORWARD is requested.
2287:             * </div>
2288:             * <!-- end release-specific documentation -->
2289:             *
2290:             * @param direction an <code>int</code> specifying the suggested
2291:             *  fetch direction; one of <code>ResultSet.FETCH_FORWARD</code>,
2292:             *  <code>ResultSet.FETCH_REVERSE</code>, or
2293:             *  <code>ResultSet.FETCH_UNKNOWN</code>
2294:             * @exception SQLException if a database access error occurs or
2295:             *  the result set type is <code>TYPE_FORWARD_ONLY</code> and the
2296:             *  fetch direction is not <code>FETCH_FORWARD</code>
2297:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2298:             *  jdbcResultSet)
2299:             * @see jdbcStatement#setFetchDirection
2300:             * @see #getFetchDirection
2301:             */
2302:            public void setFetchDirection(int direction) throws SQLException {
2303:
2304:                checkClosed();
2305:
2306:                if (rsType == TYPE_FORWARD_ONLY && direction != FETCH_FORWARD) {
2307:                    throw Util.notSupported();
2308:                }
2309:            }
2310:
2311:            /**
2312:             * <!-- start generic documentation -->
2313:             * Retrieves the fetch direction for this
2314:             * <code>ResultSet</code> object. <p>
2315:             * <!-- end generic documentation -->
2316:             *
2317:             * <!-- start release-specific documentation -->
2318:             * <div class="ReleaseSpecificDocumentation">
2319:             * <h3>HSQLDB-Specific Information:</h3> <p>
2320:             *
2321:             * Including 1.7.2, HSQLDB builds and returns result sets as a whole;
2322:             * this method always returns <code>FETCH_FORWARD</code>, but the value
2323:             * has no real meaning.
2324:             * </div>
2325:             * <!-- end release-specific documentation -->
2326:             *
2327:             * @return the current fetch direction for this <code>ResultSet</code>
2328:             *   object
2329:             * @exception SQLException if a database access error occurs
2330:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2331:             *   jdbcResultSet)
2332:             * @see #setFetchDirection
2333:             */
2334:            public int getFetchDirection() throws SQLException {
2335:
2336:                checkClosed();
2337:
2338:                return FETCH_FORWARD;
2339:            }
2340:
2341:            /**
2342:             * <!-- start generic documentation -->
2343:             * Gives the JDBC driver a hint as to the number of rows that should
2344:             * be fetched from the database when more rows are needed for this
2345:             * <code>ResultSet</code> object.
2346:             * If the fetch size specified is zero, the JDBC driver
2347:             * ignores the value and is free to make its own best guess as to what
2348:             * the fetch size should be.  The default value is set by the
2349:             * <code>Statement</code> object
2350:             * that created the result set.  The fetch size may be changed at any
2351:             * time. <p>
2352:             * <!-- end generic documentation -->
2353:             *
2354:             * <!-- start release-specific documentation -->
2355:             * <div class="ReleaseSpecificDocumentation">
2356:             * <h3>HSQLDB-Specific Information:</h3> <p>
2357:             *
2358:             * Including 1.7.2, HSQLDB builds and returns result sets
2359:             * as a whole; this method does nothing.
2360:             * </div>
2361:             * <!-- end release-specific documentation -->
2362:             *
2363:             * @param rows the number of rows to fetch
2364:             * @exception SQLException if a database access error occurs or the
2365:             * condition <code>0 <= rows <= this.getMaxRows()</code> is not satisfied
2366:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2367:             *   jdbcResultSet)
2368:             * @see #getFetchSize
2369:             * @see jdbcStatement#setFetchSize
2370:             * @see jdbcStatement#getFetchSize
2371:             */
2372:            public void setFetchSize(int rows) throws SQLException {
2373:
2374:                if (rows < 0) {
2375:                    throw Util.sqlException(Trace.INVALID_JDBC_ARGUMENT);
2376:                }
2377:            }
2378:
2379:            /**
2380:             * <!-- start generic documentation -->
2381:             * Retrieves the fetch size for this
2382:             * <code>ResultSet</code> object. <p>
2383:             * <!-- end generic documentation -->
2384:             *
2385:             * <!-- start release-specific documentation -->
2386:             * <div class="ReleaseSpecificDocumentation">
2387:             * <h3>HSQLDB-Specific Information:</h3> <p>
2388:             *
2389:             * Including 1.7.2, HSQLDB builds and returns result sets
2390:             * as a whole; the value returned (always 1) has no significance.
2391:             * </div>
2392:             * <!-- end release-specific documentation -->
2393:             *
2394:             * @return the current fetch size for this <code>ResultSet</code> object
2395:             * @exception SQLException if a database access error occurs
2396:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2397:             *   jdbcResultSet)
2398:             * @see #setFetchSize
2399:             * @see jdbcStatement#getFetchSize
2400:             * @see jdbcStatement#setFetchSize
2401:             */
2402:            public int getFetchSize() throws SQLException {
2403:
2404:                checkClosed();
2405:
2406:                return 1;
2407:            }
2408:
2409:            /**
2410:             * <!-- start generic documentation -->
2411:             * Retrieves the type of this <code>ResultSet</code> object.
2412:             * The type is determined by the <code>Statement</code> object
2413:             * that created the result set. <p>
2414:             * <!-- end generic documentation -->
2415:             *
2416:             * <!-- start release-specific documentation -->
2417:             * <div class="ReleaseSpecificDocumentation">
2418:             * <h3>HSQLDB-Specific Information:</h3> <p>
2419:             *
2420:             * Including 1.7.2, HSQLDB does not support and thus
2421:             * never returns <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>.
2422:             * </div>
2423:             * <!-- end release-specific documentation -->
2424:             *
2425:             * @return <code>ResultSet.TYPE_FORWARD_ONLY</code>,
2426:             *     <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>,
2427:             *     or <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> (not supported)
2428:             * @exception SQLException if a database access error occurs
2429:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2430:             *    jdbcResultSet)
2431:             */
2432:            public int getType() throws SQLException {
2433:
2434:                checkClosed();
2435:
2436:                return rsType;
2437:            }
2438:
2439:            /**
2440:             * <!-- start generic documentation -->
2441:             * Retrieves the concurrency mode of this <code>ResultSet</code> object.
2442:             * The concurrency used is determined by the
2443:             * <code>Statement</code> object that created the result set. <p>
2444:             * <!-- end generic documentation -->
2445:             *
2446:             * <!-- start release-specific documentation -->
2447:             * <div class="ReleaseSpecificDocumentation">
2448:             * <h3>HSQLDB-Specific Information:</h3> <p>
2449:             *
2450:             * Including 1.7.2, HSQLDB supports only <code>CONCUR_READ_ONLY</code>;
2451:             * this method always returns <code>CONCUR_READ_ONLY</code>.
2452:             * </div>
2453:             * <!-- end release-specific documentation -->
2454:             *
2455:             * @return the concurrency type, either
2456:             *    <code>ResultSet.CONCUR_READ_ONLY</code>
2457:             *    or <code>ResultSet.CONCUR_UPDATABLE</code>
2458:             * @exception SQLException if a database access error occurs
2459:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2460:             *   jdbcResultSet)
2461:             */
2462:            public int getConcurrency() throws SQLException {
2463:
2464:                checkClosed();
2465:
2466:                return CONCUR_READ_ONLY;
2467:            }
2468:
2469:            //---------------------------------------------------------------------
2470:            // Updates
2471:            //---------------------------------------------------------------------
2472:
2473:            /**
2474:             * <!-- start generic documentation -->
2475:             * Retrieves whether the current row has been updated.  The value returned
2476:             * depends on whether or not the result set can detect updates. <p>
2477:             * <!-- end generic documentation -->
2478:             *
2479:             * <!-- start release-specific documentation -->
2480:             * <div class="ReleaseSpecificDocumentation">
2481:             * <h3>HSQLDB-Specific Information:</h3> <p>
2482:             *
2483:             * Including 1.7.2, HSQLDB does not support updateable results. <p>
2484:             *
2485:             * This method always returns false.
2486:             * </div>
2487:             * <!-- end release-specific documentation -->
2488:             *
2489:             * @return <code>true</code> if both (1) the row has been visibly updated
2490:             *    by the owner or another and (2) updates are detected
2491:             * @exception SQLException if a database access error occurs
2492:             * @see DatabaseMetaData#updatesAreDetected
2493:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2494:             *   jdbcResultSet)
2495:             */
2496:            public boolean rowUpdated() throws SQLException {
2497:
2498:                checkClosed();
2499:
2500:                return false;
2501:            }
2502:
2503:            /**
2504:             * <!-- start generic documentation -->
2505:             * Retrieves whether the current row has had an insertion.
2506:             * The value returned depends on whether or not this
2507:             * <code>ResultSet</code> object can detect visible inserts. <p>
2508:             * <!-- end generic documentation -->
2509:             *
2510:             * <!-- start release-specific documentation -->
2511:             * <div class="ReleaseSpecificDocumentation">
2512:             * <h3>HSQLDB-Specific Information:</h3> <p>
2513:             *
2514:             * Including 1.7.2, HSQLDB does not support updateable results. <p>
2515:             *
2516:             * This method always returns false.
2517:             * </div>
2518:             * <!-- end release-specific documentation -->
2519:             *
2520:             * @return <code>true</code> if a row has had an insertion
2521:             * and insertions are detected; <code>false</code> otherwise
2522:             * @exception SQLException if a database access error occurs
2523:             * @see DatabaseMetaData#insertsAreDetected
2524:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2525:             *   jdbcResultSet)
2526:             */
2527:            public boolean rowInserted() throws SQLException {
2528:
2529:                checkClosed();
2530:
2531:                return false;
2532:            }
2533:
2534:            /**
2535:             * <!-- start generic documentation -->
2536:             * Retrieves whether a row has been deleted.  A deleted row may leave
2537:             * a visible "hole" in a result set.  This method can be used to
2538:             * detect holes in a result set.  The value returned depends on whether
2539:             * or not this <code>ResultSet</code> object can detect deletions. <p>
2540:             * <!-- end generic documentation -->
2541:             *
2542:             * <!-- start release-specific documentation -->
2543:             * <div class="ReleaseSpecificDocumentation">
2544:             * <h3>HSQLDB-Specific Information:</h3> <p>
2545:             *
2546:             * Including 1.7.2, HSQLDB does not support updateable results. <p>
2547:             *
2548:             * This method always returns false.
2549:             * </div>
2550:             * <!-- end release-specific documentation -->
2551:             * @return <code>true</code> if a row was deleted and deletions are
2552:             *      detected; <code>false</code> otherwise
2553:             * @exception SQLException if a database access error occurs
2554:             * @see DatabaseMetaData#deletesAreDetected
2555:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2556:             *   jdbcResultSet)
2557:             */
2558:            public boolean rowDeleted() throws SQLException {
2559:
2560:                checkClosed();
2561:
2562:                return false;
2563:            }
2564:
2565:            /**
2566:             * <!-- start generic documentation -->
2567:             * Gives a nullable column a null value.
2568:             *
2569:             * The updater methods are used to update column values in the
2570:             * current row or the insert row.  The updater methods do not
2571:             * update the underlying database; instead the <code>updateRow</code>
2572:             * or <code>insertRow</code> methods are called to update the database.<p>
2573:             * <!-- end generic documentation -->
2574:             *
2575:             * <!-- start release-specific documentation -->
2576:             * <div class="ReleaseSpecificDocumentation">
2577:             * <h3>HSQLDB-Specific Information:</h3> <p>
2578:             *
2579:             * Including 1.7.1, HSQLDB does not support updateable results. <p>
2580:             *
2581:             * This method always throws an SQLException stating that
2582:             * the operation is not supported.
2583:             * </div>
2584:             * <!-- end release-specific documentation -->
2585:             *
2586:             * @param columnIndex the first column is 1, the second is 2, ...
2587:             * @exception SQLException if a database access error occurs
2588:             * @since JDK 1.2
2589:             */
2590:            public void updateNull(int columnIndex) throws SQLException {
2591:                throw Util.notSupported();
2592:            }
2593:
2594:            /**
2595:             * <!-- start generic documentation -->
2596:             * Updates the designated column with a <code>boolean</code> value.
2597:             * The updater methods are used to update column values in the
2598:             * current row or the insert row.  The updater methods do not
2599:             * update the underlying database; instead the <code>updateRow</code> or
2600:             * <code>insertRow</code> methods are called to update the database. <p>
2601:             * <!-- end generic documentation -->
2602:             *
2603:             * <!-- start release-specific documentation -->
2604:             * <div class="ReleaseSpecificDocumentation">
2605:             * <h3>HSQLDB-Specific Information:</h3> <p>
2606:             *
2607:             * Including 1.7.2, HSQLDB does not support updateable results. <p>
2608:             *
2609:             * This method always throws an SQLException, stating that
2610:             * the operation is not supported.
2611:             * </div>
2612:             * <!-- end release-specific documentation -->
2613:             *
2614:             * @param columnIndex the first column is 1, the second is 2, ...
2615:             * @param x the new column value
2616:             * @exception SQLException if a database access error occurs
2617:             * @since JDK 1.2
2618:             */
2619:            public void updateBoolean(int columnIndex, boolean x)
2620:                    throws SQLException {
2621:                throw Util.notSupported();
2622:            }
2623:
2624:            /**
2625:             * <!-- start generic documentation -->
2626:             * Updates the designated column with a <code>byte</code> value.
2627:             * The updater methods are used to update column values in the
2628:             * current row or the insert row.  The updater methods do not
2629:             * update the underlying database; instead the <code>updateRow</code> or
2630:             * <code>insertRow</code> methods are called to update the database. <p>
2631:             * <!-- end generic documentation -->
2632:             *
2633:             * <!-- start release-specific documentation -->
2634:             * <div class="ReleaseSpecificDocumentation">
2635:             * <h3>HSQLDB-Specific Information:</h3> <p>
2636:             *
2637:             * Including 1.7.2, HSQLDB does not support updateable results. <p>
2638:             *
2639:             * This method always throws an SQLException, stating that
2640:             * the operation is not supported.
2641:             * </div>
2642:             * <!-- end release-specific documentation -->
2643:             *
2644:             * @param columnIndex the first column is 1, the second is 2, ...
2645:             * @param x the new column value
2646:             * @exception SQLException if a database access error occurs
2647:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2648:             * jdbcResultSet)
2649:             */
2650:            public void updateByte(int columnIndex, byte x) throws SQLException {
2651:                throw Util.notSupported();
2652:            }
2653:
2654:            /**
2655:             * <!-- start generic documentation -->
2656:             * Updates the designated column with a <code>short</code> value.
2657:             * The updater methods are used to update column values in the
2658:             * current row or the insert row.  The updater methods do not
2659:             * update the underlying database; instead the <code>updateRow</code> or
2660:             * <code>insertRow</code> methods are called to update the database. <p>
2661:             * <!-- end generic documentation -->
2662:             *
2663:             * <!-- start release-specific documentation -->
2664:             * <div class="ReleaseSpecificDocumentation">
2665:             * <h3>HSQLDB-Specific Information:</h3> <p>
2666:             *
2667:             * Including 1.7.2, HSQLDB does not support updateable results. <p>
2668:             *
2669:             * This method always throws an SQLException stating that
2670:             * the operation is not supported.
2671:             * </div>
2672:             * <!-- end release-specific documentation -->
2673:             *
2674:             * @param columnIndex the first column is 1, the second is 2, ...
2675:             * @param x the new column value
2676:             * @exception SQLException if a database access error occurs
2677:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2678:             * jdbcResultSet)
2679:             */
2680:            public void updateShort(int columnIndex, short x)
2681:                    throws SQLException {
2682:                throw Util.notSupported();
2683:            }
2684:
2685:            /**
2686:             * <!-- start generic documentation -->
2687:             * Updates the designated column with an <code>int</code> value.
2688:             * The updater methods are used to update column values in the
2689:             * current row or the insert row.  The updater methods do not
2690:             * update the underlying database; instead the <code>updateRow</code> or
2691:             * <code>insertRow</code> methods are called to update the database. <p>
2692:             * <!-- end generic documentation -->
2693:             *
2694:             * <!-- start release-specific documentation -->
2695:             * <div class="ReleaseSpecificDocumentation">
2696:             * <h3>HSQLDB-Specific Information:</h3> <p>
2697:             *
2698:             * Including 1.7.2, HSQLDB does not support updateable results. <p>
2699:             *
2700:             * This method always throws an SQLException stating that
2701:             * the operation is not supported.
2702:             * </div>
2703:             * <!-- end release-specific documentation -->
2704:             *
2705:             * @param columnIndex the first column is 1, the second is 2, ...
2706:             * @param x the new column value
2707:             * @exception SQLException if a database access error occurs
2708:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2709:             * jdbcResultSet)
2710:             */
2711:            public void updateInt(int columnIndex, int x) throws SQLException {
2712:                throw Util.notSupported();
2713:            }
2714:
2715:            /**
2716:             * <!-- start generic documentation -->
2717:             * Updates the designated column with a <code>long</code> value.
2718:             * The updater methods are used to update column values in the
2719:             * current row or the insert row.  The updater methods do not
2720:             * update the underlying database; instead the <code>updateRow</code> or
2721:             * <code>insertRow</code> methods are called to update the database. <p>
2722:             * <!-- end generic documentation -->
2723:             *
2724:             * <!-- start release-specific documentation -->
2725:             * <div class="ReleaseSpecificDocumentation">
2726:             * <h3>HSQLDB-Specific Information:</h3> <p>
2727:             *
2728:             * Including 1.7.2, HSQLDB does not support updateable results. <p>
2729:             *
2730:             * This method always throws an SQLException stating that
2731:             * the operation is not supported.
2732:             * </div>
2733:             * <!-- end release-specific documentation -->
2734:             *
2735:             * @param columnIndex the first column is 1, the second is 2, ...
2736:             * @param x the new column value
2737:             * @exception SQLException if a database access error occurs
2738:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2739:             * jdbcResultSet)
2740:             */
2741:            public void updateLong(int columnIndex, long x) throws SQLException {
2742:                throw Util.notSupported();
2743:            }
2744:
2745:            /**
2746:             * <!-- start generic documentation -->
2747:             * Updates the designated column with a <code>float</code> value.
2748:             * The updater methods are used to update column values in the
2749:             * current row or the insert row.  The updater methods do not
2750:             * update the underlying database; instead the <code>updateRow</code> or
2751:             * <code>insertRow</code> methods are called to update the database. <p>
2752:             * <!-- end generic documentation -->
2753:             *
2754:             * <!-- start release-specific documentation -->
2755:             * <div class="ReleaseSpecificDocumentation">
2756:             * <h3>HSQLDB-Specific Information:</h3> <p>
2757:             *
2758:             * Including 1.7.2, HSQLDB does not support updateable results. <p>
2759:             *
2760:             * This method always throws an SQLException, stating that
2761:             * the operation is not supported.
2762:             * </div>
2763:             * <!-- end release-specific documentation -->
2764:             *
2765:             * @param columnIndex the first column is 1, the second is 2, ...
2766:             * @param x the new column value
2767:             * @exception SQLException if a database access error occurs
2768:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2769:             * jdbcResultSet)
2770:             */
2771:            public void updateFloat(int columnIndex, float x)
2772:                    throws SQLException {
2773:                throw Util.notSupported();
2774:            }
2775:
2776:            /**
2777:             * <!-- start generic documentation -->
2778:             * Updates the designated column with a <code>double</code> value.
2779:             * The updater methods are used to update column values in the
2780:             * current row or the insert row.  The updater methods do not
2781:             * update the underlying database; instead the <code>updateRow</code> or
2782:             * <code>insertRow</code> methods are called to update the database. <p>
2783:             * <!-- end generic documentation -->
2784:             *
2785:             * <!-- start release-specific documentation -->
2786:             * <div class="ReleaseSpecificDocumentation">
2787:             * <h3>HSQLDB-Specific Information:</h3> <p>
2788:             *
2789:             * Including 1.7.2, HSQLDB does not support updateable results. <p>
2790:             *
2791:             * This method always throws an SQLException, stating that
2792:             * the operation is not supported.
2793:             * </div>
2794:             * <!-- end release-specific documentation -->
2795:             *
2796:             * @param columnIndex the first column is 1, the second is 2, ...
2797:             * @param x the new column value
2798:             * @exception SQLException if a database access error occurs
2799:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2800:             * jdbcResultSet)
2801:             */
2802:            public void updateDouble(int columnIndex, double x)
2803:                    throws SQLException {
2804:                throw Util.notSupported();
2805:            }
2806:
2807:            /**
2808:             * <!-- start generic documentation -->
2809:             * Updates the designated column with a <code>java.math.BigDecimal</code>
2810:             * value.
2811:             * The updater methods are used to update column values in the
2812:             * current row or the insert row.  The updater methods do not
2813:             * update the underlying database; instead the <code>updateRow</code> or
2814:             * <code>insertRow</code> methods are called to update the database. <p>
2815:             * <!-- end generic documentation -->
2816:             *
2817:             * <!-- start release-specific documentation -->
2818:             * <div class="ReleaseSpecificDocumentation">
2819:             * <h3>HSQLDB-Specific Information:</h3> <p>
2820:             *
2821:             * Including 1.7.2, HSQLDB does not support updateable results. <p>
2822:             *
2823:             * This method always throws an SQLException stating that
2824:             * the operation is not supported.
2825:             * </div>
2826:             * <!-- end release-specific documentation -->
2827:             *
2828:             * @param columnIndex the first column is 1, the second is 2, ...
2829:             * @param x the new column value
2830:             * @exception SQLException if a database access error occurs
2831:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2832:             * jdbcResultSet)
2833:             */
2834:            public void updateBigDecimal(int columnIndex, BigDecimal x)
2835:                    throws SQLException {
2836:                throw Util.notSupported();
2837:            }
2838:
2839:            /**
2840:             * <!-- start generic documentation -->
2841:             * Updates the designated column with a <code>String</code> value.
2842:             * The updater methods are used to update column values in the
2843:             * current row or the insert row.  The updater methods do not
2844:             * update the underlying database; instead the <code>updateRow</code> or
2845:             * <code>insertRow</code> methods are called to update the database. <p>
2846:             * <!-- end generic documentation -->
2847:             *
2848:             * <!-- start release-specific documentation -->
2849:             * <div class="ReleaseSpecificDocumentation">
2850:             * <h3>HSQLDB-Specific Information:</h3> <p>
2851:             *
2852:             * Including 1.7.2, HSQLDB does not support updateable results. <p>
2853:             *
2854:             * This method always throws an SQLException, stating that
2855:             * the operation is not supported.
2856:             * </div>
2857:             * <!-- end release-specific documentation -->
2858:             *
2859:             * @param columnIndex the first column is 1, the second is 2, ...
2860:             * @param x the new column value
2861:             * @exception SQLException if a database access error occurs
2862:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2863:             * jdbcResultSet)
2864:             */
2865:            public void updateString(int columnIndex, String x)
2866:                    throws SQLException {
2867:                throw Util.notSupported();
2868:            }
2869:
2870:            /**
2871:             * <!-- start generic documentation -->
2872:             * Updates the designated column with a <code>byte</code> array value.
2873:             * The updater methods are used to update column values in the
2874:             * current row or the insert row.  The updater methods do not
2875:             * update the underlying database; instead the <code>updateRow</code> or
2876:             * <code>insertRow</code> methods are called to update the database. <p>
2877:             * <!-- end generic documentation -->
2878:             *
2879:             * <!-- start release-specific documentation -->
2880:             * <div class="ReleaseSpecificDocumentation">
2881:             * <h3>HSQLDB-Specific Information:</h3> <p>
2882:             *
2883:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
2884:             *
2885:             * This method always throws an SQLException, stating that
2886:             * the operation is not supported.
2887:             * </div>
2888:             * <!-- end release-specific documentation -->
2889:             *
2890:             * @param columnIndex the first column is 1, the second is 2, ...
2891:             * @param x the new column value
2892:             * @exception SQLException if a database access error occurs
2893:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2894:             * jdbcResultSet)
2895:             */
2896:            public void updateBytes(int columnIndex, byte[] x)
2897:                    throws SQLException {
2898:                throw Util.notSupported();
2899:            }
2900:
2901:            /**
2902:             * <!-- start generic documentation -->
2903:             * Updates the designated column with a <code>java.sql.Date</code> value.
2904:             * The updater methods are used to update column values in the
2905:             * current row or the insert row.  The updater methods do not
2906:             * update the underlying database; instead the <code>updateRow</code> or
2907:             * <code>insertRow</code> methods are called to update the database. <p>
2908:             * <!-- end generic documentation -->
2909:             *
2910:             * <!-- start release-specific documentation -->
2911:             * <div class="ReleaseSpecificDocumentation">
2912:             * <h3>HSQLDB-Specific Information:</h3> <p>
2913:             *
2914:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
2915:             *
2916:             * This method always throws an SQLException, stating that
2917:             * the operation is not supported.
2918:             * </div>
2919:             * <!-- end release-specific documentation -->
2920:             *
2921:             * @param columnIndex the first column is 1, the second is 2, ...
2922:             * @param x the new column value
2923:             * @exception SQLException if a database access error occurs
2924:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2925:             * jdbcResultSet)
2926:             */
2927:            public void updateDate(int columnIndex, Date x) throws SQLException {
2928:                throw Util.notSupported();
2929:            }
2930:
2931:            /**
2932:             * <!-- start generic documentation -->
2933:             * Updates the designated column with a <code>java.sql.Time</code> value.
2934:             * The updater methods are used to update column values in the
2935:             * current row or the insert row.  The updater methods do not
2936:             * update the underlying database; instead the <code>updateRow</code> or
2937:             * <code>insertRow</code> methods are called to update the database. <p>
2938:             * <!-- end generic documentation -->
2939:             *
2940:             * <!-- start release-specific documentation -->
2941:             * <div class="ReleaseSpecificDocumentation">
2942:             * <h3>HSQLDB-Specific Information:</h3> <p>
2943:             *
2944:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
2945:             *
2946:             * This method always throws an SQLException stating that
2947:             * the operation is not supported.
2948:             * </div>
2949:             * <!-- end release-specific documentation -->
2950:             *
2951:             * @param columnIndex the first column is 1, the second is 2, ...
2952:             * @param x the new column value
2953:             * @exception SQLException if a database access error occurs
2954:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2955:             * jdbcResultSet)
2956:             */
2957:            public void updateTime(int columnIndex, Time x) throws SQLException {
2958:                throw Util.notSupported();
2959:            }
2960:
2961:            /**
2962:             * <!-- start generic documentation -->
2963:             * Updates the designated column with a <code>java.sql.Timestamp</code>
2964:             * value.
2965:             * The updater methods are used to update column values in the
2966:             * current row or the insert row.  The updater methods do not
2967:             * update the underlying database; instead the <code>updateRow</code> or
2968:             * <code>insertRow</code> methods are called to update the database. <p>
2969:             * <!-- end generic documentation -->
2970:             *
2971:             * <!-- start release-specific documentation -->
2972:             * <div class="ReleaseSpecificDocumentation">
2973:             * <h3>HSQLDB-Specific Information:</h3> <p>
2974:             *
2975:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
2976:             *
2977:             * This method always throws an SQLException stating that
2978:             * the operation is not supported.
2979:             * </div>
2980:             * <!-- end release-specific documentation -->
2981:             *
2982:             * @param columnIndex the first column is 1, the second is 2, ...
2983:             * @param x the new column value
2984:             * @exception SQLException if a database access error occurs
2985:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2986:             * jdbcResultSet)
2987:             */
2988:            public void updateTimestamp(int columnIndex, Timestamp x)
2989:                    throws SQLException {
2990:                throw Util.notSupported();
2991:            }
2992:
2993:            /**
2994:             * <!-- start generic documentation -->
2995:             * Updates the designated column with an ascii stream value.
2996:             * The updater methods are used to update column values in the
2997:             * current row or the insert row.  The updater methods do not
2998:             * update the underlying database; instead the <code>updateRow</code> or
2999:             * <code>insertRow</code> methods are called to update the database. <p>
3000:             * <!-- end generic documentation -->
3001:             *
3002:             * <!-- start release-specific documentation -->
3003:             * <div class="ReleaseSpecificDocumentation">
3004:             * <h3>HSQLDB-Specific Information:</h3> <p>
3005:             *
3006:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3007:             *
3008:             * This method always throws an SQLException stating that
3009:             * the operation is not supported.
3010:             * </div>
3011:             *
3012:             * @param columnIndex the first column is 1, the second is 2, ...
3013:             * @param x the new column value
3014:             * @param length the length of the stream
3015:             * @exception SQLException if a database access error occurs
3016:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3017:             * jdbcResultSet)
3018:             */
3019:            public void updateAsciiStream(int columnIndex,
3020:                    java.io.InputStream x, int length) throws SQLException {
3021:                throw Util.notSupported();
3022:            }
3023:
3024:            /**
3025:             * <!-- start generic documentation -->
3026:             * Updates the designated column with a binary stream value.
3027:             * The updater methods are used to update column values in the
3028:             * current row or the insert row.  The updater methods do not
3029:             * update the underlying database; instead the <code>updateRow</code> or
3030:             * <code>insertRow</code> methods are called to update the database. <p>
3031:             * <!-- end generic documentation -->
3032:             *
3033:             * <!-- start release-specific documentation -->
3034:             * <div class="ReleaseSpecificDocumentation">
3035:             * <h3>HSQLDB-Specific Information:</h3> <p>
3036:             *
3037:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3038:             *
3039:             * This method always throws an SQLException stating that
3040:             * the operation is not supported.
3041:             * </div>
3042:             * <!-- end release-specific documentation -->
3043:             *
3044:             * @param columnIndex the first column is 1, the second is 2, ...
3045:             * @param x the new column value
3046:             * @param length the length of the stream
3047:             * @exception SQLException if a database access error occurs
3048:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3049:             * jdbcResultSet)
3050:             */
3051:            public void updateBinaryStream(int columnIndex,
3052:                    java.io.InputStream x, int length) throws SQLException {
3053:                throw Util.notSupported();
3054:            }
3055:
3056:            /**
3057:             * <!-- start generic documentation -->
3058:             * Updates the designated column with a character stream value.
3059:             * The updater methods are used to update column values in the
3060:             * current row or the insert row.  The updater methods do not
3061:             * update the underlying database; instead the <code>updateRow</code> or
3062:             * <code>insertRow</code> methods are called to update the database. <p>
3063:             * <!-- end generic documentation -->
3064:             *
3065:             * <!-- start release-specific documentation -->
3066:             * <div class="ReleaseSpecificDocumentation">
3067:             * <h3>HSQLDB-Specific Information:</h3> <p>
3068:             *
3069:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3070:             *
3071:             * This method always throws an SQLException stating that
3072:             * the operation is not supported.
3073:             * </div>
3074:             * <!-- end release-specific documentation -->
3075:             *
3076:             * @param columnIndex the first column is 1, the second is 2, ...
3077:             * @param x the new column value
3078:             * @param length the length of the stream
3079:             * @exception SQLException if a database access error occurs
3080:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3081:             *  jdbcResultSet)
3082:             */
3083:            public void updateCharacterStream(int columnIndex,
3084:                    java.io.Reader x, int length) throws SQLException {
3085:                throw Util.notSupported();
3086:            }
3087:
3088:            /**
3089:             * <!-- start generic documentation -->
3090:             * Updates the designated column with an <code>Object</code> value.
3091:             * The updater methods are used to update column values in the
3092:             * current row or the insert row.  The updater methods do not
3093:             * update the underlying database; instead the <code>updateRow</code> or
3094:             * <code>insertRow</code> methods are called to update the database. <p>
3095:             * <!-- end generic documentation -->
3096:             *
3097:             * <!-- start release-specific documentation -->
3098:             * <div class="ReleaseSpecificDocumentation">
3099:             * <h3>HSQLDB-Specific Information:</h3> <p>
3100:             *
3101:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3102:             *
3103:             * This method always throws an SQLException stating that
3104:             * the operation is not supported.
3105:             * </div>
3106:             * <!-- end release-specific documentation -->
3107:             *
3108:             * @param columnIndex the first column is 1, the second is 2, ...
3109:             * @param x the new column value
3110:             * @param scale for <code>java.sql.Types.DECIMA</code>
3111:             * or <code>java.sql.Types.NUMERIC</code> types,
3112:             * this is the number of digits after the decimal point.  For all other
3113:             * types this value will be ignored.
3114:             * @exception SQLException if a database access error occurs
3115:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3116:             *  jdbcResultSet)
3117:             */
3118:            public void updateObject(int columnIndex, Object x, int scale)
3119:                    throws SQLException {
3120:                throw Util.notSupported();
3121:            }
3122:
3123:            /**
3124:             * <!-- start generic documentation -->
3125:             * Updates the designated column with an <code>Object</code> value.
3126:             * The updater methods are used to update column values in the
3127:             * current row or the insert row.  The updater methods do not
3128:             * update the underlying database; instead the <code>updateRow</code> or
3129:             * <code>insertRow</code> methods are called to update the database. <p>
3130:             * <!-- end generic documentation -->
3131:             *
3132:             * <!-- start release-specific documentation -->
3133:             * <div class="ReleaseSpecificDocumentation">
3134:             * <h3>HSQLDB-Specific Information:</h3> <p>
3135:             *
3136:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3137:             *
3138:             * This method always throws an SQLException stating that
3139:             * the operation is not supported.
3140:             * </div>
3141:             * <!-- end release-specific documentation -->
3142:             *
3143:             * @param columnIndex the first column is 1, the second is 2, ...
3144:             * @param x the new column value
3145:             * @exception SQLException if a database access error occurs
3146:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3147:             *  jdbcResultSet)
3148:             */
3149:            public void updateObject(int columnIndex, Object x)
3150:                    throws SQLException {
3151:                throw Util.notSupported();
3152:            }
3153:
3154:            /**
3155:             * <!-- start generic documentation -->
3156:             * Updates the designated column with a <code>null</code> value.
3157:             * The updater methods are used to update column values in the
3158:             * current row or the insert row.  The updater methods do not
3159:             * update the underlying database; instead the <code>updateRow</code> or
3160:             * <code>insertRow</code> methods are called to update the database. <p>
3161:             * <!-- end generic documentation -->
3162:             *
3163:             * <!-- start release-specific documentation -->
3164:             * <div class="ReleaseSpecificDocumentation">
3165:             * <h3>HSQLDB-Specific Information:</h3> <p>
3166:             *
3167:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3168:             *
3169:             * This method always throws an SQLException stating that
3170:             * the operation is not supported.
3171:             * </div>
3172:             * <!-- end release-specific documentation -->
3173:             *
3174:             * @param columnName the name of the column
3175:             * @exception SQLException if a database access error occurs
3176:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3177:             *  jdbcResultSet)
3178:             */
3179:            public void updateNull(String columnName) throws SQLException {
3180:                updateNull(findColumn(columnName));
3181:            }
3182:
3183:            /**
3184:             * <!-- start generic documentation -->
3185:             * Updates the designated column with a <code>boolean</code> value.
3186:             * The updater methods are used to update column values in the
3187:             * current row or the insert row.  The updater methods do not
3188:             * update the underlying database; instead the <code>updateRow</code> or
3189:             * <code>insertRow</code> methods are called to update the database. <p>
3190:             * <!-- end generic documentation -->
3191:             *
3192:             * <!-- start release-specific documentation -->
3193:             * <div class="ReleaseSpecificDocumentation">
3194:             * <h3>HSQLDB-Specific Information:</h3> <p>
3195:             *
3196:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3197:             *
3198:             * This method always throws an SQLException stating that
3199:             * the operation is not supported.
3200:             * </div>
3201:             * <!-- end release-specific documentation -->
3202:             *
3203:             * @param columnName the name of the column
3204:             * @param x the new column value
3205:             * @exception SQLException if a database access error occurs
3206:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3207:             *  jdbcResultSet)
3208:             */
3209:            public void updateBoolean(String columnName, boolean x)
3210:                    throws SQLException {
3211:                updateBoolean(findColumn(columnName), x);
3212:            }
3213:
3214:            /**
3215:             * <!-- start generic documentation -->
3216:             * Updates the designated column with a <code>byte</code> value.
3217:             * The updater methods are used to update column values in the
3218:             * current row or the insert row.  The updater methods do not
3219:             * update the underlying database; instead the <code>updateRow</code> or
3220:             * <code>insertRow</code> methods are called to update the database. <p>
3221:             * <!-- end generic documentation -->
3222:             *
3223:             * <!-- start release-specific documentation -->
3224:             * <div class="ReleaseSpecificDocumentation">
3225:             * <h3>HSQLDB-Specific Information:</h3> <p>
3226:             *
3227:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3228:             *
3229:             * This method always throws an SQLException stating that
3230:             * the operation is not supported.
3231:             * </div>
3232:             * <!-- end release-specific documentation -->
3233:             *
3234:             * @param columnName the name of the column
3235:             * @param x the new column value
3236:             * @exception SQLException if a database access error occurs
3237:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3238:             *  jdbcResultSet)
3239:             */
3240:            public void updateByte(String columnName, byte x)
3241:                    throws SQLException {
3242:                updateByte(findColumn(columnName), x);
3243:            }
3244:
3245:            /**
3246:             * <!-- start generic documentation -->
3247:             * Updates the designated column with a <code>short</code> value.
3248:             * The updater methods are used to update column values in the
3249:             * current row or the insert row.  The updater methods do not
3250:             * update the underlying database; instead the <code>updateRow</code> or
3251:             * <code>insertRow</code> methods are called to update the database. <p>
3252:             * <!-- end generic documentation -->
3253:             *
3254:             * <!-- start release-specific documentation -->
3255:             * <div class="ReleaseSpecificDocumentation">
3256:             * <h3>HSQLDB-Specific Information:</h3> <p>
3257:             *
3258:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3259:             *
3260:             * This method always throws an SQLException stating that
3261:             * the operation is not supported.
3262:             * </div>
3263:             * <!-- end release-specific documentation -->
3264:             *
3265:             * @param columnName the name of the column
3266:             * @param x the new column value
3267:             * @exception SQLException if a database access error occurs
3268:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3269:             *  jdbcResultSet)
3270:             */
3271:            public void updateShort(String columnName, short x)
3272:                    throws SQLException {
3273:                updateShort(findColumn(columnName), x);
3274:            }
3275:
3276:            /**
3277:             * <!-- start generic documentation -->
3278:             * Updates the designated column with an <code>int</code> value.
3279:             * The updater methods are used to update column values in the
3280:             * current row or the insert row.  The updater methods do not
3281:             * update the underlying database; instead the <code>updateRow</code> or
3282:             * <code>insertRow</code> methods are called to update the database. <p>
3283:             * <!-- end generic documentation -->
3284:             *
3285:             * <!-- start release-specific documentation -->
3286:             * <div class="ReleaseSpecificDocumentation">
3287:             * <h3>HSQLDB-Specific Information:</h3> <p>
3288:             *
3289:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3290:             *
3291:             * This method always throws an SQLException stating that
3292:             * the operation is not supported.
3293:             * </div>
3294:             * <!-- end release-specific documentation -->
3295:             *
3296:             * @param columnName the name of the column
3297:             * @param x the new column value
3298:             * @exception SQLException if a database access error occurs
3299:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3300:             *  jdbcResultSet)
3301:             */
3302:            public void updateInt(String columnName, int x) throws SQLException {
3303:                updateInt(findColumn(columnName), x);
3304:            }
3305:
3306:            /**
3307:             * <!-- start generic documentation -->
3308:             * Updates the designated column with a <code>long</code> value.
3309:             * The updater methods are used to update column values in the
3310:             * current row or the insert row.  The updater methods do not
3311:             * update the underlying database; instead the <code>updateRow</code> or
3312:             * <code>insertRow</code> methods are called to update the database. <p>
3313:             * <!-- end generic documentation -->
3314:             *
3315:             * <!-- start release-specific documentation -->
3316:             * <div class="ReleaseSpecificDocumentation">
3317:             * <h3>HSQLDB-Specific Information:</h3> <p>
3318:             *
3319:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3320:             *
3321:             * This method always throws an SQLException stating that
3322:             * the operation is not supported.
3323:             * </div>
3324:             * <!-- end release-specific documentation -->
3325:             *
3326:             * @param columnName the name of the column
3327:             * @param x the new column value
3328:             * @exception SQLException if a database access error occurs
3329:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3330:             *   jdbcResultSet)
3331:             */
3332:            public void updateLong(String columnName, long x)
3333:                    throws SQLException {
3334:                updateLong(findColumn(columnName), x);
3335:            }
3336:
3337:            /**
3338:             * <!-- start generic documentation -->
3339:             * Updates the designated column with a <code>float</code> value.
3340:             * The updater methods are used to update column values in the
3341:             * current row or the insert row.  The updater methods do not
3342:             * update the underlying database; instead the <code>updateRow</code> or
3343:             * <code>insertRow</code> methods are called to update the database. <p>
3344:             * <!-- end generic documentation -->
3345:             *
3346:             * <!-- start release-specific documentation -->
3347:             * <div class="ReleaseSpecificDocumentation">
3348:             * <h3>HSQLDB-Specific Information:</h3> <p>
3349:             *
3350:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3351:             *
3352:             * This method always throws an SQLException stating that
3353:             * the operation is not supported.
3354:             * </div>
3355:             * <!-- end release-specific documentation -->
3356:             *
3357:             * @param columnName the name of the column
3358:             * @param x the new column value
3359:             * @exception SQLException if a database access error occurs
3360:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3361:             *   jdbcResultSet)
3362:             */
3363:            public void updateFloat(String columnName, float x)
3364:                    throws SQLException {
3365:                updateFloat(findColumn(columnName), x);
3366:            }
3367:
3368:            /**
3369:             * <!-- start generic documentation -->
3370:             * Updates the designated column with a <code>double</code> value.
3371:             * The updater methods are used to update column values in the
3372:             * current row or the insert row.  The updater methods do not
3373:             * update the underlying database; instead the <code>updateRow</code> or
3374:             * <code>insertRow</code> methods are called to update the database. <p>
3375:             * <!-- end generic documentation -->
3376:             *
3377:             * <!-- start release-specific documentation -->
3378:             * <div class="ReleaseSpecificDocumentation">
3379:             * <h3>HSQLDB-Specific Information:</h3> <p>
3380:             *
3381:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3382:             *
3383:             * This method always throws an SQLException stating that
3384:             * the operation is not supported.
3385:             * </div>
3386:             * <!-- end release-specific documentation -->
3387:             *
3388:             * @param columnName the name of the column
3389:             * @param x the new column value
3390:             * @exception SQLException if a database access error occurs
3391:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3392:             *   jdbcResultSet)
3393:             */
3394:            public void updateDouble(String columnName, double x)
3395:                    throws SQLException {
3396:                updateDouble(findColumn(columnName), x);
3397:            }
3398:
3399:            /**
3400:             * <!-- start generic documentation -->
3401:             * Updates the designated column with a <code>java.sql.BigDecimal</code>
3402:             * value.
3403:             * The updater methods are used to update column values in the
3404:             * current row or the insert row.  The updater methods do not
3405:             * update the underlying database; instead the <code>updateRow</code> or
3406:             * <code>insertRow</code> methods are called to update the database. <p>
3407:             * <!-- end generic documentation -->
3408:             *
3409:             * <!-- start release-specific documentation -->
3410:             * <div class="ReleaseSpecificDocumentation">
3411:             * <h3>HSQLDB-Specific Information:</h3> <p>
3412:             *
3413:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3414:             *
3415:             * This method always throws an SQLException stating that
3416:             * the operation is not supported.
3417:             * </div>
3418:             * <!-- end release-specific documentation -->
3419:             *
3420:             * @param columnName the name of the column
3421:             * @param x the new column value
3422:             * @exception SQLException if a database access error occurs
3423:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3424:             *   jdbcResultSet)
3425:             */
3426:            public void updateBigDecimal(String columnName, BigDecimal x)
3427:                    throws SQLException {
3428:                updateBigDecimal(findColumn(columnName), x);
3429:            }
3430:
3431:            /**
3432:             * <!-- start generic documentation -->
3433:             * Updates the designated column with a <code>String</code> value.
3434:             * The updater methods are used to update column values in the
3435:             * current row or the insert row.  The updater methods do not
3436:             * update the underlying database; instead the <code>updateRow</code> or
3437:             * <code>insertRow</code> methods are called to update the database. <p>
3438:             * <!-- end generic documentation -->
3439:             *
3440:             * <!-- start release-specific documentation -->
3441:             * <div class="ReleaseSpecificDocumentation">
3442:             * <h3>HSQLDB-Specific Information:</h3> <p>
3443:             *
3444:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3445:             *
3446:             * This method always throws an SQLException stating that
3447:             * the operation is not supported.
3448:             * </div>
3449:             * <!-- end release-specific documentation -->
3450:             *
3451:             * @param columnName the name of the column
3452:             * @param x the new column value
3453:             * @exception SQLException if a database access error occurs
3454:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3455:             *   jdbcResultSet)
3456:             */
3457:            public void updateString(String columnName, String x)
3458:                    throws SQLException {
3459:                updateString(findColumn(columnName), x);
3460:            }
3461:
3462:            /**
3463:             * <!-- start generic documentation -->
3464:             * Updates the designated column with a byte array value.
3465:             *
3466:             * The updater methods are used to update column values in the
3467:             * current row or the insert row.  The updater methods do not
3468:             * update the underlying database; instead the <code>updateRow</code> or
3469:             * <code>insertRow</code> methods are called to update the database. <p>
3470:             * <!-- end generic documentation -->
3471:             *
3472:             * <!-- start release-specific documentation -->
3473:             * <div class="ReleaseSpecificDocumentation">
3474:             * <h3>HSQLDB-Specific Information:</h3> <p>
3475:             *
3476:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3477:             *
3478:             * This method always throws an SQLException stating that
3479:             * the operation is not supported.
3480:             * </div>
3481:             * <!-- end release-specific documentation -->
3482:             *
3483:             * @param columnName the name of the column
3484:             * @param x the new column value
3485:             * @exception SQLException if a database access error occurs
3486:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3487:             *   jdbcResultSet)
3488:             */
3489:            public void updateBytes(String columnName, byte[] x)
3490:                    throws SQLException {
3491:                updateBytes(findColumn(columnName), x);
3492:            }
3493:
3494:            /**
3495:             * <!-- start generic documentation -->
3496:             * Updates the designated column with a <code>java.sql.Date</code> value.
3497:             * The updater methods are used to update column values in the
3498:             * current row or the insert row.  The updater methods do not
3499:             * update the underlying database; instead the <code>updateRow</code> or
3500:             * <code>insertRow</code> methods are called to update the database. <p>
3501:             * <!-- end generic documentation -->
3502:             *
3503:             * <!-- start release-specific documentation -->
3504:             * <div class="ReleaseSpecificDocumentation">
3505:             * <h3>HSQLDB-Specific Information:</h3> <p>
3506:             *
3507:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3508:             *
3509:             * This method always throws an SQLException stating that
3510:             * the operation is not supported.
3511:             * </div>
3512:             * <!-- end release-specific documentation -->
3513:             *
3514:             * @param columnName the name of the column
3515:             * @param x the new column value
3516:             * @exception SQLException if a database access error occurs
3517:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3518:             *   jdbcResultSet)
3519:             */
3520:            public void updateDate(String columnName, Date x)
3521:                    throws SQLException {
3522:                updateDate(findColumn(columnName), x);
3523:            }
3524:
3525:            /**
3526:             * <!-- start generic documentation -->
3527:             * Updates the designated column with a <code>java.sql.Time</code> value.
3528:             * The updater methods are used to update column values in the
3529:             * current row or the insert row.  The updater methods do not
3530:             * update the underlying database; instead the <code>updateRow</code> or
3531:             * <code>insertRow</code> methods are called to update the database. <p>
3532:             * <!-- end generic documentation -->
3533:             *
3534:             * <!-- start release-specific documentation -->
3535:             * <div class="ReleaseSpecificDocumentation">
3536:             * <h3>HSQLDB-Specific Information:</h3> <p>
3537:             *
3538:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3539:             *
3540:             * This method always throws an SQLException stating that
3541:             * the operation is not supported.
3542:             * </div>
3543:             * <!-- end release-specific documentation -->
3544:             *
3545:             * @param columnName the name of the column
3546:             * @param x the new column value
3547:             * @exception SQLException if a database access error occurs
3548:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3549:             *   jdbcResultSet)
3550:             */
3551:            public void updateTime(String columnName, Time x)
3552:                    throws SQLException {
3553:                updateTime(findColumn(columnName), x);
3554:            }
3555:
3556:            /**
3557:             * <!-- start generic documentation -->
3558:             * Updates the designated column with a <code>java.sql.Timestamp</code>
3559:             * value.
3560:             * The updater methods are used to update column values in the
3561:             * current row or the insert row.  The updater methods do not
3562:             * update the underlying database; instead the <code>updateRow</code> or
3563:             * <code>insertRow</code> methods are called to update the database. <p>
3564:             * <!-- end generic documentation -->
3565:             *
3566:             * <!-- start release-specific documentation -->
3567:             * <div class="ReleaseSpecificDocumentation">
3568:             * <h3>HSQLDB-Specific Information:</h3> <p>
3569:             *
3570:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3571:             *
3572:             * This method always throws an SQLException stating that
3573:             * the operation is not supported.
3574:             * </div>
3575:             * <!-- end release-specific documentation -->
3576:             *
3577:             * @param columnName the name of the column
3578:             * @param x the new column value
3579:             * @exception SQLException if a database access error occurs
3580:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3581:             *   jdbcResultSet)
3582:             */
3583:            public void updateTimestamp(String columnName, Timestamp x)
3584:                    throws SQLException {
3585:                updateTimestamp(findColumn(columnName), x);
3586:            }
3587:
3588:            /**
3589:             * <!-- start generic documentation -->
3590:             * Updates the designated column with an ascii stream value.
3591:             * The updater methods are used to update column values in the
3592:             * current row or the insert row.  The updater methods do not
3593:             * update the underlying database; instead the <code>updateRow</code> or
3594:             * <code>insertRow</code> methods are called to update the database. <p>
3595:             * <!-- end generic documentation -->
3596:             *
3597:             * <!-- start release-specific documentation -->
3598:             * <div class="ReleaseSpecificDocumentation">
3599:             * <h3>HSQLDB-Specific Information:</h3> <p>
3600:             *
3601:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3602:             *
3603:             * This method always throws an SQLException stating that
3604:             * the operation is not supported.
3605:             * </div>
3606:             * <!-- end release-specific documentation -->
3607:             *
3608:             * @param columnName the name of the column
3609:             * @param x the new column value
3610:             * @param length the length of the stream
3611:             * @exception SQLException if a database access error occurs
3612:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3613:             *   jdbcResultSet)
3614:             */
3615:            public void updateAsciiStream(String columnName,
3616:                    java.io.InputStream x, int length) throws SQLException {
3617:                updateAsciiStream(findColumn(columnName), x, length);
3618:            }
3619:
3620:            /**
3621:             * <!-- start generic documentation -->
3622:             * Updates the designated column with a binary stream value.
3623:             * The updater methods are used to update column values in the
3624:             * current row or the insert row.  The updater methods do not
3625:             * update the underlying database; instead the <code>updateRow</code> or
3626:             * <code>insertRow</code> methods are called to update the database. <p>
3627:             * <!-- end generic documentation -->
3628:             *
3629:             * <!-- start release-specific documentation -->
3630:             * <div class="ReleaseSpecificDocumentation">
3631:             * <h3>HSQLDB-Specific Information:</h3> <p>
3632:             *
3633:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3634:             *
3635:             * This method always throws an SQLException stating that
3636:             * the operation is not supported.
3637:             * </div>
3638:             * <!-- end release-specific documentation -->
3639:             *
3640:             * @param columnName the name of the column
3641:             * @param x the new column value
3642:             * @param length the length of the stream
3643:             * @exception SQLException if a database access error occurs
3644:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3645:             *   jdbcResultSet)
3646:             */
3647:            public void updateBinaryStream(String columnName,
3648:                    java.io.InputStream x, int length) throws SQLException {
3649:                updateBinaryStream(findColumn(columnName), x, length);
3650:            }
3651:
3652:            /**
3653:             * <!-- start generic documentation -->
3654:             * Updates the designated column with a character stream value.
3655:             * The updater methods are used to update column values in the
3656:             * current row or the insert row.  The updater methods do not
3657:             * update the underlying database; instead the <code>updateRow</code> or
3658:             * <code>insertRow</code> methods are called to update the database. <p>
3659:             * <!-- end generic documentation -->
3660:             *
3661:             * <!-- start release-specific documentation -->
3662:             * <div class="ReleaseSpecificDocumentation">
3663:             * <h3>HSQLDB-Specific Information:</h3> <p>
3664:             *
3665:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3666:             *
3667:             * This method always throws an SQLException stating that
3668:             * the operation is not supported.
3669:             * </div>
3670:             * <!-- end release-specific documentation -->
3671:             *
3672:             * @param columnName the name of the column
3673:             * @param reader the <code>java.io.Reader</code> object containing
3674:             *   the new column value
3675:             * @param length the length of the stream
3676:             * @exception SQLException if a database access error occurs
3677:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3678:             *   jdbcResultSet)
3679:             */
3680:            public void updateCharacterStream(String columnName,
3681:                    java.io.Reader reader, int length) throws SQLException {
3682:                updateCharacterStream(findColumn(columnName), reader, length);
3683:            }
3684:
3685:            /**
3686:             * <!-- start generic documentation -->
3687:             * Updates the designated column with an <code>Object</code> value.
3688:             * The updater methods are used to update column values in the
3689:             * current row or the insert row.  The updater methods do not
3690:             * update the underlying database; instead the <code>updateRow</code> or
3691:             * <code>insertRow</code> methods are called to update the database. <p>
3692:             * <!-- end generic documentation -->
3693:             *
3694:             * <!-- start release-specific documentation -->
3695:             * <div class="ReleaseSpecificDocumentation">
3696:             * <h3>HSQLDB-Specific Information:</h3> <p>
3697:             *
3698:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3699:             *
3700:             * This method always throws an SQLException stating that
3701:             * the operation is not supported.
3702:             * </div>
3703:             * <!-- end release-specific documentation -->
3704:             *
3705:             * @param columnName the name of the column
3706:             * @param x the new column value
3707:             * @param scale for <code>java.sql.Types.DECIMAL</code>
3708:             * or <code>java.sql.Types.NUMERIC</code> types,
3709:             * this is the number of digits after the decimal point.  For all other
3710:             * types this value will be ignored.
3711:             * @exception SQLException if a database access error occurs
3712:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3713:             *   jdbcResultSet)
3714:             */
3715:            public void updateObject(String columnName, Object x, int scale)
3716:                    throws SQLException {
3717:                updateObject(findColumn(columnName), x, scale);
3718:            }
3719:
3720:            /**
3721:             * <!-- start generic documentation -->
3722:             * Updates the designated column with an <code>Object</code> value.
3723:             * The updater methods are used to update column values in the
3724:             * current row or the insert row.  The updater methods do not
3725:             * update the underlying database; instead the <code>updateRow</code> or
3726:             * <code>insertRow</code> methods are called to update the database. <p>
3727:             * <!-- end generic documentation -->
3728:             *
3729:             * <!-- start release-specific documentation -->
3730:             * <div class="ReleaseSpecificDocumentation">
3731:             * <h3>HSQLDB-Specific Information:</h3> <p>
3732:             *
3733:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3734:             *
3735:             * This method always throws an SQLException stating that
3736:             * the operation is not supported.
3737:             * </div>
3738:             * <!-- end release-specific documentation -->
3739:             *
3740:             * @param columnName the name of the column
3741:             * @param x the new column value
3742:             * @exception SQLException if a database access error occurs
3743:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3744:             *   jdbcResultSet)
3745:             */
3746:            public void updateObject(String columnName, Object x)
3747:                    throws SQLException {
3748:                updateObject(findColumn(columnName), x);
3749:            }
3750:
3751:            /**
3752:             * <!-- start generic documentation -->
3753:             * Inserts the contents of the insert row into this
3754:             * <code>ResultSet</code> object and into the database.
3755:             * The cursor must be on the insert row when this method is called. <p>
3756:             * <!-- end generic documentation -->
3757:             *
3758:             * <!-- start release-specific documentation -->
3759:             * <div class="ReleaseSpecificDocumentation">
3760:             * <h3>HSQLDB-Specific Information:</h3> <p>
3761:             *
3762:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3763:             *
3764:             * This method always throws an SQLException stating that
3765:             * the operation is not supported.
3766:             * </div>
3767:             * <!-- end release-specific documentation -->
3768:             *
3769:             * @exception SQLException if a database access error occurs,
3770:             * if this method is called when the cursor is not on the insert row,
3771:             * or if not all of non-nullable columns in
3772:             * the insert row have been given a value
3773:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3774:             *   jdbcResultSet)
3775:             */
3776:            public void insertRow() throws SQLException {
3777:                throw Util.notSupported();
3778:            }
3779:
3780:            /**
3781:             * <!-- start generic documentation -->
3782:             * Updates the underlying database with the new contents of the
3783:             * current row of this <code>ResultSet</code> object.
3784:             * This method cannot be called when the cursor is on the insert row. <p>
3785:             * <!-- end generic documentation -->
3786:             *
3787:             * <!-- start release-specific documentation -->
3788:             * <div class="ReleaseSpecificDocumentation">
3789:             * <h3>HSQLDB-Specific Information:</h3> <p>
3790:             *
3791:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3792:             *
3793:             * This method always throws an SQLException stating that
3794:             * the operation is not supported.
3795:             * </div>
3796:             * <!-- end release-specific documentation -->
3797:             *
3798:             * @exception SQLException if a database access error occurs or
3799:             * if this method is called when the cursor is on the insert row
3800:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3801:             *   jdbcResultSet)
3802:             */
3803:            public void updateRow() throws SQLException {
3804:                throw Util.notSupported();
3805:            }
3806:
3807:            /**
3808:             * <!-- start generic documentation -->
3809:             * Deletes the current row from this <code>ResultSet</code> object
3810:             * and from the underlying database.  This method cannot be called when
3811:             * the cursor is on the insert row. <p>
3812:             * <!-- end generic documentation -->
3813:             *
3814:             * <!-- start release-specific documentation -->
3815:             * <div class="ReleaseSpecificDocumentation">
3816:             * <h3>HSQLDB-Specific Information:</h3> <p>
3817:             *
3818:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3819:             *
3820:             * This method always throws an SQLException stating that
3821:             * the operation is not supported.
3822:             * </div>
3823:             * <!-- end release-specific documentation -->
3824:             *
3825:             * @exception SQLException if a database access error occurs
3826:             * or if this method is called when the cursor is on the insert row
3827:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3828:             *   jdbcResultSet)
3829:             */
3830:            public void deleteRow() throws SQLException {
3831:                throw Util.notSupported();
3832:            }
3833:
3834:            /**
3835:             * <!-- start generic documentation -->
3836:             * Refreshes the current row with its most recent value in
3837:             * the database.  This method cannot be called when
3838:             * the cursor is on the insert row.
3839:             *
3840:             * <P>The <code>refreshRow</code> method provides a way for an
3841:             * application to
3842:             * explicitly tell the JDBC driver to refetch a row(s) from the
3843:             * database.  An application may want to call <code>refreshRow</code> when
3844:             * caching or prefetching is being done by the JDBC driver to
3845:             * fetch the latest value of a row from the database.  The JDBC driver
3846:             * may actually refresh multiple rows at once if the fetch size is
3847:             * greater than one.
3848:             *
3849:             * <P> All values are refetched subject to the transaction isolation
3850:             * level and cursor sensitivity.  If <code>refreshRow</code> is called
3851:             * after calling an updater method, but before calling
3852:             * the method <code>updateRow</code>, then the
3853:             * updates made to the row are lost.  Calling the method
3854:             * <code>refreshRow</code> frequently will likely slow performance. <p>
3855:             * <!-- end generic documentation -->
3856:             *
3857:             * <!-- start release-specific documentation -->
3858:             * <div class="ReleaseSpecificDocumentation">
3859:             * <h3>HSQLDB-Specific Information:</h3> <p>
3860:             *
3861:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3862:             *
3863:             * This method always throws an SQLException stating that
3864:             * the operation is not supported.
3865:             * </div>
3866:             * <!-- end release-specific documentation -->
3867:             *
3868:             * @exception SQLException if a database access error
3869:             * occurs or if this method is called when the cursor is on the insert row
3870:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3871:             *    jdbcResultSet)
3872:             */
3873:            public void refreshRow() throws SQLException {
3874:                throw Util.notSupported();
3875:            }
3876:
3877:            /**
3878:             * <!-- start generic documentation -->
3879:             * Cancels the updates made to the current row in this
3880:             * <code>ResultSet</code> object.
3881:             * This method may be called after calling an
3882:             * updater method(s) and before calling
3883:             * the method <code>updateRow</code> to roll back
3884:             * the updates made to a row.  If no updates have been made or
3885:             * <code>updateRow</code> has already been called, this method has no
3886:             * effect. <p>
3887:             * <!-- end generic documentation -->
3888:             *
3889:             * <!-- start release-specific documentation -->
3890:             * <div class="ReleaseSpecificDocumentation">
3891:             * <h3>HSQLDB-Specific Information:</h3> <p>
3892:             *
3893:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3894:             *
3895:             * This method always throws an SQLException stating that
3896:             * the operation is not supported.
3897:             * </div>
3898:             * <!-- end release-specific documentation -->
3899:             *
3900:             * @exception SQLException if a database access error
3901:             *       occurs or if this method is called when the cursor is
3902:             *       on the insert row
3903:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3904:             *   jdbcResultSet)
3905:             */
3906:            public void cancelRowUpdates() throws SQLException {
3907:                throw Util.notSupported();
3908:            }
3909:
3910:            /**
3911:             * <!-- start generic documentation -->
3912:             * Moves the cursor to the insert row.  The current cursor position is
3913:             * remembered while the cursor is positioned on the insert row.
3914:             *
3915:             * The insert row is a special row associated with an updatable
3916:             * result set.  It is essentially a buffer where a new row may
3917:             * be constructed by calling the updater methods prior to
3918:             * inserting the row into the result set.
3919:             *
3920:             * Only the updater, getter,
3921:             * and <code>insertRow</code> methods may be
3922:             * called when the cursor is on the insert row.  All of the columns in
3923:             * a result set must be given a value each time this method is
3924:             * called before calling <code>insertRow</code>.
3925:             * An updater method must be called before a
3926:             * getter method can be called on a column value. <p>
3927:             * <!-- end generic documentation -->
3928:             *
3929:             * <!-- start release-specific documentation -->
3930:             * <div class="ReleaseSpecificDocumentation">
3931:             * <h3>HSQLDB-Specific Information:</h3> <p>
3932:             *
3933:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3934:             *
3935:             * This method always throws an SQLException stating that
3936:             * the operation is not supported.
3937:             * </div>
3938:             * <!-- end release-specific documentation -->
3939:             *
3940:             * @exception SQLException if a database access error occurs
3941:             * or the result set is not updatable
3942:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3943:             *   jdbcResultSet)
3944:             */
3945:            public void moveToInsertRow() throws SQLException {
3946:                throw Util.notSupported();
3947:            }
3948:
3949:            /**
3950:             * <!-- start generic documentation -->
3951:             * Moves the cursor to the remembered cursor position, usually the
3952:             * current row.  This method has no effect if the cursor is not on
3953:             * the insert row. <p>
3954:             * <!-- end generic documentation -->
3955:             *
3956:             * <!-- start release-specific documentation -->
3957:             * <div class="ReleaseSpecificDocumentation">
3958:             * <h3>HSQLDB-Specific Information:</h3> <p>
3959:             *
3960:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3961:             *
3962:             * This method is ignored.
3963:             * </div>
3964:             * <!-- end release-specific documentation -->
3965:             * @exception SQLException if a database access error occurs
3966:             * or the result set is not updatable
3967:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3968:             *  jdbcResultSet)
3969:             */
3970:            public void moveToCurrentRow() throws SQLException {
3971:            }
3972:
3973:            /**
3974:             * <!-- start generic documentation -->
3975:             * Retrieves the <code>Statement</code> object that produced this
3976:             * <code>ResultSet</code> object.
3977:             * If the result set was generated some other way, such as by a
3978:             * <code>DatabaseMetaData</code> method, this method returns
3979:             * <code>null</code>. <p>
3980:             * <!-- end generic documentation -->
3981:             *
3982:             * @return the <code>Statment</code> object that produced
3983:             * this <code>ResultSet</code> object or <code>null</code>
3984:             * if the result set was produced some other way
3985:             * @exception SQLException if a database access error occurs
3986:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3987:             *    jdbcResultSet)
3988:             */
3989:            public Statement getStatement() throws SQLException {
3990:                return (Statement) sqlStatement;
3991:            }
3992:
3993:            /**
3994:             * <!-- start generic documentation -->
3995:             * Retrieves the value of the designated column in the current row
3996:             * of this <code>ResultSet</code> object as an <code>Object</code>
3997:             * in the Java programming language.
3998:             * If the value is an SQL <code>NULL</code>,
3999:             * the driver returns a Java <code>null</code>.
4000:             * This method uses the given <code>Map</code> object
4001:             * for the custom mapping of the
4002:             * SQL structured or distinct type that is being retrieved. <p>
4003:             * <!-- end generic documentation -->
4004:             *
4005:             * <!-- start release-specific documentation -->
4006:             * <div class="ReleaseSpecificDocumentation">
4007:             * <h3>HSQLDB-Specific Information:</h3> <p>
4008:             *
4009:             * Including 1.7.2, HSQLDB does not support this feature.  <p>
4010:             *
4011:             * This method always throws an <code>SQLException</code>,
4012:             * stating that the operation is not supported.
4013:             * </div>
4014:             * <!-- end release-specific documentation -->
4015:             *
4016:             * @param i the first column is 1, the second is 2, ...
4017:             * @param map a <code>java.util.Map</code> object that contains the
4018:             *  mapping from SQL type names to classes in the Java programming
4019:             *  language
4020:             * @return an <code>Object</code> in the Java programming language
4021:             * representing the SQL value
4022:             * @exception SQLException if a database access error occurs
4023:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4024:             * jdbcResultSet)
4025:             */
4026:            public Object getObject(int i, Map map) throws SQLException {
4027:                throw Util.notSupported();
4028:            }
4029:
4030:            /**
4031:             * <!-- start generic documentation -->
4032:             * Retrieves the value of the designated column in the current row
4033:             * of this <code>ResultSet</code> object as a <code>Ref</code> object
4034:             * in the Java programming language. <p>
4035:             * <!-- end generic documentation -->
4036:             *
4037:             * <!-- start release-specific documentation -->
4038:             * <div class="ReleaseSpecificDocumentation">
4039:             * <h3>HSQLDB-Specific Information:</h3> <p>
4040:             *
4041:             * Including 1.7.2, HSQLDB does not support this feature.  <p>
4042:             *
4043:             * This method always throws an <code>SQLException</code>
4044:             * stating that the operation is not supported.
4045:             * </div>
4046:             * <!-- end release-specific documentation -->
4047:             *
4048:             * @param i the first column is 1, the second is 2, ...
4049:             * @return a <code>Ref</code> object representing an SQL <code>REF</code>
4050:             *  value
4051:             * @exception SQLException if a database access error occurs
4052:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4053:             * jdbcResultSet)
4054:             */
4055:            public Ref getRef(int i) throws SQLException {
4056:                throw Util.notSupported();
4057:            }
4058:
4059:            /**
4060:             * <!-- start generic documentation -->
4061:             * Retrieves the value of the designated column in the current row
4062:             * of this <code>ResultSet</code> object as a <code>Blob</code> object
4063:             * in the Java programming language. <p>
4064:             * <!-- end generic documentation -->
4065:             *
4066:             * <!-- start release-specific documentation -->
4067:             * <div class="ReleaseSpecificDocumentation">
4068:             * <h3>HSQLDB-Specific Information:</h3> <p>
4069:             *
4070:             * Starting with 1.7.2, this feature is supported.
4071:             * </div>
4072:             * <!-- end release-specific documentation -->
4073:             *
4074:             * @param i the first column is 1, the second is 2, ...
4075:             * @return a <code>Blob</code> object representing the SQL
4076:             *  <code>BLOB</code> value in the specified column
4077:             * @exception SQLException if a database access error occurs
4078:             * @since JDK 1.2
4079:             */
4080:
4081:            //#ifdef JAVA2
4082:            public Blob getBlob(int i) throws SQLException {
4083:
4084:                byte[] b = getBytes(i);
4085:
4086:                return b == null ? null : new jdbcBlob(b);
4087:            }
4088:
4089:            //#endif JAVA2
4090:
4091:            /**
4092:             * <!-- start generic documentation -->
4093:             * Retrieves the value of the designated column in the current row
4094:             * of this <code>ResultSet</code> object as a <code>Clob</code> object
4095:             * in the Java programming language. <p>
4096:             * <!-- end generic documentation -->
4097:             *
4098:             * <!-- start release-specific documentation -->
4099:             * <div class="ReleaseSpecificDocumentation">
4100:             * <h3>HSQLDB-Specific Information:</h3> <p>
4101:             *
4102:             * Starting with 1.7.2, this feature is supported. <p>
4103:             * </div>
4104:             * <!-- end release-specific documentation -->
4105:             *
4106:             * @param i the first column is 1, the second is 2, ...
4107:             * @return a <code>Clob</code> object representing the SQL
4108:             *   <code>CLOB</code> value in the specified column
4109:             * @exception SQLException if a database access error occurs
4110:             * @since JDK 1.2
4111:             */
4112:            //#ifdef JAVA2
4113:            public Clob getClob(int i) throws SQLException {
4114:
4115:                String s = getString(i);
4116:
4117:                return s == null ? null : new jdbcClob(s);
4118:            }
4119:
4120:            //#endif JAVA2
4121:
4122:            /**
4123:             * <!-- start generic documentation -->
4124:             * Retrieves the value of the designated column in the current row
4125:             * of this <code>ResultSet</code> object as an <code>Array</code> object
4126:             * in the Java programming language. <p>
4127:             * <!-- end generic documentation -->
4128:             *
4129:             * <!-- start release-specific documentation -->
4130:             * <div class="ReleaseSpecificDocumentation">
4131:             * <h3>HSQLDB-Specific Information:</h3> <p>
4132:             *
4133:             * Including 1.7.2, HSQLDB does not support this feature.  <p>
4134:             *
4135:             * This method always throws an <code>SQLException</code>
4136:             * stating that the operation is not supported.
4137:             * </div>
4138:             * <!-- end release-specific documentation -->
4139:             *
4140:             * @param i the first column is 1, the second is 2, ...
4141:             * @return an <code>Array</code> object representing the SQL
4142:             *   <code>ARRAY</code> value in the specified column
4143:             * @exception SQLException if a database access error occurs
4144:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4145:             *  jdbcResultSet)
4146:             */
4147:            public Array getArray(int i) throws SQLException {
4148:                throw Util.notSupported();
4149:            }
4150:
4151:            /**
4152:             * <!-- start generic documentation -->
4153:             * Retrieves the value of the designated column in the current row
4154:             * of this <code>ResultSet</code> object as an <code>Object</code>
4155:             * in the Java programming language.
4156:             * If the value is an SQL <code>NULL</code>,
4157:             * the driver returns a Java <code>null</code>.
4158:             * This method uses the specified <code>Map</code> object for
4159:             * custom mapping if appropriate. <p>
4160:             * <!-- end generic documentation -->
4161:             *
4162:             * <!-- start release-specific documentation -->
4163:             * <div class="ReleaseSpecificDocumentation">
4164:             * <h3>HSQLDB-Specific Information:</h3> <p>
4165:             *
4166:             * Including 1.7.2, HSQLDB does not support this feature.  <p>
4167:             *
4168:             * This method always throws an <code>SQLException</code>
4169:             * stating that the operation is not supported.
4170:             * </div>
4171:             * <!-- end release-specific documentation -->
4172:             *
4173:             * @param colName the name of the column from which to retrieve the value
4174:             * @param map a <code>java.util.Map</code> object that contains the
4175:             *   mapping from SQL type names to classes in the Java programming
4176:             *   language
4177:             * @return an <code>Object</code> representing the SQL value in the
4178:             *   specified column
4179:             * @exception SQLException if a database access error occurs
4180:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4181:             *  jdbcResultSet)
4182:             */
4183:            public Object getObject(String colName, Map map)
4184:                    throws SQLException {
4185:
4186:                // MODIFIED:
4187:                // made this consistent with all other
4188:                // column name oriented methods
4189:                // boucherb@users 2002013
4190:                return getObject(findColumn(colName), map);
4191:            }
4192:
4193:            /**
4194:             * <!-- start generic documentation -->
4195:             * Retrieves the value of the designated column in the current row
4196:             * of this <code>ResultSet</code> object as a <code>Ref</code> object
4197:             * in the Java programming language. <p>
4198:             * <!-- end generic documentation -->
4199:             *
4200:             * <!-- start release-specific documentation -->
4201:             * <div class="ReleaseSpecificDocumentation">
4202:             * <h3>HSQLDB-Specific Information:</h3> <p>
4203:             *
4204:             * Including 1.7.2, HSQLDB does not support this feature.  <p>
4205:             *
4206:             * This method always throws an <code>SQLException</code>,
4207:             * stating that the operartion is not supported.
4208:             * </div>
4209:             * <!-- end release-specific documentation -->
4210:             * @param colName the column name
4211:             * @return a <code>Ref</code> object representing the SQL <code>REF</code>
4212:             *   value in the specified column
4213:             * @exception SQLException if a database access error occurs
4214:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4215:             *  jdbcResultSet)
4216:             */
4217:            public Ref getRef(String colName) throws SQLException {
4218:                return getRef(findColumn(colName));
4219:            }
4220:
4221:            /**
4222:             * <!-- start generic documentation -->
4223:             * Retrieves the value of the designated column in the current row
4224:             * of this <code>ResultSet</code> object as a <code>Blob</code> object
4225:             * in the Java programming language. <p>
4226:             * <!-- end generic documentation -->
4227:             *
4228:             * <!-- start release-specific documentation -->
4229:             * <div class="ReleaseSpecificDocumentation">
4230:             * <h3>HSQLDB-Specific Information:</h3> <p>
4231:             *
4232:             * Starting with 1.7.2, this feature is supported.
4233:             * </div>
4234:             * <!-- end release-specific documentation -->
4235:             *
4236:             * @param colName the name of the column from which to retrieve the value
4237:             * @return a <code>Blob</code> object representing the
4238:             *   SQL <code>BLOB</code> value in the specified column
4239:             * @exception SQLException if a database access error occurs
4240:             * @since JDK 1.2
4241:             */
4242:
4243:            //#ifdef JAVA2
4244:            public Blob getBlob(String colName) throws SQLException {
4245:                return getBlob(findColumn(colName));
4246:            }
4247:
4248:            //#endif JAVA2
4249:
4250:            /**
4251:             * <!-- start generic documentation -->
4252:             * Retrieves the value of the designated column in the current row
4253:             * of this <code>ResultSet</code> object as a <code>Clob</code> object
4254:             * in the Java programming language. <p>
4255:             * <!-- end generic documentation -->
4256:             *
4257:             * <!-- start release-specific documentation -->
4258:             * <div class="ReleaseSpecificDocumentation">
4259:             * <h3>HSQLDB-Specific Information:</h3> <p>
4260:             *
4261:             * Starting with 1.7.2, this feature is supported.
4262:             * </div>
4263:             * <!-- end release-specific documentation -->
4264:             *
4265:             * @param colName the name of the column from which to retrieve the value
4266:             * @return a <code>Clob</code> object representing the SQL
4267:             *   <code>CLOB</code> value in the specified column
4268:             * @exception SQLException if a database access error occurs
4269:             * @since JDK 1.2
4270:             */
4271:            //#ifdef JAVA2
4272:            public Clob getClob(String colName) throws SQLException {
4273:                return getClob(findColumn(colName));
4274:            }
4275:
4276:            //#endif JAVA2
4277:
4278:            /**
4279:             * <!-- start generic documentation -->
4280:             * Retrieves the value of the designated column in the current row
4281:             * of this <code>ResultSet</code> object as an <code>Array</code> object
4282:             * in the Java programming language. <p>
4283:             * <!-- end generic documentation -->
4284:             *
4285:             * <!-- start release-specific documentation -->
4286:             * <div class="ReleaseSpecificDocumentation">
4287:             * <h3>HSQLDB-Specific Information:</h3> <p>
4288:             *
4289:             * Including 1.7.2, HSQLDB does not support this feature.  <p>
4290:             *
4291:             * This method always throws an <code>SQLException</code>
4292:             * stating that the operation is not supported.
4293:             * </div>
4294:             * <!-- end release-specific documentation -->
4295:             *
4296:             * @param colName the name of the column from which to retrieve the value
4297:             * @return an <code>Array</code> object representing the SQL
4298:             *   <code>ARRAY</code> value in the specified column
4299:             * @exception SQLException if a database access error occurs
4300:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4301:             *  jdbcResultSet)
4302:             */
4303:            public Array getArray(String colName) throws SQLException {
4304:                return getArray(findColumn(colName));
4305:            }
4306:
4307:            /**
4308:             * <!-- start generic documentation -->
4309:             * Retrieves the value of the designated column in the current row
4310:             * of this <code>ResultSet</code> object as a
4311:             * <code>java.sql.Date</code> object
4312:             * in the Java programming language.
4313:             * This method uses the given calendar to construct an appropriate
4314:             * millisecond value for the date if the underlying database does
4315:             * not store timezone information. <p>
4316:             * <!-- end generic documentation -->
4317:             *
4318:             * @param columnIndex the first column is 1, the second is 2, ...
4319:             * @param cal the <code>java.util.Calendar</code> object
4320:             * to use in constructing the date
4321:             * @return the column value as a <code>java.sql.Date</code> object;
4322:             * if the value is SQL <code>NULL</code>, the value returned is
4323:             * <code>null</code> in the Java programming language
4324:             * @exception SQLException if a database access error occurs
4325:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4326:             *  jdbcResultSet)
4327:             */
4328:            public Date getDate(int columnIndex, Calendar cal)
4329:                    throws SQLException {
4330:
4331:                Date date = getDate(columnIndex);
4332:
4333:                if (date == null) {
4334:                    return null;
4335:                }
4336:
4337:                if (cal == null) {
4338:                    return date;
4339:                }
4340:
4341:                cal.setTime(date);
4342:                HsqlDateTime.resetToDate(cal);
4343:
4344:                return new Date(cal.getTime().getTime());
4345:            }
4346:
4347:            /**
4348:             * <!-- start generic documentation -->
4349:             * Retrieves the value of the designated column in the current row
4350:             * of this <code>ResultSet</code> object as a <code>java.sql.Date</code>
4351:             * object in the Java programming language.
4352:             * This method uses the given calendar to construct an appropriate
4353:             * millisecond
4354:             * value for the date if the underlying database does not store
4355:             * timezone information. <p>
4356:             * <!-- end generic documentation -->
4357:             *
4358:             * @param columnName the SQL name of the column from which to retrieve the
4359:             *   value
4360:             * @param cal the <code>java.util.Calendar</code> object
4361:             *   to use in constructing the date
4362:             * @return the column value as a <code>java.sql.Date</code> object;
4363:             *   if the value is SQL <code>NULL</code>,
4364:             *   the value returned is <code>null</code> in the Java programming
4365:             *   language
4366:             * @exception SQLException if a database access error occurs
4367:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4368:             *  jdbcResultSet)
4369:             */
4370:            public Date getDate(String columnName, Calendar cal)
4371:                    throws SQLException {
4372:                return getDate(findColumn(columnName), cal);
4373:            }
4374:
4375:            /**
4376:             * <!-- start generic documentation -->
4377:             * Retrieves the value of the designated column in the current row
4378:             * of this <code>ResultSet</code> object as a <code>java.sql.Time</code>
4379:             * object in the Java programming language.
4380:             * This method uses the given calendar to construct an appropriate
4381:             * millisecond value for the time if the underlying database does not
4382:             * store timezone information. <p>
4383:             * <!-- end generic documentation -->
4384:             *
4385:             * @param columnIndex the first column is 1, the second is 2, ...
4386:             * @param cal the <code>java.util.Calendar</code> object
4387:             *   to use in constructing the time
4388:             * @return the column value as a <code>java.sql.Time</code> object;
4389:             *   if the value is SQL <code>NULL</code>,
4390:             *   the value returned is <code>null</code> in the Java programming
4391:             *   language
4392:             * @exception SQLException if a database access error occurs
4393:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4394:             *   jdbcResultSet)
4395:             */
4396:            public Time getTime(int columnIndex, Calendar cal)
4397:                    throws SQLException {
4398:
4399:                Time t = getTime(columnIndex);
4400:
4401:                if (t == null) {
4402:                    return null;
4403:                }
4404:
4405:                if (cal == null) {
4406:                    return t;
4407:                }
4408:
4409:                cal.setTime(t);
4410:                HsqlDateTime.resetToTime(cal);
4411:
4412:                return new Time(cal.getTime().getTime());
4413:            }
4414:
4415:            /**
4416:             * <!-- start generic documentation -->
4417:             * Retrieves the value of the designated column in the current row
4418:             * of this <code>ResultSet</code> object as
4419:             * a <code>java.sql.Time</code> object
4420:             * in the Java programming language.
4421:             * This method uses the given calendar to construct an appropriate
4422:             * millisecond
4423:             * value for the time if the underlying database does not store
4424:             * timezone information. <p>
4425:             * <!-- end generic documentation -->
4426:             *
4427:             * @param columnName the SQL name of the column
4428:             * @param cal the <code>java.util.Calendar</code> object
4429:             *   to use in constructing the time
4430:             * @return the column value as a <code>java.sql.Time</code> object;
4431:             *   if the value is SQL <code>NULL</code>,
4432:             * the value returned is <code>null</code> in the Java programming
4433:             *   language
4434:             * @exception SQLException if a database access error occurs
4435:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4436:             *  jdbcResultSet)
4437:             */
4438:            public Time getTime(String columnName, Calendar cal)
4439:                    throws SQLException {
4440:                return getTime(findColumn(columnName), cal);
4441:            }
4442:
4443:            /**
4444:             * <!-- start generic documentation -->
4445:             * Retrieves the value of the designated column in the current row
4446:             * of this <code>ResultSet</code> object as a
4447:             * <code>java.sql.Timestamp</code> object in the Java programming
4448:             * anguage.
4449:             * This method uses the given calendar to construct an appropriate
4450:             * millisecond value for the timestamp if the underlying database does
4451:             * not store timezone information. <p>
4452:             * <!-- end generic documentation -->
4453:             *
4454:             * @param columnIndex the first column is 1, the second is 2, ...
4455:             * @param cal the <code>java.util.Calendar</code> object
4456:             * to use in constructing the timestamp
4457:             * @return the column value as a <code>java.sql.Timestamp</code> object;
4458:             *   if the value is SQL <code>NULL</code>,
4459:             *   the value returned is <code>null</code> in the Java programming
4460:             *   language
4461:             * @exception SQLException if a database access error occurs
4462:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4463:             *  jdbcResultSet)
4464:             */
4465:            public Timestamp getTimestamp(int columnIndex, Calendar cal)
4466:                    throws SQLException {
4467:
4468:                Timestamp ts = getTimestamp(columnIndex);
4469:
4470:                if (cal != null && ts != null) {
4471:                    ts.setTime(HsqlDateTime.getTimeInMillis(ts, null, cal));
4472:                }
4473:
4474:                return ts;
4475:            }
4476:
4477:            /**
4478:             * <!-- start generic documentation -->
4479:             * Retrieves the value of the designated column in the current row
4480:             * of this <code>ResultSet</code> object as a
4481:             * <code>java.sql.Timestamp</code> object in the Java programming
4482:             * language.
4483:             * This method uses the given calendar to construct an appropriate
4484:             * millisecond value for the timestamp if the underlying database does
4485:             * not store timezone information. <p>
4486:             * <!-- end generic documentation -->
4487:             *
4488:             * @param columnName the SQL name of the column
4489:             * @param cal the <code>java.util.Calendar</code> object
4490:             *   to use in constructing the date
4491:             * @return the column value as a <code>java.sql.Timestamp</code> object;
4492:             *   if the value is SQL <code>NULL</code>,
4493:             *   the value returned is <code>null</code> in the Java programming
4494:             *   language
4495:             * @exception SQLException if a database access error occurs
4496:             * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4497:             *  jdbcResultSet)
4498:             */
4499:            public Timestamp getTimestamp(String columnName, Calendar cal)
4500:                    throws SQLException {
4501:                return getTimestamp(findColumn(columnName), cal);
4502:            }
4503:
4504:            //-------------------------- JDBC 3.0 ----------------------------------------
4505:
4506:            /**
4507:             * <!-- start generic documentation -->
4508:             * Retrieves the value of the designated column in the current row
4509:             * of this <code>ResultSet</code> object as a <code>java.net.URL</code>
4510:             * object in the Java programming language. <p>
4511:             * <!-- end generic documentation -->
4512:             *
4513:             * <!-- start release-specific documentation -->
4514:             * <div class="ReleaseSpecificDocumentation">
4515:             * <h3>HSQLDB-Specific Information:</h3> <p>
4516:             *
4517:             * Including 1.7.2, HSQLDB does not support this feature. <p>
4518:             *
4519:             * This method always throws an <code>SQLException</code>
4520:             * stating that the operation is not supported.
4521:             * </div>
4522:             * <!-- end release-specific documentation -->
4523:             *
4524:             * @param columnIndex the index of the column 1 is the first, 2
4525:             *    is the second,...
4526:             * @return the column value as a <code>java.net.URL</code> object;
4527:             *    if the value is SQL <code>NULL</code>, the value returned
4528:             *    is <code>null</code> in the Java programming language
4529:             * @exception SQLException if a database access error occurs,
4530:             *    or if a URL is malformed
4531:             * @since JDK 1.4, HSQLDB 1.7.0
4532:             */
4533:            //#ifdef JDBC3
4534:            public java.net.URL getURL(int columnIndex) throws SQLException {
4535:                throw Util.notSupported();
4536:            }
4537:
4538:            //#endif JDBC3
4539:
4540:            /**
4541:             * <!-- start generic documentation -->
4542:             * Retrieves the value of the designated column in the current row
4543:             * of this <code>ResultSet</code> object as a <code>java.net.URL</code>
4544:             * object in the Java programming language. <p>
4545:             * <!-- end generic documentation -->
4546:             *
4547:             * <!-- start release-specific documentation -->
4548:             * <div class="ReleaseSpecificDocumentation">
4549:             * <h3>HSQLDB-Specific Information:</h3> <p>
4550:             *
4551:             * Including 1.7.2, HSQLDB does not support this feature.  <p>
4552:             *
4553:             * This method always throws an <code>SQLException</code>
4554:             * stating that the operation is not supported.
4555:             * </div>
4556:             * <!-- end release-specific documentation -->
4557:             *
4558:             * @param columnName the SQL name of the column
4559:             * @return the column value as a <code>java.net.URL</code> object;
4560:             * if the value is SQL <code>NULL</code>, the value returned
4561:             * is <code>null</code> in the Java programming language
4562:             * @exception SQLException if a database access error occurs
4563:             *       or if a URL is malformed
4564:             * @since JDK 1.4, HSQLDB 1.7.0
4565:             */
4566:            //#ifdef JDBC3
4567:            public java.net.URL getURL(String columnName) throws SQLException {
4568:                throw Util.notSupported();
4569:            }
4570:
4571:            //#endif JDBC3
4572:
4573:            /**
4574:             * <!-- start generic documentation -->
4575:             * Updates the designated column with a <code>java.sql.Ref</code> value.
4576:             * The updater methods are used to update column values in the
4577:             * current row or the insert row.  The updater methods do not
4578:             * update the underlying database; instead the <code>updateRow</code> or
4579:             * <code>insertRow</code> methods are called to update the database. <p>
4580:             * <!-- end generic documentation -->
4581:             *
4582:             * <!-- start release-specific documentation -->
4583:             * <div class="ReleaseSpecificDocumentation">
4584:             * <h3>HSQLDB-Specific Information:</h3> <p>
4585:             *
4586:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
4587:             *
4588:             * This method always throws an SQLException, stating that
4589:             * the operation is not supported.
4590:             * </div>
4591:             * <!-- end release-specific documentation -->
4592:             *
4593:             * @param columnIndex the first column is 1, the second is 2, ...
4594:             * @param x the new column value
4595:             * @exception SQLException if a database access error occurs
4596:             * @since JDK 1.4, HSQLDB 1.7.0
4597:             */
4598:            //#ifdef JDBC3
4599:            public void updateRef(int columnIndex, java.sql.Ref x)
4600:                    throws SQLException {
4601:                throw Util.notSupported();
4602:            }
4603:
4604:            //#endif JDBC3
4605:
4606:            /**
4607:             * <!-- start generic documentation -->
4608:             * Updates the designated column with a <code>java.sql.Ref</code> value.
4609:             * The updater methods are used to update column values in the
4610:             * current row or the insert row.  The updater methods do not
4611:             * update the underlying database; instead the <code>updateRow</code> or
4612:             * <code>insertRow</code> methods are called to update the database. <p>
4613:             * <!-- end generic documentation -->
4614:             *
4615:             * <!-- start release-specific documentation -->
4616:             * <div class="ReleaseSpecificDocumentation">
4617:             * <h3>HSQLDB-Specific Information:</h3> <p>
4618:             *
4619:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
4620:             *
4621:             * This method always throws an SQLException, stating that
4622:             * the operation is not supported.
4623:             * </div>
4624:             * <!-- end release-specific documentation -->
4625:             *
4626:             * @param columnName the name of the column
4627:             * @param x the new column value
4628:             * @exception SQLException if a database access error occurs
4629:             * @since JDK 1.4, HSQLDB 1.7.0
4630:             */
4631:            //#ifdef JDBC3
4632:            public void updateRef(String columnName, java.sql.Ref x)
4633:                    throws SQLException {
4634:                throw Util.notSupported();
4635:            }
4636:
4637:            //#endif JDBC3
4638:
4639:            /**
4640:             * <!-- start generic documentation -->
4641:             * Updates the designated column with a <code>java.sql.Blob</code> value.
4642:             * The updater methods are used to update column values in the
4643:             * current row or the insert row.  The updater methods do not
4644:             * update the underlying database; instead the <code>updateRow</code> or
4645:             * <code>insertRow</code> methods are called to update the database. <p>
4646:             * <!-- end generic documentation -->
4647:             *
4648:             * <!-- start release-specific documentation -->
4649:             * <div class="ReleaseSpecificDocumentation">
4650:             * <h3>HSQLDB-Specific Information:</h3> <p>
4651:             *
4652:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
4653:             *
4654:             * This method always throws an SQLException, stating that
4655:             * the operation is not supported.
4656:             * </div>
4657:             * <!-- end release-specific documentation -->
4658:             *
4659:             * @param columnIndex the first column is 1, the second is 2, ...
4660:             * @param x the new column value
4661:             * @exception SQLException if a database access error occurs
4662:             * @since JDK 1.4, HSQLDB 1.7.0
4663:             */
4664:            //#ifdef JDBC3
4665:            public void updateBlob(int columnIndex, java.sql.Blob x)
4666:                    throws SQLException {
4667:                throw Util.notSupported();
4668:            }
4669:
4670:            //#endif JDBC3
4671:
4672:            /**
4673:             * <!-- start generic documentation -->
4674:             * Updates the designated column with a <code>java.sql.Blob</code> value.
4675:             * The updater methods are used to update column values in the
4676:             * current row or the insert row.  The updater methods do not
4677:             * update the underlying database; instead the <code>updateRow</code> or
4678:             * <code>insertRow</code> methods are called to update the database. <p>
4679:             * <!-- end generic documentation -->
4680:             *
4681:             * <!-- start release-specific documentation -->
4682:             * <div class="ReleaseSpecificDocumentation">
4683:             * <h3>HSQLDB-Specific Information:</h3> <p>
4684:             *
4685:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
4686:             *
4687:             * This method always throws an SQLException, stating that
4688:             * the operation is not supported.
4689:             * </div>
4690:             * <!-- end release-specific documentation -->
4691:             *
4692:             * @param columnName the name of the column
4693:             * @param x the new column value
4694:             * @exception SQLException if a database access error occurs
4695:             * @since JDK 1.4, HSQLDB 1.7.0
4696:             */
4697:            //#ifdef JDBC3
4698:            public void updateBlob(String columnName, java.sql.Blob x)
4699:                    throws SQLException {
4700:                throw Util.notSupported();
4701:            }
4702:
4703:            //#endif JDBC3
4704:
4705:            /**
4706:             * <!-- start generic documentation -->
4707:             * Updates the designated column with a <code>java.sql.Clob</code> value.
4708:             * The updater methods are used to update column values in the
4709:             * current row or the insert row.  The updater methods do not
4710:             * update the underlying database; instead the <code>updateRow</code> or
4711:             * <code>insertRow</code> methods are called to update the database. <p>
4712:             * <!-- end generic documentation -->
4713:             *
4714:             * <!-- start release-specific documentation -->
4715:             * <div class="ReleaseSpecificDocumentation">
4716:             * <h3>HSQLDB-Specific Information:</h3> <p>
4717:             *
4718:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
4719:             *
4720:             * This method always throws an SQLException, stating that
4721:             * the operation is not supported.
4722:             * </div>
4723:             * <!-- end release-specific documentation -->
4724:             *
4725:             * @param columnIndex the first column is 1, the second is 2, ...
4726:             * @param x the new column value
4727:             * @exception SQLException if a database access error occurs
4728:             * @since JDK 1.4, HSQLDB 1.7.0
4729:             */
4730:            //#ifdef JDBC3
4731:            public void updateClob(int columnIndex, java.sql.Clob x)
4732:                    throws SQLException {
4733:                throw Util.notSupported();
4734:            }
4735:
4736:            //#endif JDBC3
4737:
4738:            /**
4739:             * <!-- start generic documentation -->
4740:             * Updates the designated column with a <code>java.sql.Clob</code> value.
4741:             * The updater methods are used to update column values in the
4742:             * current row or the insert row.  The updater methods do not
4743:             * update the underlying database; instead the <code>updateRow</code> or
4744:             * <code>insertRow</code> methods are called to update the database. <p>
4745:             * <!-- end generic documentation -->
4746:             *
4747:             * <!-- start release-specific documentation -->
4748:             * <div class="ReleaseSpecificDocumentation">
4749:             * <h3>HSQLDB-Specific Information:</h3> <p>
4750:             *
4751:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
4752:             *
4753:             * This method always throws an SQLException, stating that
4754:             * the operation is not supported.
4755:             * </div>
4756:             * <!-- end release-specific documentation -->
4757:             *
4758:             * @param columnName the name of the column
4759:             * @param x the new column value
4760:             * @exception SQLException if a database access error occurs
4761:             * @since JDK 1.4, HSQLDB 1.7.0
4762:             */
4763:            //#ifdef JDBC3
4764:            public void updateClob(String columnName, java.sql.Clob x)
4765:                    throws SQLException {
4766:                throw Util.notSupported();
4767:            }
4768:
4769:            //#endif JDBC3
4770:
4771:            /**
4772:             * <!-- start generic documentation -->
4773:             * Updates the designated column with a <code>java.sql.Array</code> value.
4774:             * The updater methods are used to update column values in the
4775:             * current row or the insert row.  The updater methods do not
4776:             * update the underlying database; instead the <code>updateRow</code> or
4777:             * <code>insertRow</code> methods are called to update the database. <p>
4778:             * <!-- end generic documentation -->
4779:             *
4780:             * <!-- start release-specific documentation -->
4781:             * <div class="ReleaseSpecificDocumentation">
4782:             * <h3>HSQLDB-Specific Information:</h3> <p>
4783:             *
4784:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
4785:             *
4786:             * This method always throws an SQLException stating that
4787:             * the operation is not supported.
4788:             * </div>
4789:             * <!-- end release-specific documentation -->
4790:             *
4791:             * @param columnIndex the first column is 1, the second is 2, ...
4792:             * @param x the new column value
4793:             * @exception SQLException if a database access error occurs
4794:             * @since JDK 1.4, HSQLDB 1.7.0
4795:             */
4796:            //#ifdef JDBC3
4797:            public void updateArray(int columnIndex, java.sql.Array x)
4798:                    throws SQLException {
4799:                throw Util.notSupported();
4800:            }
4801:
4802:            //#endif JDBC3
4803:
4804:            /**
4805:             * <!-- start generic documentation -->
4806:             * Updates the designated column with a <code>java.sql.Array</code> value.
4807:             * The updater methods are used to update column values in the
4808:             * current row or the insert row.  The updater methods do not
4809:             * update the underlying database; instead the <code>updateRow</code> or
4810:             * <code>insertRow</code> methods are called to update the database. <p>
4811:             * <!-- end generic documentation -->
4812:             *
4813:             * <!-- start release-specific documentation -->
4814:             * <div class="ReleaseSpecificDocumentation">
4815:             * <h3>HSQLDB-Specific Information:</h3> <p>
4816:             *
4817:             * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
4818:             *
4819:             * This method always throws an SQLException, stating that
4820:             * the operation is not supported.
4821:             * </div>
4822:             * <!-- end release-specific documentation -->
4823:             *
4824:             * @param columnName the name of the column
4825:             * @param x the new column value
4826:             * @exception SQLException if a database access error occurs
4827:             * @since JDK 1.4, HSQLDB 1.7.0
4828:             */
4829:            //#ifdef JDBC3
4830:            public void updateArray(String columnName, java.sql.Array x)
4831:                    throws SQLException {
4832:                throw Util.notSupported();
4833:            }
4834:
4835:            //#endif JDBC3
4836:            //-------------------- Internal Implementation -------------------------
4837:            // Support for JDBC 2 from JRE 1.1.x
4838:
4839:            /** Copy of java.sql.ResultSet constant, for JDK 1.1 clients. */
4840:            public static final int FETCH_FORWARD = 1000;
4841:
4842:            /** Copy of java.sql.ResultSet constant, for JDK 1.1 clients. */
4843:            public static final int FETCH_REVERSE = 1001;
4844:
4845:            /** Copy of java.sql.ResultSet constant, for JDK 1.1 clients. */
4846:            public static final int FETCH_UNKNOWN = 1002;
4847:
4848:            /** Copy of java.sql.ResultSet constant, for JDK 1.1 clients. */
4849:            public static final int TYPE_FORWARD_ONLY = 1003;
4850:
4851:            /** Copy of java.sql.ResultSet constant, for JDK 1.1 clients. */
4852:            public static final int TYPE_SCROLL_INSENSITIVE = 1004;
4853:
4854:            /** Copy of java.sql.ResultSet constant, for JDK 1.1 clients. */
4855:            public static final int TYPE_SCROLL_SENSITIVE = 1005;
4856:
4857:            /** Copy of java.sql.ResultSet constant, for JDK 1.1 clients. */
4858:            public static final int CONCUR_READ_ONLY = 1007;
4859:
4860:            /** Copy of java.sql.ResultSet constant, for JDK 1.1 clients. */
4861:            public static final int CONCUR_UPDATABLE = 1008;
4862:
4863:            /** Copy of java.sql.ResultSet constant, for JDK 1.1 clients. */
4864:            public static final int HOLD_CURSORS_OVER_COMMIT = 1;
4865:
4866:            /** Copy of java.sql.ResultSet constant, for JDK 1.1 clients. */
4867:            public static final int CLOSE_CURSORS_AT_COMMIT = 2;
4868:
4869:            //---------------------------- Private ---------------------------------
4870:
4871:            /**
4872:             * Internal row data availability check.
4873:             *
4874:             * @throws  SQLException when no row data is available
4875:             */
4876:            private void checkAvailable() throws SQLException {
4877:
4878:                if (rResult == null || !bInit || nCurrent == null) {
4879:                    throw Util.sqlException(Trace.NO_DATA_IS_AVAILABLE);
4880:                }
4881:            }
4882:
4883:            /**
4884:             * Internal closed state check.
4885:             *
4886:             * @throws SQLException when this result set is closed
4887:             */
4888:            private void checkClosed() throws SQLException {
4889:
4890:                if (rResult == null
4891:                        || (sqlStatement != null && sqlStatement.isClosed)) {
4892:                    throw Util.sqlException(Trace.JDBC_RESULTSET_IS_CLOSED);
4893:                }
4894:            }
4895:
4896:            /**
4897:             * Internal column index validity check.
4898:             *
4899:             * @param columnIndex to check
4900:             * @throws SQLException when this ResultSet has no such column
4901:             */
4902:            void checkColumn(int columnIndex) throws SQLException {
4903:
4904:                if (columnIndex < 1 || columnIndex > iColumnCount) {
4905:                    throw Util.sqlException(Trace.COLUMN_NOT_FOUND, String
4906:                            .valueOf(columnIndex));
4907:                }
4908:            }
4909:
4910:            /**
4911:             * Internal wasNull tracker.
4912:             *
4913:             * @param  o the Object to track
4914:             */
4915:            private boolean checkNull(Object o) {
4916:
4917:                if (o == null) {
4918:                    bWasNull = true;
4919:
4920:                    return true;
4921:                } else {
4922:                    bWasNull = false;
4923:
4924:                    return false;
4925:                }
4926:            }
4927:
4928:            /**
4929:             * Internal value converter. <p>
4930:             *
4931:             * All trivially successful getXXX methods eventually go through this
4932:             * method, converting if neccessary from the hsqldb-native representation
4933:             * of a column's value to the requested representation.  <p>
4934:             *
4935:             * @return an Object of the requested type, representing the value of the
4936:             *       specified column
4937:             * @param columnIndex of the column value for which to perform the
4938:             *                 conversion
4939:             * @param type the org.hsqldb.Types code for type
4940:             * @throws SQLException when there is no data, the column index is
4941:             *    invalid, or the conversion cannot be performed
4942:             */
4943:            private Object getColumnInType(int columnIndex, int type)
4944:                    throws SQLException {
4945:
4946:                checkAvailable();
4947:
4948:                int t;
4949:                Object o;
4950:
4951:                try {
4952:                    t = rResult.metaData.colTypes[--columnIndex];
4953:                    o = nCurrent.data[columnIndex];
4954:                } catch (ArrayIndexOutOfBoundsException e) {
4955:                    throw Util.sqlException(Trace.COLUMN_NOT_FOUND, String
4956:                            .valueOf(++columnIndex));
4957:                }
4958:
4959:                if (checkNull(o)) {
4960:                    return null;
4961:                }
4962:
4963:                if (t != type) {
4964:                    if (o instanceof  Binary && type != Types.CHAR) {
4965:                        throw Util.sqlException(Trace.WRONG_DATA_TYPE);
4966:                    }
4967:
4968:                    // try to convert
4969:                    try {
4970:                        o = Column.convertObject(o, type);
4971:                    } catch (Exception e) {
4972:                        String s = "type: " + Types.getTypeString(t) + " (" + t
4973:                                + ") expected: " + Types.getTypeString(type)
4974:                                + " value: " + o.toString();
4975:
4976:                        throw Util.sqlException(Trace.WRONG_DATA_TYPE, s);
4977:                    }
4978:                }
4979:
4980:                // treat datetime stuff
4981:                switch (type) {
4982:
4983:                case Types.DATE:
4984:                    return new Date(((Date) o).getTime());
4985:
4986:                case Types.TIME:
4987:                    return new Time(((Time) o).getTime());
4988:
4989:                case Types.TIMESTAMP:
4990:                    long m = ((Timestamp) o).getTime();
4991:                    int n = ((Timestamp) o).getNanos();
4992:                    Timestamp ts = new Timestamp(m);
4993:
4994:                    ts.setNanos(n);
4995:
4996:                    return ts;
4997:                }
4998:
4999:                return o;
5000:            }
5001:
5002:            //-------------------------- Package Private ---------------------------
5003:
5004:            /**
5005:             * Constructs a new <code>jdbcResultSet</code> object using the specified
5006:             * <code>org.hsqldb.Result</code>. <p>
5007:             *
5008:             * @param s the statement
5009:             * @param r the internal result form that the new
5010:             *      <code>jdbcResultSet</code> represents
5011:             * @param props the connection properties
5012:             * @exception SQLException when the supplied Result is of type
5013:             * org.hsqldb.Result.ERROR
5014:             */
5015:            jdbcResultSet(jdbcStatement s, Result r, HsqlProperties props,
5016:                    boolean isNetConnection) throws SQLException {
5017:
5018:                sqlStatement = s;
5019:                connProperties = props;
5020:                this .isNetConn = isNetConnection;
5021:
5022:                if (r.mode == ResultConstants.UPDATECOUNT) {
5023:                    iUpdateCount = r.getUpdateCount();
5024:                } else if (r.isError()) {
5025:                    Util.throwError(r);
5026:                } else {
5027:                    if (s != null) {
5028:                        this .rsType = s.rsType;
5029:                    }
5030:
5031:                    iUpdateCount = -1;
5032:                    rResult = r;
5033:                    iColumnCount = r.getColumnCount();
5034:                }
5035:
5036:                bWasNull = false;
5037:            }
5038:
5039:            /**
5040:             * If executing the statement updated rows on the database, how many were
5041:             * affected?
5042:             *
5043:             * @return the number of rows affected by executing my statement
5044:             */
5045:            int getUpdateCount() {
5046:                return iUpdateCount;
5047:            }
5048:
5049:            /**
5050:             * Does this Result contain actual row data? <p>
5051:             *
5052:             * Not all results have row data.  Some are ERROR results
5053:             * (an execption occured while executing my statement), and
5054:             * some are UPDATE results, in which case updates occured to rows
5055:             * on the database, but no rows were actually returned.
5056:             *
5057:             * @return true if Result has row data, false if not.
5058:             */
5059:            boolean isResult() {
5060:                return rResult == null ? false : true;
5061:            }
5062:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.