0001: /*
0002: * Licensed to the Apache Software Foundation (ASF) under one or more
0003: * contributor license agreements. See the NOTICE file distributed with
0004: * this work for additional information regarding copyright ownership.
0005: * The ASF licenses this file to You under the Apache License, Version 2.0
0006: * (the "License"); you may not use this file except in compliance with
0007: * the License. You may obtain a copy of the License at
0008: *
0009: * http://www.apache.org/licenses/LICENSE-2.0
0010: *
0011: * Unless required by applicable law or agreed to in writing, software
0012: * distributed under the License is distributed on an "AS IS" BASIS,
0013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0014: * See the License for the specific language governing permissions and
0015: * limitations under the License.
0016: */
0017:
0018: package java.sql;
0019:
0020: import java.io.InputStream;
0021: import java.math.BigDecimal;
0022: import java.io.Reader;
0023: import java.util.Calendar;
0024: import java.util.Map;
0025: import java.net.URL;
0026:
0027: /**
0028: * An interface to an Object which represents a Table of Data, typically
0029: * returned as the result of a Query to a Database.
0030: * <p>
0031: * <code>ResultSets</code> have a Cursor which points to a current row of
0032: * data. When a ResultSet is created, the Cursor is positioned before the first
0033: * row. To move the Cursor to the next row in the table, use the
0034: * <code>next</code> method. The next method returns true until there are no
0035: * more rows in the ResultSet, when it returns false.
0036: * <p>
0037: * The default type of ResultSet cannot be updated and its cursor can only move
0038: * forward through the rows of data. This means that it is only possible to read
0039: * through it once. However, it is possible to create types of ResultSet that
0040: * can be updated and also types where the cursor can be scrolled forward and
0041: * backward through the rows of data. This is shown in the following code
0042: * example: <code>
0043: * Connection con;
0044: * Statement aStatement = con.createStatement( ResultSet.TYPE_SCROLL_SENSITIVE,
0045: * ResultSet.CONCUR_UPDATABLE );
0046: * ResultSet theResultSet = theStatement.executeQuery("SELECT price, quantity FROM STOCKTABLE");
0047: * // theResultSet will be both scrollable and updateable
0048: * </code>
0049: * <p>
0050: * The ResultSet interface provides a series of methods for retrieving data from
0051: * columns in the current row, such as getDate, getFloat. The columns are
0052: * identified either by their index number (starting at 1) or by their name -
0053: * there are separate methods for both techniques of column addressing. The
0054: * column names are case insensitive. If several columns have the same name,
0055: * then the getter methods use the first matching column. This means that if
0056: * column names are used, it is not possible to guarantee that the name will
0057: * retrieve data from the intended column - for certainty it is better to use
0058: * column indexes. Ideally the columns should be read left-to-right and read
0059: * once only, since not all * databases are optimized to handle other techniques
0060: * of reading the data.
0061: * <p>
0062: * When reading data, the JDBC driver maps the SQL data retrieved from the
0063: * database to the Java type implied by the method invoked by the application.
0064: * The JDBC specification has a table of allowable mappings from SQL types to
0065: * Java types.
0066: * <p>
0067: * There are also methods for writing data into the ResultSet, such as
0068: * updateInt, updateString. The update methods can be used either to modify the
0069: * data of an existing row or to insert new data rows into the ResultSet.
0070: * Modification of existing data involves moving the Cursor to the row which
0071: * needs modification and then using the update methods to modify the data,
0072: * followed by calling the ResultSet.updateRow method. For insertion of new
0073: * rows, the cursor is first moved to a special row called the Insert Row, data
0074: * is added using the update methods, followed by calling the
0075: * ResultSet.insertRow method.
0076: * <p>
0077: * A ResultSet is closed if the Statement object which generated it closed,
0078: * executed again or is used to retrieve the next result from a sequence of
0079: * results.
0080: *
0081: */
0082: public interface ResultSet {
0083:
0084: /**
0085: * A constant used to indicate that a ResultSet object must be closed when
0086: * the method Connection.commit is invoked.
0087: */
0088: public static final int CLOSE_CURSORS_AT_COMMIT = 2;
0089:
0090: /**
0091: * A constant used to indicate that a ResultSet object must not be closed
0092: * when the method Connection.commit is invoked.
0093: */
0094: public static final int HOLD_CURSORS_OVER_COMMIT = 1;
0095:
0096: /**
0097: * A constant used to indicate the Concurrency Mode for a ResultSet object
0098: * that cannot be updated.
0099: */
0100: public static final int CONCUR_READ_ONLY = 1007;
0101:
0102: /**
0103: * A constant used to indicate the Concurrency Mode for a ResultSet object
0104: * that can be updated.
0105: */
0106: public static final int CONCUR_UPDATABLE = 1008;
0107:
0108: /**
0109: * A constant used to indicate processing of the rows of a ResultSet in the
0110: * forward direction, first to last
0111: */
0112: public static final int FETCH_FORWARD = 1000;
0113:
0114: /**
0115: * A constant used to indicate processing of the rows of a ResultSet in the
0116: * reverse direction, last to first
0117: */
0118: public static final int FETCH_REVERSE = 1001;
0119:
0120: /**
0121: * A constant used to indicate that the order of processing of the rows of a
0122: * ResultSet is unknown.
0123: */
0124: public static final int FETCH_UNKNOWN = 1002;
0125:
0126: /**
0127: * A constant used to indicate a ResultSet object whose Cursor can only move
0128: * forward
0129: */
0130: public static final int TYPE_FORWARD_ONLY = 1003;
0131:
0132: /**
0133: * A constant used to indicate a ResultSet object which is Scrollable but
0134: * which is not sensitive to changes made by others
0135: */
0136: public static final int TYPE_SCROLL_INSENSITIVE = 1004;
0137:
0138: /**
0139: * A constant used to indicate a ResultSet object which is Scrollable but
0140: * which is sensitive to changes made by others
0141: */
0142: public static final int TYPE_SCROLL_SENSITIVE = 1005;
0143:
0144: /**
0145: * Moves the Cursor to a specified row number in the ResultSet.
0146: *
0147: * @param row
0148: * The new row number for the Cursor
0149: * @return true if the new Cursor position is on the ResultSet, false
0150: * otherwise
0151: * @throws SQLException
0152: * if a database error happens
0153: */
0154: public boolean absolute(int row) throws SQLException;
0155:
0156: /**
0157: * Moves the Cursor to the end of the ResultSet, after the last row.
0158: *
0159: * @throws SQLException
0160: * if a database error happens
0161: */
0162: public void afterLast() throws SQLException;
0163:
0164: /**
0165: * Moves the Cursor to the start of the ResultSet, before the first row.
0166: *
0167: * @throws SQLException
0168: * if a database error happens
0169: */
0170: public void beforeFirst() throws SQLException;
0171:
0172: /**
0173: * Cancels any updates made to the current row in the ResultSet.
0174: *
0175: * @throws SQLException
0176: * if a database error happens
0177: */
0178: public void cancelRowUpdates() throws SQLException;
0179:
0180: /**
0181: * Clears all the warnings related to this ResultSet.
0182: *
0183: * @throws SQLException
0184: * if a database error happens
0185: */
0186: public void clearWarnings() throws SQLException;
0187:
0188: /**
0189: * Releases this ResultSet's database and JDBC resources. You are strongly
0190: * advised to use this method rather than relying on the release being done
0191: * when the ResultSet's finalize method is called during garbage collection
0192: * process. Note that the close() method might take some time to complete
0193: * since it is dependent on the behaviour of the connection to the database
0194: * and the database itself.
0195: *
0196: * @throws SQLException
0197: * if a database error happens
0198: */
0199: public void close() throws SQLException;
0200:
0201: /**
0202: * Deletes the current row from the ResultSet and from the underlying
0203: * database.
0204: *
0205: * @throws SQLException
0206: * if a database error happens
0207: */
0208: public void deleteRow() throws SQLException;
0209:
0210: /**
0211: * Gets the index number for a column in the ResultSet from the provided
0212: * Column Name.
0213: *
0214: * @param columnName
0215: * the column name
0216: * @return the index of the column in the ResultSet for the column name
0217: * @throws SQLException
0218: * if a database error happens
0219: */
0220: public int findColumn(String columnName) throws SQLException;
0221:
0222: /**
0223: * Shifts the cursor position to the first row in the ResultSet.
0224: *
0225: * @return true if the position is in a legitimate row, false if the
0226: * ResultSet contains no rows.
0227: * @throws SQLException
0228: * if a database error happens
0229: */
0230: public boolean first() throws SQLException;
0231:
0232: /**
0233: * Gets the content of a column specified as a column index in the current
0234: * row of this ResultSet as a java.sql.Array.
0235: *
0236: * @param columnIndex
0237: * the index of the column to read
0238: * @return a java.sql.Array with the data from the column
0239: * @throws SQLException
0240: * if a database error happens
0241: */
0242: public Array getArray(int columnIndex) throws SQLException;
0243:
0244: /**
0245: * Gets the value of a column specified as a column name as a
0246: * java.sql.Array.
0247: *
0248: * @param colName
0249: * the name of the column to read
0250: * @return a java.sql.Array with the data from the column
0251: * @throws SQLException
0252: * if a database error happens
0253: */
0254: public Array getArray(String colName) throws SQLException;
0255:
0256: /**
0257: * Gets the value of a column specified as a column index as an ASCII
0258: * character stream.
0259: *
0260: * @param columnIndex
0261: * the index of the column to read
0262: * @return an InputStream with the data from the column
0263: * @throws SQLException
0264: * if a database error happens
0265: */
0266: public InputStream getAsciiStream(int columnIndex)
0267: throws SQLException;
0268:
0269: /**
0270: * Gets the value of a column specified as a column name as an ASCII
0271: * character stream.
0272: *
0273: * @param columnName
0274: * the name of the column to read
0275: * @return an InputStream with the data from the column
0276: * @throws SQLException
0277: * if a database error happens
0278: */
0279: public InputStream getAsciiStream(String columnName)
0280: throws SQLException;
0281:
0282: /**
0283: * Gets the value of a column specified as a column index as a
0284: * java.math.BigDecimal.
0285: *
0286: * @param columnIndex
0287: * the index of the column to read
0288: * @return a BigDecimal with the value of the column
0289: * @throws SQLException
0290: * if a database error happens
0291: */
0292: public BigDecimal getBigDecimal(int columnIndex)
0293: throws SQLException;
0294:
0295: /**
0296: * @deprecated Gets the value of a column specified as a column index as a
0297: * java.math.BigDecimal.
0298: * @param columnIndex
0299: * the index of the column to read
0300: * @param scale
0301: * the number of digits after the decimal point
0302: * @return a BigDecimal with the value of the column
0303: * @throws SQLException
0304: * if a database error happens
0305: */
0306: @Deprecated
0307: public BigDecimal getBigDecimal(int columnIndex, int scale)
0308: throws SQLException;
0309:
0310: /**
0311: * Gets the value of a column specified as a column name, as a
0312: * java.math.BigDecimal.
0313: *
0314: * @param columnName
0315: * the name of the column to read
0316: * @return a BigDecimal with the value of the column
0317: * @throws SQLException
0318: * if a database error happens
0319: */
0320: public BigDecimal getBigDecimal(String columnName)
0321: throws SQLException;
0322:
0323: /**
0324: * @deprecated Gets the value of a column specified as a column name, as a
0325: * java.math.BigDecimal.
0326: * @param columnName
0327: * the name of the column to read
0328: * @param scale
0329: * the number of digits after the decimal point
0330: * @return a BigDecimal with the value of the column
0331: * @throws SQLException
0332: * if a database error happens
0333: */
0334: @Deprecated
0335: public BigDecimal getBigDecimal(String columnName, int scale)
0336: throws SQLException;
0337:
0338: /**
0339: * Gets the value of a column specified as a column index as a binary
0340: * stream.
0341: * <p>
0342: * This method can be used to read LONGVARBINARY values. All of the data in
0343: * the InputStream should be read before getting data from any other column.
0344: * A further call to a getter method will implicitly close the InputStream.
0345: *
0346: * @param columnIndex
0347: * the index of the column to read
0348: * @return an InputStream with the data from the column. If the column value
0349: * is SQL NULL, null is returned.
0350: * @throws SQLException
0351: * if a database error happens
0352: */
0353: public InputStream getBinaryStream(int columnIndex)
0354: throws SQLException;
0355:
0356: /**
0357: * Gets the value of a column specified as a column name as a binary stream.
0358: * <p>
0359: * This method can be used to read LONGVARBINARY values. All of the data in
0360: * the InputStream should be read before getting data from any other column.
0361: * A further call to a getter method will implicitly close the InputStream.
0362: *
0363: * @param columnName
0364: * the name of the column to read
0365: * @return an InputStream with the data from the column If the column value
0366: * is SQL NULL, null is returned.
0367: * @throws SQLException
0368: * if a database error happens
0369: */
0370: public InputStream getBinaryStream(String columnName)
0371: throws SQLException;
0372:
0373: /**
0374: * Gets the value of a column specified as a column index as a java.sql.Blob
0375: * object.
0376: *
0377: * @param columnIndex
0378: * the index of the column to read
0379: * @return a java.sql.Blob with the value of the column
0380: * @throws SQLException
0381: * if a database error happens
0382: */
0383: public Blob getBlob(int columnIndex) throws SQLException;
0384:
0385: /**
0386: * Gets the value of a column specified as a column name, as a java.sql.Blob
0387: * object.
0388: *
0389: * @param columnName
0390: * the name of the column to read
0391: * @return a java.sql.Blob with the value of the column
0392: * @throws SQLException
0393: * if a database error happens
0394: */
0395: public Blob getBlob(String columnName) throws SQLException;
0396:
0397: /**
0398: * Gets the value of a column specified as a column index as a boolean.
0399: *
0400: * @param columnIndex
0401: * the index of the column to read
0402: * @return a boolean value from the column. If the column is SQL NULL, false
0403: * is returned.
0404: * @throws SQLException
0405: * if a database error happens
0406: */
0407: public boolean getBoolean(int columnIndex) throws SQLException;
0408:
0409: /**
0410: * Gets the value of a column specified as a column name, as a boolean.
0411: *
0412: * @param columnName
0413: * the name of the column to read
0414: * @return a boolean value from the column. If the column is SQL NULL, false
0415: * is returned.
0416: * @throws SQLException
0417: * if a database error happens
0418: */
0419: public boolean getBoolean(String columnName) throws SQLException;
0420:
0421: /**
0422: * Gets the value of a column specified as a column index as a byte.
0423: *
0424: * @param columnIndex
0425: * the index of the column to read
0426: * @return a byte containing the value of the column. 0 if the value is SQL
0427: * NULL.
0428: * @throws SQLException
0429: * if a database error happens
0430: */
0431: public byte getByte(int columnIndex) throws SQLException;
0432:
0433: /**
0434: * Gets the value of a column specified as a column name as a byte.
0435: *
0436: * @param columnName
0437: * the name of the column to read
0438: * @return a byte containing the value of the column. 0 if the value is SQL
0439: * NULL.
0440: * @throws SQLException
0441: * if a database error happens
0442: */
0443: public byte getByte(String columnName) throws SQLException;
0444:
0445: /**
0446: * Gets the value of a column specified as a column index as a byte array.
0447: *
0448: * @param columnIndex
0449: * the index of the column to read
0450: * @return a byte array containing the value of the column. null if the
0451: * column contains SQL NULL.
0452: * @throws SQLException
0453: * if a database error happens
0454: */
0455: public byte[] getBytes(int columnIndex) throws SQLException;
0456:
0457: /**
0458: * Gets the value of a column specified as a column name as a byte array.
0459: *
0460: * @param columnName
0461: * the name of the column to read
0462: * @return a byte array containing the value of the column. null if the
0463: * column contains SQL NULL.
0464: * @throws SQLException
0465: * if a database error happens
0466: */
0467: public byte[] getBytes(String columnName) throws SQLException;
0468:
0469: /**
0470: * Gets the value of a column specified as a column index as a
0471: * java.io.Reader object.
0472: *
0473: * @param columnIndex
0474: * the index of the column to read
0475: * @return a Reader holding the value of the column. null if the column
0476: * value is SQL NULL.
0477: * @throws SQLException
0478: * if a database error happens
0479: */
0480: public Reader getCharacterStream(int columnIndex)
0481: throws SQLException;
0482:
0483: /**
0484: * Gets the value of a column specified as a column name as a java.io.Reader
0485: * object.
0486: *
0487: * @param columnName
0488: * the name of the column to read
0489: * @return a Reader holding the value of the column. null if the column
0490: * value is SQL NULL.
0491: * @throws SQLException
0492: * if a database error happens
0493: */
0494: public Reader getCharacterStream(String columnName)
0495: throws SQLException;
0496:
0497: /**
0498: * Gets the value of a column specified as a column index as a
0499: * java.sql.Clob.
0500: *
0501: * @param columnIndex
0502: * the index of the column to read
0503: * @return a Clob object representing the value in the column. null if the
0504: * value is SQL NULL.
0505: * @throws SQLException
0506: * if a database error happens
0507: */
0508: public Clob getClob(int columnIndex) throws SQLException;
0509:
0510: /**
0511: * Gets the value of a column specified as a column name as a java.sql.Clob.
0512: *
0513: * @param colName
0514: * the name of the column to read
0515: * @return a Clob object representing the value in the column. null if the
0516: * value is SQL NULL.
0517: * @throws SQLException
0518: * if a database error happens
0519: */
0520: public Clob getClob(String colName) throws SQLException;
0521:
0522: /**
0523: * Gets the concurrency mode of this ResultSet.
0524: *
0525: * @return the concurrency mode - one of: ResultSet.CONCUR_READ_ONLY,
0526: * ResultSet.CONCUR_UPDATABLE
0527: * @throws SQLException
0528: * if a database error happens
0529: */
0530: public int getConcurrency() throws SQLException;
0531:
0532: /**
0533: * Gets the name of the SQL cursor of this ResultSet.
0534: *
0535: * @return a String containing the SQL cursor name
0536: * @throws SQLException
0537: * if a database error happens
0538: */
0539: public String getCursorName() throws SQLException;
0540:
0541: /**
0542: * Gets the value of a column specified as a column index as a
0543: * java.sql.Date.
0544: *
0545: * @param columnIndex
0546: * the index of the column to read
0547: * @return a java.sql.Date matching the column value. null if the column is
0548: * SQL NULL.
0549: * @throws SQLException
0550: * if a database error happens
0551: */
0552: public Date getDate(int columnIndex) throws SQLException;
0553:
0554: /**
0555: * Gets the value of a column specified as a column index as a
0556: * java.sql.Date. This method uses a supplied calendar to compute the Date.
0557: *
0558: * @param columnIndex
0559: * the index of the column to read
0560: * @param cal
0561: * a java.util.Calendar to use in constructing the Date.
0562: * @return a java.sql.Date matching the column value. null if the column is
0563: * SQL NULL.
0564: * @throws SQLException
0565: * if a database error happens
0566: */
0567: public Date getDate(int columnIndex, Calendar cal)
0568: throws SQLException;
0569:
0570: /**
0571: * Gets the value of a column specified as a column name as a java.sql.Date.
0572: *
0573: * @param columnName
0574: * the name of the column to read
0575: * @return a java.sql.Date matching the column value. null if the column is
0576: * SQL NULL.
0577: * @throws SQLException
0578: * if a database error happens
0579: */
0580: public Date getDate(String columnName) throws SQLException;
0581:
0582: /**
0583: * Gets the value of a column specified as a column name, as a java.sql.Date
0584: * object.
0585: *
0586: * @param columnName
0587: * the name of the column to read
0588: * @param cal
0589: * java.util.Calendar to use in constructing the Date.
0590: * @return a java.sql.Date matching the column value. null if the column is
0591: * SQL NULL.
0592: * @throws SQLException
0593: * if a database error happens
0594: */
0595: public Date getDate(String columnName, Calendar cal)
0596: throws SQLException;
0597:
0598: /**
0599: * Gets the value of a column specified as a column index as a double value.
0600: *
0601: * @param columnIndex
0602: * the index of the column to read
0603: * @return a double containing the column value. 0.0 if the column is SQL
0604: * NULL.
0605: * @throws SQLException
0606: * if a database error happens
0607: */
0608: public double getDouble(int columnIndex) throws SQLException;
0609:
0610: /**
0611: * Gets the value of a column specified as a column name as a double value.
0612: *
0613: * @param columnName
0614: * the name of the column to read
0615: * @return a double containing the column value. 0.0 if the column is SQL
0616: * NULL.
0617: * @throws SQLException
0618: * if a database error happens
0619: */
0620: public double getDouble(String columnName) throws SQLException;
0621:
0622: /**
0623: * Gets the direction in which rows are fetched for this ResultSet object.
0624: *
0625: * @return the fetch direction. Will be: ResultSet.FETCH_FORWARD,
0626: * ResultSet.FETCH_REVERSE or ResultSet.FETCH_UNKNOWN
0627: * @throws SQLException
0628: * if a database error happens
0629: */
0630: public int getFetchDirection() throws SQLException;
0631:
0632: /**
0633: * Gets the fetch size (in number of rows) for this ResultSet
0634: *
0635: * @return the fetch size as an int
0636: * @throws SQLException
0637: * if a database error happens
0638: */
0639: public int getFetchSize() throws SQLException;
0640:
0641: /**
0642: * Gets the value of a column specified as a column index as a float value.
0643: *
0644: * @param columnIndex
0645: * the index of the column to read
0646: * @return a float containing the column value. 0.0 if the column is SQL
0647: * NULL.
0648: * @throws SQLException
0649: * if a database error happens
0650: */
0651: public float getFloat(int columnIndex) throws SQLException;
0652:
0653: /**
0654: * Gets the value of a column specified as a column name as a float value.
0655: *
0656: * @param columnName
0657: * the name of the column to read
0658: * @return a float containing the column value. 0.0 if the column is SQL
0659: * NULL.
0660: * @throws SQLException
0661: * if a database error happens
0662: */
0663: public float getFloat(String columnName) throws SQLException;
0664:
0665: /**
0666: * Gets the value of a column specified as a column index as an int value.
0667: *
0668: * @param columnIndex
0669: * the index of the column to read
0670: * @return an int containing the column value. 0 if the column is SQL NULL.
0671: * @throws SQLException
0672: * if a database error happens
0673: */
0674: public int getInt(int columnIndex) throws SQLException;
0675:
0676: /**
0677: * Gets the value of a column specified as a column name, as an int value.
0678: *
0679: * @param columnName
0680: * the name of the column to read
0681: * @return an int containing the column value. 0 if the column is SQL NULL.
0682: * @throws SQLException
0683: * if a database error happens
0684: */
0685: public int getInt(String columnName) throws SQLException;
0686:
0687: /**
0688: * Gets the value of a column specified as a column index as a long value.
0689: *
0690: * @param columnIndex
0691: * the index of the column to read
0692: * @return a long containing the column value. 0 if the column is SQL NULL.
0693: * @throws SQLException
0694: * if a database error happens
0695: */
0696: public long getLong(int columnIndex) throws SQLException;
0697:
0698: /**
0699: * Gets the value of a column specified as a column name, as a long value.
0700: *
0701: * @param columnName
0702: * the name of the column to read
0703: * @return a long containing the column value. 0 if the column is SQL NULL.
0704: * @throws SQLException
0705: * if a database error happens
0706: */
0707: public long getLong(String columnName) throws SQLException;
0708:
0709: /**
0710: * Gets the Metadata for this ResultSet. This defines the number, types and
0711: * properties of the columns in the ResultSet.
0712: *
0713: * @return a ResultSetMetaData object with information about this ResultSet.
0714: * @throws SQLException
0715: * if a database error happens
0716: */
0717: public ResultSetMetaData getMetaData() throws SQLException;
0718:
0719: /**
0720: * Gets the value of a specified column as a Java Object. The type of the
0721: * returned object will be the default according to the column's SQL type,
0722: * following the JDBC specification for built-in types.
0723: * <p>
0724: * For SQL User Defined Types, if a column value is Structured or Distinct,
0725: * this method behaves the same as a call to: getObject(columnIndex,
0726: * this.getStatement().getConnection().getTypeMap())
0727: *
0728: * @param columnIndex
0729: * the index of the column to read
0730: * @return an Object containing the value of the column. null if the column
0731: * value is SQL NULL.
0732: * @throws SQLException
0733: * if a database error happens
0734: */
0735: public Object getObject(int columnIndex) throws SQLException;
0736:
0737: /**
0738: * Gets the value of a column specified as a column index as a Java Object.
0739: * <p>
0740: * The type of the Java object will be determined by the supplied Map to
0741: * perform the mapping of SQL Struct or Distinct types into Java objects.
0742: *
0743: * @param columnIndex
0744: * the index of the column to read
0745: * @param map
0746: * a java.util.Map containing a mapping from SQL Type names to
0747: * Java classes.
0748: * @return an Object containing the value of the column. null if the column
0749: * value is SQL NULL.
0750: * @throws SQLException
0751: * if a database error happens
0752: */
0753: public Object getObject(int columnIndex, Map<String, Class<?>> map)
0754: throws SQLException;
0755:
0756: /**
0757: * Gets the value of a specified column as a Java Object. The type of the
0758: * returned object will be the default according to the column's SQL type,
0759: * following the JDBC specification for built-in types.
0760: * <p>
0761: * For SQL User Defined Types, if a column value is Structured or Distinct,
0762: * this method behaves the same as a call to: getObject(columnIndex,
0763: * this.getStatement().getConnection().getTypeMap())
0764: *
0765: * @param columnName
0766: * the name of the column to read
0767: * @return an Object containing the value of the column. null if the column
0768: * value is SQL NULL.
0769: * @throws SQLException
0770: * if a database error happens
0771: */
0772: public Object getObject(String columnName) throws SQLException;
0773:
0774: /**
0775: * Gets the value of a column specified as a column name as a Java Object.
0776: * <p>
0777: * The type of the Java object will be determined by the supplied Map to
0778: * perform the mapping of SQL Struct or Distinct types into Java objects.
0779: *
0780: * @param columnName
0781: * the name of the column to read
0782: * @param map
0783: * a java.util.Map containing a mapping from SQL Type names to
0784: * Java classes.
0785: * @return an Object containing the value of the column. null if the column
0786: * value is SQL NULL.
0787: * @throws SQLException
0788: * if a database error happens
0789: */
0790: public Object getObject(String columnName, Map<String, Class<?>> map)
0791: throws SQLException;
0792:
0793: /**
0794: * Gets the value of a column specified as a column index as a Java
0795: * java.sql.Ref.
0796: *
0797: * @param columnIndex
0798: * the index of the column to read
0799: * @return a Ref representing the value of the SQL REF in the column
0800: * @throws SQLException
0801: * if a database error happens
0802: */
0803: public Ref getRef(int columnIndex) throws SQLException;
0804:
0805: /**
0806: * Gets the value of a column specified as a column name as a Java
0807: * java.sql.Ref.
0808: *
0809: * @param colName
0810: * the name of the column to read
0811: * @return a Ref representing the value of the SQL REF in the column
0812: * @throws SQLException
0813: * if a database error happens
0814: */
0815: public Ref getRef(String colName) throws SQLException;
0816:
0817: /**
0818: * Gets the number of the current row in the ResultSet. Row numbers start at
0819: * 1 for the first row.
0820: *
0821: * @return the index number of the current row. 0 is returned if there is no
0822: * current row.
0823: * @throws SQLException
0824: * if a database error happens
0825: */
0826: public int getRow() throws SQLException;
0827:
0828: /**
0829: * Gets the value of a column specified as a column index as a short value.
0830: *
0831: * @param columnIndex
0832: * the index of the column to read
0833: * @return a short value containing the value of the column. 0 if the value
0834: * is SQL NULL.
0835: * @throws SQLException
0836: * if a database error happens
0837: */
0838: public short getShort(int columnIndex) throws SQLException;
0839:
0840: /**
0841: * Gets the value of a column specified as a column name, as a short value.
0842: *
0843: * @param columnName
0844: * the name of the column to read
0845: * @return a short value containing the value of the column. 0 if the value
0846: * is SQL NULL.
0847: * @throws SQLException
0848: * if a database error happens
0849: */
0850: public short getShort(String columnName) throws SQLException;
0851:
0852: /**
0853: * Gets the Statement that produced this ResultSet. If the ResultSet was not
0854: * created by a Statement (eg it was returned from one of the
0855: * DatabaseMetaData methods), null is returned.
0856: *
0857: * @return the Statement which produced this ResultSet, or null if the
0858: * ResultSet was not created by a Statement.
0859: * @throws SQLException
0860: */
0861: public Statement getStatement() throws SQLException;
0862:
0863: /**
0864: * Gets the value of a column specified as a column index as a String.
0865: *
0866: * @param columnIndex
0867: * the index of the column to read
0868: * @return the String representing the value of the column, null if the
0869: * column is SQL NULL.
0870: * @throws SQLException
0871: * if a database error happens
0872: */
0873: public String getString(int columnIndex) throws SQLException;
0874:
0875: /**
0876: * Gets the value of a column specified as a column name, as a String.
0877: *
0878: * @param columnName
0879: * the name of the column to read
0880: * @return the String representing the value of the column, null if the
0881: * column is SQL NULL.
0882: * @throws SQLException
0883: * if a database error happens
0884: */
0885: public String getString(String columnName) throws SQLException;
0886:
0887: /**
0888: * Gets the value of a column specified as a column index as a java.sql.Time
0889: * value.
0890: *
0891: * @param columnIndex
0892: * the index of the column to read
0893: * @return a Time representing the column value, null if the column value is
0894: * SQL NULL.
0895: * @throws SQLException
0896: * if a database error happens
0897: */
0898: public Time getTime(int columnIndex) throws SQLException;
0899:
0900: /**
0901: * Gets the value of a column specified as a column index as a java.sql.Time
0902: * value. The supplied Calendar is used to map between the SQL Time value
0903: * and the Java Time value.
0904: *
0905: * @param columnIndex
0906: * the index of the column to read
0907: * @param cal
0908: * a Calendar to use in creating the Java Time value.
0909: * @return a Time representing the column value, null if the column value is
0910: * SQL NULL.
0911: * @throws SQLException
0912: * if a database error happens
0913: */
0914: public Time getTime(int columnIndex, Calendar cal)
0915: throws SQLException;
0916:
0917: /**
0918: * Gets the value of a column specified as a column name, as a java.sql.Time
0919: * value.
0920: *
0921: * @param columnName
0922: * the name of the column to read
0923: * @return a Time representing the column value, null if the column value is
0924: * SQL NULL.
0925: * @throws SQLException
0926: * if a database error happens
0927: */
0928: public Time getTime(String columnName) throws SQLException;
0929:
0930: /**
0931: * Gets the value of a column specified as a column index, as a
0932: * java.sql.Time value. The supplied Calendar is used to map between the SQL
0933: * Time value and the Java Time value.
0934: *
0935: * @param columnName
0936: * the name of the column to read
0937: * @param cal
0938: * a Calendar to use in creating the Java Time value.
0939: * @return a Time representing the column value, null if the column value is
0940: * SQL NULL.
0941: * @throws SQLException
0942: * if a database error happens
0943: */
0944: public Time getTime(String columnName, Calendar cal)
0945: throws SQLException;
0946:
0947: /**
0948: * Gets the value of a column specified as a column index as a
0949: * java.sql.Timestamp value.
0950: *
0951: * @param columnIndex
0952: * the index of the column to read
0953: * @return a Timestamp representing the column value, null if the column
0954: * value is SQL NULL.
0955: * @throws SQLException
0956: * if a database error happens
0957: */
0958: public Timestamp getTimestamp(int columnIndex) throws SQLException;
0959:
0960: /**
0961: * Gets the value of a column specified as a column index, as a
0962: * java.sql.Timestamp value. The supplied Calendar is used to map between
0963: * the SQL Timestamp value and the Java Timestamp value.
0964: *
0965: * @param columnIndex
0966: * the index of the column to read
0967: * @param cal
0968: * Calendar to use in creating the Java Timestamp value.
0969: * @return a Timestamp representing the column value, null if the column
0970: * value is SQL NULL.
0971: * @throws SQLException
0972: * if a database error happens
0973: */
0974: public Timestamp getTimestamp(int columnIndex, Calendar cal)
0975: throws SQLException;
0976:
0977: /**
0978: * Gets the value of a column specified as a column name, as a
0979: * java.sql.Timestamp value.
0980: *
0981: * @param columnName
0982: * the name of the column to read
0983: * @return a Timestamp representing the column value, null if the column
0984: * value is SQL NULL.
0985: * @throws SQLException
0986: * if a database error happens
0987: */
0988: public Timestamp getTimestamp(String columnName)
0989: throws SQLException;
0990:
0991: /**
0992: * Gets the value of a column specified as a column name, as a
0993: * java.sql.Timestamp value. The supplied Calendar is used to map between
0994: * the SQL Timestamp value and the Java Timestamp value.
0995: *
0996: * @param columnName
0997: * the name of the column to read
0998: * @param cal
0999: * Calendar to use in creating the Java Timestamp value.
1000: * @return a Timestamp representing the column value, null if the column
1001: * value is SQL NULL.
1002: * @throws SQLException
1003: * if a database error happens
1004: */
1005: public Timestamp getTimestamp(String columnName, Calendar cal)
1006: throws SQLException;
1007:
1008: /**
1009: * Gets the type of the ResultSet.
1010: *
1011: * @return The ResultSet type, one of: ResultSet.TYPE_FORWARD_ONLY,
1012: * ResultSet.TYPE_SCROLL_INSENSITIVE, or
1013: * ResultSet.TYPE_SCROLL_SENSITIVE
1014: * @throws SQLException
1015: * if there is a database error
1016: */
1017: public int getType() throws SQLException;
1018:
1019: /**
1020: * @deprecated Use getCharacterStream.
1021: * <p>
1022: * Gets the value of the column as an InputStream of Unicode
1023: * characters.
1024: * @param columnIndex
1025: * the index of the column to read
1026: * @return an InputStream holding the value of the column. null if the
1027: * column value is SQL NULL.
1028: * @throws SQLException
1029: * if a database error happens
1030: */
1031: @Deprecated
1032: public InputStream getUnicodeStream(int columnIndex)
1033: throws SQLException;
1034:
1035: /**
1036: * @deprecated Use getCharacterStream
1037: * <p>
1038: * Gets the value of the column as an InputStream of Unicode
1039: * characters.
1040: * @param columnName
1041: * the name of the column to read
1042: * @return an InputStream holding the value of the column. null if the
1043: * column value is SQL NULL.
1044: * @throws SQLException
1045: * if a database error happens
1046: */
1047: @Deprecated
1048: public InputStream getUnicodeStream(String columnName)
1049: throws SQLException;
1050:
1051: /**
1052: * Gets the value of a column specified as a column index as a java.net.URL.
1053: *
1054: * @param columnIndex
1055: * the index of the column to read
1056: * @return a URL. null if the column value is SQL NULL.
1057: * @throws SQLException
1058: * if a database error happens
1059: */
1060: public URL getURL(int columnIndex) throws SQLException;
1061:
1062: /**
1063: * Gets the value of a column specified as a column name as a java.net.URL
1064: * object.
1065: *
1066: * @param columnName
1067: * the name of the column to read
1068: * @return a URL. null if the column value is SQL NULL.
1069: * @throws SQLException
1070: * if a database error happens
1071: */
1072: public URL getURL(String columnName) throws SQLException;
1073:
1074: /**
1075: * Gets the first warning generated by calls on this ResultSet. Subsequent
1076: * warnings on this ResultSet are chained to the first one.
1077: * <p>
1078: * The warnings are cleared when a new Row is read from the ResultSet. The
1079: * warnings returned by this method are only the warnings generated by
1080: * ResultSet method calls - warnings generated by Statement methods are held
1081: * by the Statement.
1082: * <p>
1083: * An SQLException is generated if this method is called on a closed
1084: * ResultSet.
1085: *
1086: * @return an SQLWarning which is the first warning for this ResultSet. null
1087: * if there are no warnings.
1088: * @throws SQLException
1089: * if a database error happens
1090: */
1091: public SQLWarning getWarnings() throws SQLException;
1092:
1093: /**
1094: * Insert the insert row into the ResultSet and into the underlying
1095: * database. The Cursor must be set to the Insert Row before this method is
1096: * invoked.
1097: *
1098: * @throws SQLException
1099: * if a database error happens. Particular cases include the
1100: * Cursor not being on the Insert Row or if any Columns in the
1101: * Row do not have a value where the column is declared as
1102: * not-nullable.
1103: */
1104: public void insertRow() throws SQLException;
1105:
1106: /**
1107: * Gets if the cursor is after the last row of the ResultSet.
1108: *
1109: * @return true if the Cursor is after the last Row in the ResultSet, false
1110: * if the cursor is at any other position in the ResultSet.
1111: * @throws SQLException
1112: * if a database error happens
1113: */
1114: public boolean isAfterLast() throws SQLException;
1115:
1116: /**
1117: * Gets if the cursor is before the first row of the ResultSet.
1118: *
1119: * @return true if the Cursor is before the last Row in the ResultSet, false
1120: * if the cursor is at any other position in the ResultSet.
1121: * @throws SQLException
1122: * if a database error happens
1123: */
1124: public boolean isBeforeFirst() throws SQLException;
1125:
1126: /**
1127: * Gets if the cursor is on the first row of the ResultSet.
1128: *
1129: * @return true if the Cursor is on the first Row in the ResultSet, false if
1130: * the cursor is at any other position in the ResultSet.
1131: * @throws SQLException
1132: * if a database error happens
1133: */
1134: public boolean isFirst() throws SQLException;
1135:
1136: /**
1137: * Gets if the cursor is on the last row of the ResultSet
1138: *
1139: * @return true if the Cursor is on the last Row in the ResultSet, false if
1140: * the cursor is at any other position in the ResultSet.
1141: * @throws SQLException
1142: */
1143: public boolean isLast() throws SQLException;
1144:
1145: /**
1146: * Shifts the cursor position to the last row of the ResultSet.
1147: *
1148: * @return true if the new position is in a legitimate row, false if the
1149: * ResultSet contains no rows.
1150: * @throws SQLException
1151: * if there is a database error
1152: */
1153: public boolean last() throws SQLException;
1154:
1155: /**
1156: * Moves the cursor to the remembered position, usually the current row.
1157: * This only applies if the cursor is on the Insert row.
1158: *
1159: * @throws SQLException
1160: * if a database error happens
1161: */
1162: public void moveToCurrentRow() throws SQLException;
1163:
1164: /**
1165: * Moves the cursor position to the Insert row. The current position is
1166: * remembered and the cursor is positioned at the Insert row. The columns in
1167: * the Insert row should be filled in with the appropriate update methods,
1168: * before calling <code>insertRow</code> to insert the new row into the
1169: * database.
1170: *
1171: * @throws SQLException
1172: * if a database error happens
1173: */
1174: public void moveToInsertRow() throws SQLException;
1175:
1176: /**
1177: * Shifts the cursor position down one row in this ResultSet object.
1178: * <p>
1179: * Any InputStreams associated with the current row are closed and any
1180: * warnings are cleared.
1181: *
1182: * @return true if the updated cursor position is pointing to a valid row,
1183: * false otherwise (ie when the cursor is after the last row in the
1184: * ResultSet).
1185: * @throws SQLException
1186: * if a database error happens
1187: */
1188: public boolean next() throws SQLException;
1189:
1190: /**
1191: * Relocates the cursor position to the preceding row in this ResultSet.
1192: *
1193: * @return true if the new position is in a legitimate row, false if the
1194: * cursor is now before the first row.
1195: * @throws SQLException
1196: * if a database error happens
1197: */
1198: public boolean previous() throws SQLException;
1199:
1200: /**
1201: * Refreshes the current row with its most up to date value in the database.
1202: * Must not be called when the cursor is on the Insert row.
1203: * <p>
1204: * If any columns in the current row have been updated but the
1205: * <code>updateRow</code> has not been called, then the updates are lost
1206: * when this method is called.
1207: *
1208: * @throws SQLException
1209: * if a database error happens, including if the current row is
1210: * the Insert row.
1211: */
1212: public void refreshRow() throws SQLException;
1213:
1214: /**
1215: * Moves the cursor position up or down by a specified number of rows. If
1216: * the new position is beyond the start or end rows, the cursor position is
1217: * set before the first row/after the last row.
1218: *
1219: * @param rows
1220: * a number of rows to move the cursor - may be positive or
1221: * negative
1222: * @return true if the new cursor position is on a row, false otherwise
1223: * @throws SQLException
1224: * if a database error happens
1225: */
1226: public boolean relative(int rows) throws SQLException;
1227:
1228: /**
1229: * Indicates whether a row has been deleted. This method depends on whether
1230: * the JDBC driver and database can detect deletions.
1231: *
1232: * @return true if a row has been deleted and if deletions are detected,
1233: * false otherwise.
1234: * @throws SQLException
1235: * if a database error happens
1236: */
1237: public boolean rowDeleted() throws SQLException;
1238:
1239: /**
1240: * Indicates whether the current row has had an insertion operation. This
1241: * method depends on whether the JDBC driver and database can detect
1242: * insertions.
1243: *
1244: * @return true if a row has been inserted and if insertions are detected,
1245: * false otherwise.
1246: * @throws SQLException
1247: * if a database error happens
1248: */
1249: public boolean rowInserted() throws SQLException;
1250:
1251: /**
1252: * Indicates whether the current row has been updated. This method depends
1253: * on whether the JDBC driver and database can detect updates.
1254: *
1255: * @return true if the current row has been updated and if updates can be
1256: * detected, false otherwise.
1257: * @throws SQLException
1258: * if a database error happens
1259: */
1260: public boolean rowUpdated() throws SQLException;
1261:
1262: /**
1263: * Indicates which direction (forward/reverse) will be used to process the
1264: * rows of this ResultSet object. This is treated as a hint by the JDBC
1265: * driver.
1266: *
1267: * @param direction
1268: * can be ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, or
1269: * ResultSet.FETCH_UNKNOWN
1270: * @throws SQLException
1271: * if there is a database error
1272: */
1273: public void setFetchDirection(int direction) throws SQLException;
1274:
1275: /**
1276: * Indicates the amount of rows to fetch from the database when extra rows
1277: * are required for this ResultSet. This used as a hint to the JDBC driver.
1278: *
1279: * @param rows
1280: * the number of rows to fetch. 0 implies that the JDBC driver
1281: * can make its own decision about the fetch size. The number
1282: * should not be greater than the maximum number of rows
1283: * established by the Statement that generated the ResultSet.
1284: * @throws SQLException
1285: * if a database error happens
1286: */
1287: public void setFetchSize(int rows) throws SQLException;
1288:
1289: /**
1290: * Updates a column specified by a column index with a java.sql.Array value.
1291: *
1292: * @param columnIndex
1293: * the index of the column to update
1294: * @param x
1295: * the new value for the specified column
1296: * @throws SQLException
1297: * if a database error happens
1298: */
1299: public void updateArray(int columnIndex, Array x)
1300: throws SQLException;
1301:
1302: /**
1303: * Updates a column specified by a column name with a java.sql.Array value.
1304: *
1305: * @param columnName
1306: * the name of the column to update
1307: * @param x
1308: * the new value for the specified column
1309: * @throws SQLException
1310: * if a database error happens
1311: */
1312: public void updateArray(String columnName, Array x)
1313: throws SQLException;
1314:
1315: /**
1316: * Updates a column specified by a column index with an ASCII stream value.
1317: *
1318: * @param columnIndex
1319: * the index of the column to update
1320: * @param x
1321: * the new value for the specified column
1322: * @param length
1323: * the length of the data to write from the stream
1324: * @throws SQLException
1325: * if a database error happens
1326: */
1327: public void updateAsciiStream(int columnIndex, InputStream x,
1328: int length) throws SQLException;
1329:
1330: /**
1331: * Updates a column specified by a column name with an Ascii stream value.
1332: *
1333: * @param columnName
1334: * the name of the column to update
1335: * @param x
1336: * the new value for the specified column
1337: * @param length
1338: * the length of the data to write from the stream
1339: * @throws SQLException
1340: * if a database error happens
1341: */
1342: public void updateAsciiStream(String columnName, InputStream x,
1343: int length) throws SQLException;
1344:
1345: /**
1346: * Updates a column specified by a column index with a java.sql.BigDecimal
1347: * value.
1348: *
1349: * @param columnIndex
1350: * the index of the column to update
1351: * @param x
1352: * the new value for the specified column
1353: * @throws SQLException
1354: * if a database error happens
1355: */
1356: public void updateBigDecimal(int columnIndex, BigDecimal x)
1357: throws SQLException;
1358:
1359: /**
1360: * Updates a column specified by a column name with a java.sql.BigDecimal
1361: * value.
1362: *
1363: * @param columnName
1364: * the name of the column to update
1365: * @param x
1366: * the new value for the specified column
1367: * @throws SQLException
1368: * if a database error happens
1369: */
1370: public void updateBigDecimal(String columnName, BigDecimal x)
1371: throws SQLException;
1372:
1373: /**
1374: * Updates a column specified by a column index with a binary stream value.
1375: *
1376: * @param columnIndex
1377: * the index of the column to update
1378: * @param x
1379: * the new value for the specified column
1380: * @param length
1381: * @throws SQLException
1382: * if a database error happens
1383: */
1384: public void updateBinaryStream(int columnIndex, InputStream x,
1385: int length) throws SQLException;
1386:
1387: /**
1388: * Updates a column specified by a column name with a binary stream value.
1389: *
1390: * @param columnName
1391: * the name of the column to update
1392: * @param x
1393: * the new value for the specified column
1394: * @param length
1395: * @throws SQLException
1396: * if a database error happens
1397: */
1398: public void updateBinaryStream(String columnName, InputStream x,
1399: int length) throws SQLException;
1400:
1401: /**
1402: * Updates a column specified by a column index with a java.sql.Blob value.
1403: *
1404: * @param columnIndex
1405: * the index of the column to update
1406: * @param x
1407: * the new value for the specified column
1408: * @throws SQLException
1409: * if a database error happens
1410: */
1411: public void updateBlob(int columnIndex, Blob x) throws SQLException;
1412:
1413: /**
1414: * Updates a column specified by a column name with a java.sql.Blob value.
1415: *
1416: * @param columnName
1417: * the name of the column to update
1418: * @param x
1419: * the new value for the specified column
1420: * @throws SQLException
1421: * if a database error happens
1422: */
1423: public void updateBlob(String columnName, Blob x)
1424: throws SQLException;
1425:
1426: /**
1427: * Updates a column specified by a column index with a boolean value.
1428: *
1429: * @param columnIndex
1430: * @param x
1431: * the new value for the specified column
1432: * @throws SQLException
1433: * if a database error happens
1434: */
1435: public void updateBoolean(int columnIndex, boolean x)
1436: throws SQLException;
1437:
1438: /**
1439: * Updates a column specified by a column name with a boolean value.
1440: *
1441: * @param columnName
1442: * the name of the column to update
1443: * @param x
1444: * the new value for the specified column
1445: * @throws SQLException
1446: * if a database error happens
1447: */
1448: public void updateBoolean(String columnName, boolean x)
1449: throws SQLException;
1450:
1451: /**
1452: * Updates a column specified by a column index with a byte value.
1453: *
1454: * @param columnIndex
1455: * the index of the column to update
1456: * @param x
1457: * the new value for the specified column
1458: * @throws SQLException
1459: * if a database error happens
1460: */
1461: public void updateByte(int columnIndex, byte x) throws SQLException;
1462:
1463: /**
1464: * Updates a column specified by a column name with a byte value.
1465: *
1466: * @param columnName
1467: * the name of the column to update
1468: * @param x
1469: * the new value for the specified column
1470: * @throws SQLException
1471: * if a database error happens
1472: */
1473: public void updateByte(String columnName, byte x)
1474: throws SQLException;
1475:
1476: /**
1477: * Updates a column specified by a column index with a byte array value.
1478: *
1479: * @param columnIndex
1480: * the index of the column to update
1481: * @param x
1482: * the new value for the specified column
1483: * @throws SQLException
1484: * if a database error happens
1485: */
1486: public void updateBytes(int columnIndex, byte[] x)
1487: throws SQLException;
1488:
1489: /**
1490: * Updates a column specified by a column name with a byte array value.
1491: *
1492: * @param columnName
1493: * the name of the column to update
1494: * @param x
1495: * the new value for the specified column
1496: * @throws SQLException
1497: * if a database error happens
1498: */
1499: public void updateBytes(String columnName, byte[] x)
1500: throws SQLException;
1501:
1502: /**
1503: * Updates a column specified by a column index with a character stream
1504: * value.
1505: *
1506: * @param columnIndex
1507: * the index of the column to update
1508: * @param x
1509: * the new value for the specified column
1510: * @param length
1511: * the length of data to write from the stream
1512: * @throws SQLException
1513: * if a database error happens
1514: */
1515: public void updateCharacterStream(int columnIndex, Reader x,
1516: int length) throws SQLException;
1517:
1518: /**
1519: * Updates a column specified by a column name with a character stream
1520: * value.
1521: *
1522: * @param columnName
1523: * the name of the column to update
1524: * @param reader
1525: * the new value for the specified column
1526: * @param length
1527: * the length of data to write from the Reader
1528: * @throws SQLException
1529: * if a database error happens
1530: */
1531: public void updateCharacterStream(String columnName, Reader reader,
1532: int length) throws SQLException;
1533:
1534: /**
1535: * Updates a column specified by a column index with a java.sql.Clob value.
1536: *
1537: * @param columnIndex
1538: * the index of the column to update
1539: * @param x
1540: * the new value for the specified column
1541: * @throws SQLException
1542: * if a database error happens
1543: */
1544: public void updateClob(int columnIndex, Clob x) throws SQLException;
1545:
1546: /**
1547: * Updates a column specified by a column name with a java.sql.Clob value.
1548: *
1549: * @param columnName
1550: * the name of the column to update
1551: * @param x
1552: * the new value for the specified column
1553: * @throws SQLException
1554: * if a database error happens
1555: */
1556: public void updateClob(String columnName, Clob x)
1557: throws SQLException;
1558:
1559: /**
1560: * Updates a column specified by a column index with a java.sql.Date value.
1561: *
1562: * @param columnIndex
1563: * the index of the column to update
1564: * @param x
1565: * the new value for the specified column
1566: * @throws SQLException
1567: * if a database error happens
1568: */
1569: public void updateDate(int columnIndex, Date x) throws SQLException;
1570:
1571: /**
1572: * Updates a column specified by a column name with a java.sql.Date value.
1573: *
1574: * @param columnName
1575: * the name of the column to update
1576: * @param x
1577: * the new value for the specified column
1578: * @throws SQLException
1579: * if a database error happens
1580: */
1581: public void updateDate(String columnName, Date x)
1582: throws SQLException;
1583:
1584: /**
1585: * Updates a column specified by a column index with a double value.
1586: *
1587: * @param columnIndex
1588: * the index of the column to update
1589: * @param x
1590: * the new value for the specified column
1591: * @throws SQLException
1592: * if a database error happens
1593: */
1594: public void updateDouble(int columnIndex, double x)
1595: throws SQLException;
1596:
1597: /**
1598: * Updates a column specified by a column name with a double value.
1599: *
1600: * @param columnName
1601: * the name of the column to update
1602: * @param x
1603: * the new value for the specified column
1604: * @throws SQLException
1605: * if a database error happens
1606: */
1607: public void updateDouble(String columnName, double x)
1608: throws SQLException;
1609:
1610: /**
1611: * Updates a column specified by a column index with a float value.
1612: *
1613: * @param columnIndex
1614: * the index of the column to update
1615: * @param x
1616: * the new value for the specified column
1617: * @throws SQLException
1618: * if a database error happens
1619: */
1620: public void updateFloat(int columnIndex, float x)
1621: throws SQLException;
1622:
1623: /**
1624: * Updates a column specified by a column name with a float value.
1625: *
1626: * @param columnName
1627: * the name of the column to update
1628: * @param x
1629: * the new value for the specified column
1630: * @throws SQLException
1631: * if a database error happens
1632: */
1633: public void updateFloat(String columnName, float x)
1634: throws SQLException;
1635:
1636: /**
1637: * Updates a column specified by a column index with an int value.
1638: *
1639: * @param columnIndex
1640: * the index of the column to update
1641: * @param x
1642: * the new value for the specified column
1643: * @throws SQLException
1644: * if a database error happens
1645: */
1646: public void updateInt(int columnIndex, int x) throws SQLException;
1647:
1648: /**
1649: * Updates a column specified by a column name with an int value.
1650: *
1651: * @param columnName
1652: * the name of the column to update
1653: * @param x
1654: * the new value for the specified column
1655: * @throws SQLException
1656: * if a database error happens
1657: */
1658: public void updateInt(String columnName, int x) throws SQLException;
1659:
1660: /**
1661: * Updates a column specified by a column index with a long value.
1662: *
1663: * @param columnIndex
1664: * the index of the column to update
1665: * @param x
1666: * the new value for the specified column
1667: * @throws SQLException
1668: * if a database error happens
1669: */
1670: public void updateLong(int columnIndex, long x) throws SQLException;
1671:
1672: /**
1673: * Updates a column specified by a column name with a long value.
1674: *
1675: * @param columnName
1676: * the name of the column to update
1677: * @param x
1678: * the new value for the specified column
1679: * @throws SQLException
1680: * if a database error happens
1681: */
1682: public void updateLong(String columnName, long x)
1683: throws SQLException;
1684:
1685: /**
1686: * Updates a column specified by a column index with a null value.
1687: *
1688: * @param columnIndex
1689: * the index of the column to update
1690: * @throws SQLException
1691: * if a database error happens
1692: */
1693: public void updateNull(int columnIndex) throws SQLException;
1694:
1695: /**
1696: * Updates a column specified by a column name with a null value.
1697: *
1698: * @param columnName
1699: * the name of the column to update
1700: * @throws SQLException
1701: * if a database error happens
1702: */
1703: public void updateNull(String columnName) throws SQLException;
1704:
1705: /**
1706: * Updates a column specified by a column index with an Object value.
1707: *
1708: * @param columnIndex
1709: * the index of the column to update
1710: * @param x
1711: * the new value for the specified column
1712: * @throws SQLException
1713: * if a database error happens
1714: */
1715: public void updateObject(int columnIndex, Object x)
1716: throws SQLException;
1717:
1718: /**
1719: * Updates a column specified by a column index with an Object value.
1720: *
1721: * @param columnIndex
1722: * the index of the column to update
1723: * @param x
1724: * the new value for the specified column
1725: * @param scale
1726: * for the types java.sql.Types.DECIMAL or
1727: * java.sql.Types.NUMERIC, this specifies the number of digits
1728: * after the decimal point.
1729: * @throws SQLException
1730: * if a database error happens
1731: */
1732: public void updateObject(int columnIndex, Object x, int scale)
1733: throws SQLException;
1734:
1735: /**
1736: * Updates a column specified by a column name with an Object value.
1737: *
1738: * @param columnName
1739: * the name of the column to update
1740: * @param x
1741: * the new value for the specified column
1742: * @throws SQLException
1743: * if a database error happens
1744: */
1745: public void updateObject(String columnName, Object x)
1746: throws SQLException;
1747:
1748: /**
1749: * Updates a column specified by a column name with an Object value.
1750: *
1751: * @param columnName
1752: * the name of the column to update
1753: * @param x
1754: * the new value for the specified column
1755: * @param scale
1756: * for the types java.sql.Types.DECIMAL or
1757: * java.sql.Types.NUMERIC, this specifies the number of digits
1758: * after the decimal point.
1759: * @throws SQLException
1760: * if a database error happens
1761: */
1762: public void updateObject(String columnName, Object x, int scale)
1763: throws SQLException;
1764:
1765: /**
1766: * Updates a column specified by a column index with a java.sql.Ref value.
1767: *
1768: * @param columnIndex
1769: * the index of the column to update
1770: * @param x
1771: * the new value for the specified column
1772: * @throws SQLException
1773: * if a database error happens
1774: */
1775: public void updateRef(int columnIndex, Ref x) throws SQLException;
1776:
1777: /**
1778: * Updates a column specified by a column name with a java.sql.Ref value.
1779: *
1780: * @param columnName
1781: * the name of the column to update
1782: * @param x
1783: * the new value for the specified column
1784: * @throws SQLException
1785: * if a database error happens
1786: */
1787: public void updateRef(String columnName, Ref x) throws SQLException;
1788:
1789: /**
1790: * Updates the database with the new contents of the current row of this
1791: * ResultSet object.
1792: *
1793: * @throws SQLException
1794: */
1795: public void updateRow() throws SQLException;
1796:
1797: /**
1798: * Updates a column specified by a column index with a short value.
1799: *
1800: * @param columnIndex
1801: * the index of the column to update
1802: * @param x
1803: * the new value for the specified column
1804: * @throws SQLException
1805: * if a database error happens
1806: */
1807: public void updateShort(int columnIndex, short x)
1808: throws SQLException;
1809:
1810: /**
1811: * Updates a column specified by a column name with a short value.
1812: *
1813: * @param columnName
1814: * the name of the column to update
1815: * @param x
1816: * the new value for the specified column
1817: * @throws SQLException
1818: * if a database error happens
1819: */
1820: public void updateShort(String columnName, short x)
1821: throws SQLException;
1822:
1823: /**
1824: * Updates a column specified by a column index with a String value.
1825: *
1826: * @param columnIndex
1827: * the index of the column to update
1828: * @param x
1829: * the new value for the specified column
1830: * @throws SQLException
1831: * if a database error happens
1832: */
1833: public void updateString(int columnIndex, String x)
1834: throws SQLException;
1835:
1836: /**
1837: * Updates a column specified by a column name with a String value.
1838: *
1839: * @param columnName
1840: * the name of the column to update
1841: * @param x
1842: * the new value for the specified column
1843: * @throws SQLException
1844: * if a database error happens
1845: */
1846: public void updateString(String columnName, String x)
1847: throws SQLException;
1848:
1849: /**
1850: * Updates a column specified by a column index with a Time value.
1851: *
1852: * @param columnIndex
1853: * the index of the column to update
1854: * @param x
1855: * the new value for the specified column
1856: * @throws SQLException
1857: * if a database error happens
1858: */
1859: public void updateTime(int columnIndex, Time x) throws SQLException;
1860:
1861: /**
1862: * Updates a column specified by a column name with a Time value.
1863: *
1864: * @param columnName
1865: * @param x
1866: * the new value for the specified column
1867: * @throws SQLException
1868: * if a database error happens
1869: */
1870: public void updateTime(String columnName, Time x)
1871: throws SQLException;
1872:
1873: /**
1874: * Updates a column specified by a column index with a Timestamp value.
1875: *
1876: * @param columnIndex
1877: * the index of the column to update
1878: * @param x
1879: * the new value for the specified column
1880: * @throws SQLException
1881: * if a database error happens
1882: */
1883: public void updateTimestamp(int columnIndex, Timestamp x)
1884: throws SQLException;
1885:
1886: /**
1887: * Updates a column specified by column name with a Timestamp value.
1888: *
1889: * @param columnName
1890: * the name of the column to update
1891: * @param x
1892: * @throws SQLException
1893: * if a database error happens
1894: */
1895: public void updateTimestamp(String columnName, Timestamp x)
1896: throws SQLException;
1897:
1898: /**
1899: * Determines if the last column read from this ResultSet contained SQL
1900: * NULL.
1901: *
1902: * @return true if the last column contained SQL NULL, false otherwise
1903: * @throws SQLException
1904: * if a database error happens
1905: */
1906: public boolean wasNull() throws SQLException;
1907: }
|