001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package javax.sql;
019:
020: import java.sql.ResultSet;
021: import java.sql.SQLException;
022: import java.sql.Array;
023: import java.sql.Blob;
024: import java.sql.Clob;
025: import java.sql.Date;
026: import java.sql.Ref;
027: import java.sql.Time;
028: import java.sql.Timestamp;
029: import java.util.Map;
030: import java.io.InputStream;
031: import java.io.Reader;
032: import java.util.Calendar;
033: import java.math.BigDecimal;
034:
035: /**
036: * A RowSet is an interface which provides access to data being sent from/to a
037: * database and which extends the functionality of ResultSet into a form that
038: * can be used as a JavaBeans component, perhaps being used in a visual
039: * programming environment.
040: * <p>
041: * Facilities are provided for get/set of properties relating to the Database
042: * and the SQL Command and for getting/setting data within the Rows represented
043: * by the RowSet. The RowSet supports JavaBeans events so that other components
044: * in an application can be informed when various changes happen to the RowSet,
045: * such as changes in data values.
046: * <p>
047: * RowSet is implemented as a layer on top of the remainder of the JDBC API. A
048: * RowSet may be <i>connected</i> where it maintains a connection to the
049: * database throughout its lifecycle. A RowSet may be <i>disconnected</i> where
050: * it establishes a connection to the database, gets data and then closes the
051: * connection. Updates to a disconnected RowSet can be made and later send back
052: * the changes to the database, but this requires the RowSet to first reconnect
053: * to the database before the changes are sent back.
054: * <p>
055: * Disconnected RowSets may make use of RowSetReaders to populate the RowSet
056: * with data, possibly from a non-relational database source. Disconnected
057: * RowSets may also use RowSetWriters to send data back to the underlying data
058: * store. There is considerable freedom in the way that RowSetReaders and
059: * RowSetWriters are implemented to get and store data.
060: */
061: public interface RowSet extends ResultSet {
062:
063: /**
064: * Registers a supplied RowSetListener with this RowSet. Once registered,
065: * the RowSetListener is notified of events generated by the RowSet.
066: *
067: * @param theListener
068: * an object which implements the <code>rowSetListener</code>
069: * interface.
070: */
071: public void addRowSetListener(RowSetListener theListener);
072:
073: /**
074: * Clears the parameters previously set for this RowSet.
075: * <p>
076: * Parameter values apply to repeated use of a RowSet object. Setting a new
077: * value for a parameter clears its previous value.
078: * <code>clearParameters</code> clears the values for all parameters with
079: * one method call.
080: *
081: * @throws SQLException
082: * if a problem occurs accessing the database
083: */
084: public void clearParameters() throws SQLException;
085:
086: /**
087: * Fetches data for this RowSet. If successful, any existing data for the
088: * RowSet is discarded and the metadata for the rowset is set.
089: * <p>
090: * Data is retrieved connects to the database and executes a Command. This
091: * requires some or all of the following properties to be set: url, data
092: * source name, user name, password, transaction isolation, type map ; plus
093: * some or all of the properties: command, read only, maximum field size,
094: * maximum rows, escape processing, and query timeout.
095: * <p>
096: * The RowSet may use a RowSetReader to access the database - in this case a
097: * reader must be registered with the RowSet and the RowSet will then invoke
098: * the <code>readData</code> method on the reader to fetch the data.
099: *
100: * @throws SQLException
101: * if a problem occurs accessing the database or if the
102: * properties needed to access the database have not been set
103: */
104: public void execute() throws SQLException;
105:
106: /**
107: * Gets the RowSet's Command property.
108: *
109: * @return a string containing the RowSet's Command property - this is an
110: * SQL Query which can be executed to fetch data into the RowSet.
111: */
112: public String getCommand();
113:
114: /**
115: * Gets the name of the datasource for this RowSet.
116: *
117: * @return a String containing the name of the datasource.
118: */
119: public String getDataSourceName();
120:
121: /**
122: * Reports if escape processing is enabled for this RowSet.
123: * <p>
124: * If <code>true</code> (the default) the driver will automatically
125: * perform escape code processing on SQL statements prior to them being sent
126: * to the database.
127: *
128: * @return true if escape processing is enabled, false otherwise.
129: * @throws SQLException
130: * if a problem occurs accessing the database
131: */
132: public boolean getEscapeProcessing() throws SQLException;
133:
134: /**
135: * Gets the maximum number of bytes that can be returned for column values
136: * which are of types BINARY, VARBINARY, LONGVARBINARYBINARY, CHAR, VARCHAR,
137: * or LONGVARCHAR. Excess data is silently discarded if the number is
138: * exceeded.
139: *
140: * @return the current maximum size in bytes. 0 means no limit
141: * @throws SQLException
142: * if a problem occurs accessing the database
143: */
144: public int getMaxFieldSize() throws SQLException;
145:
146: /**
147: * Gets the maximum number of rows for this RowSet. Excess rows are
148: * discarded silently if the limit is exceeded.
149: *
150: * @return the previous maximum number of rows. 0 implies no limit.
151: * @throws SQLException
152: * if a problem occurs accessing the database
153: */
154: public int getMaxRows() throws SQLException;
155:
156: /**
157: * Gets the value of the password property for this RowSet. This property is
158: * used when making a connection to the database and should be set before
159: * invoking the <code>execute</code> method.
160: *
161: * @return a String containing the value of the password property.
162: */
163: public String getPassword();
164:
165: /**
166: * Gets the Timeout for the driver when executing a Query operation.
167: * <p>
168: * If a Query takes longer than the Timeout, an exception is thrown.
169: *
170: * @return the Timeout value in seconds.
171: * @throws SQLException
172: * if an error occurs accessing the database.
173: */
174: public int getQueryTimeout() throws SQLException;
175:
176: /**
177: * Gets the transaction isolation property setting for this RowSet.
178: *
179: * @return an integer holding the current transaction isolation setting. One
180: * of: one of Connection.TRANSACTION_READ_UNCOMMITTED,
181: * Connection.TRANSACTION_READ_COMMITTED,
182: * Connection.TRANSACTION_REPEATABLE_READ,
183: * Connection.TRANSACTION_SERIALIZABLE
184: */
185: public int getTransactionIsolation();
186:
187: /**
188: * Gets the custom mapping of SQL types for this RowSet, if any.
189: *
190: * @return a Map holding the custom mappings of SQL types to Java classes
191: * for this RowSet. By default, the Map is empty.
192: * @throws SQLException
193: * if an error occurs accessing the database.
194: */
195: public Map<String, Class<?>> getTypeMap() throws SQLException;
196:
197: /**
198: * Gets the URL property value for this RowSet. If there is no DataSource
199: * object specified, the RowSet uses the URL to establish a connection to
200: * the database. The default value for the URL is null.
201: *
202: * @return a String holding the value of the URL property.
203: * @throws SQLException
204: * if an error occurs accessing the database.
205: */
206: public String getUrl() throws SQLException;
207:
208: /**
209: * Gets the value of the Username property for this RowSet. The Username is
210: * used when establishing a connection to the database and should be set
211: * before the <code>execute</code> method is invoked.
212: *
213: * @return a String holing the value of the Username property.
214: */
215: public String getUsername();
216:
217: /**
218: * Reports if this RowSet is read only.
219: *
220: * @return true if this RowSet is read only, false if it is updateable.
221: */
222: public boolean isReadOnly();
223:
224: /**
225: * Removes a specified RowSetListener object from the set of listeners which
226: * will be notified of events by this RowSet.
227: *
228: * @param theListener
229: * the RowSetListener to remove from the set of listeners for
230: * this RowSet.
231: */
232: public void removeRowSetListener(RowSetListener theListener);
233:
234: /**
235: * Sets the specified ARRAY parameter in the RowSet command with the
236: * supplied java.sql.Array value.
237: *
238: * @param parameterIndex
239: * index of the parameter to set, where the first parameter has
240: * index = 1.
241: * @param theArray
242: * the java.sql.Array value to set
243: * @throws SQLException
244: * if an error occurs accessing the database.
245: */
246: public void setArray(int parameterIndex, Array theArray)
247: throws SQLException;
248:
249: /**
250: * Sets the value of the specified parameter in the RowSet command with the
251: * ASCII data in the supplied java.io.InputStream value. Data is read from
252: * the InputStream until end-of-file is reached.
253: *
254: * @param parameterIndex
255: * index of the parameter to set, where the first parameter has
256: * index = 1.
257: * @param theInputStream
258: * an InputStream containing the ASCII data to set into the
259: * parameter value
260: * @param length
261: * the length of the data in bytes
262: * @throws SQLException
263: * if an error occurs accessing the database.
264: */
265: public void setAsciiStream(int parameterIndex,
266: InputStream theInputStream, int length) throws SQLException;
267:
268: /**
269: * Sets the value of the specified SQL NUMERIC parameter in the RowSet
270: * command with the data in the supplied java.math.BigDecimal value.
271: *
272: * @param parameterIndex
273: * index of the parameter to set, where the first parameter has
274: * index = 1.
275: * @param theBigDecimal
276: * the BigDecimal containing the value
277: * @throws SQLException
278: * if an error occurs accessing the database.
279: */
280: public void setBigDecimal(int parameterIndex,
281: BigDecimal theBigDecimal) throws SQLException;
282:
283: /**
284: * Sets the value of the specified parameter in the RowSet command with the
285: * binary data in the supplied java.io.InputStream value. Data is read from
286: * the InputStream until end-of-file is reached.
287: *
288: * @param parameterIndex
289: * index of the parameter to set, where the first parameter has
290: * index = 1.
291: * @param theInputStream
292: * an InputStream containing the binary data to set into the
293: * parameter value
294: * @param length
295: * the length of the data in bytes
296: * @throws SQLException
297: * if an error occurs accessing the database.
298: */
299: public void setBinaryStream(int parameterIndex,
300: InputStream theInputStream, int length) throws SQLException;
301:
302: /**
303: * Sets the value of the specified parameter in the RowSet command with the
304: * value of a supplied java.sql.Blob.
305: *
306: * @param parameterIndex
307: * index of the parameter to set, where the first parameter has
308: * index = 1.
309: * @param theBlob
310: * the Blob value to set
311: * @throws SQLException
312: * if an error occurs accessing the database.
313: */
314: public void setBlob(int parameterIndex, Blob theBlob)
315: throws SQLException;
316:
317: /**
318: * Sets the value of the specified parameter in the RowSet command to the
319: * supplied boolean.
320: *
321: * @param parameterIndex
322: * index of the parameter to set, where the first parameter has
323: * index = 1.
324: * @param theBoolean
325: * the boolean value to set
326: * @throws SQLException
327: * if an error occurs accessing the database.
328: */
329: public void setBoolean(int parameterIndex, boolean theBoolean)
330: throws SQLException;
331:
332: /**
333: * Sets the value of the specified parameter in the RowSet command to the
334: * supplied byte value.
335: *
336: * @param parameterIndex
337: * index of the parameter to set, where the first parameter has
338: * index = 1.
339: * @param theByte
340: * the byte value to set
341: * @throws SQLException
342: * if an error occurs accessing the database.
343: */
344: public void setByte(int parameterIndex, byte theByte)
345: throws SQLException;
346:
347: /**
348: * Sets the value of the specified parameter in the RowSet command to the
349: * supplied byte array value.
350: *
351: * @param parameterIndex
352: * index of the parameter to set, where the first parameter has
353: * index = 1.
354: * @param theByteArray
355: * the array of bytes to set into the parameter.
356: * @throws SQLException
357: * if an error occurs accessing the database.
358: */
359: public void setBytes(int parameterIndex, byte[] theByteArray)
360: throws SQLException;
361:
362: /**
363: * Sets the value of the specified parameter in the RowSet command to the
364: * sequence of Unicode characters carried by the supplied java.io.Reader.
365: *
366: * @param parameterIndex
367: * index of the parameter to set, where the first parameter has
368: * index = 1.
369: * @param theReader
370: * the Reader which contains the Unicode data to set into the
371: * parameter
372: * @param length
373: * the length of the data in the Reader in characters
374: * @throws SQLException
375: * if an error occurs accessing the database.
376: */
377: public void setCharacterStream(int parameterIndex,
378: Reader theReader, int length) throws SQLException;
379:
380: /**
381: * Sets the value of the specified parameter in the RowSet command with the
382: * value of a supplied java.sql.Clob.
383: *
384: * @param parameterIndex
385: * index of the parameter to set, where the first parameter has
386: * index = 1.
387: * @param theClob
388: * the Clob value to set
389: * @throws SQLException
390: * if an error occurs accessing the database.
391: */
392: public void setClob(int parameterIndex, Clob theClob)
393: throws SQLException;
394:
395: /**
396: * Sets the Command property for this RowSet - the command is an SQL Query
397: * which runs when the <code>execute</code> method is invoked. This
398: * property is optional for datasources that do not support commands.
399: *
400: * @param cmd
401: * a String containing the SQL Query. Can be null.
402: * @throws SQLException
403: * if an error occurs accessing the database.
404: */
405: public void setCommand(String cmd) throws SQLException;
406:
407: /**
408: * Sets the concurrency property of this RowSet. The default value is
409: * ResultSet.CONCUR_READ_ONLY.
410: *
411: * @param concurrency
412: * the new concurrency value - one of: ResultSet.CONCUR_READ_ONLY
413: * or ResultSet.CONCUR_UPDATABLE
414: * @throws SQLException
415: * if an error occurs accessing the database.
416: */
417: public void setConcurrency(int concurrency) throws SQLException;
418:
419: /**
420: * Sets the Data Source Name property for the RowSet.
421: * <p>
422: * The Data Source Name can be used to find a <code>DataSource</code>
423: * which has been registered with a naming service - the DataSource can then
424: * be used to create a connection to the database.
425: *
426: * @param name
427: * a String with the new Data Source Name.
428: * @throws SQLException
429: * if an error occurs accessing the database.
430: */
431: public void setDataSourceName(String name) throws SQLException;
432:
433: /**
434: * Sets the value of the specified parameter in the RowSet command with the
435: * value of a supplied java.sql.Date.
436: *
437: * @param parameterIndex
438: * index of the parameter to set, where the first parameter has
439: * index = 1.
440: * @param theDate
441: * the Date to use
442: * @throws SQLException
443: * if an error occurs accessing the database.
444: */
445: public void setDate(int parameterIndex, Date theDate)
446: throws SQLException;
447:
448: /**
449: * Sets the value of the specified parameter in the RowSet command with the
450: * value of a supplied java.sql.Date, where the conversion of the Date to an
451: * SQL DATE value is calculated using a supplied Calendar.
452: *
453: * @param parameterIndex
454: * index of the parameter to set, where the first parameter has
455: * index = 1.
456: * @param theDate
457: * the Date to use
458: * @param theCalendar
459: * the Calendar to use in converting the Date to an SQL DATE
460: * value
461: * @throws SQLException
462: * if an error occurs accessing the database.
463: */
464: public void setDate(int parameterIndex, Date theDate,
465: Calendar theCalendar) throws SQLException;
466:
467: /**
468: * Sets the value of the specified parameter in the RowSet command with the
469: * supplied double.
470: *
471: * @param parameterIndex
472: * index of the parameter to set, where the first parameter has
473: * index = 1.
474: * @param theDouble
475: * the double value to set
476: * @throws SQLException
477: * if an error occurs accessing the database.
478: */
479: public void setDouble(int parameterIndex, double theDouble)
480: throws SQLException;
481:
482: /**
483: * Sets the Escape Processing status for this RowSet. If escape processing
484: * is on, the driver performs escape substitution before sending an SQL
485: * command to the database. The default value for escape processing is on.
486: *
487: * @param enable
488: * true to enable Escape Processing, false to turn it off.
489: * @throws SQLException
490: * if an error occurs accessing the database.
491: */
492: public void setEscapeProcessing(boolean enable) throws SQLException;
493:
494: /**
495: * Sets the value of the specified parameter in the RowSet command with the
496: * supplied float.
497: *
498: * @param parameterIndex
499: * index of the parameter to set, where the first parameter has
500: * index = 1.
501: * @param theFloat
502: * the float value to set
503: * @throws SQLException
504: * if an error occurs accessing the database.
505: */
506: public void setFloat(int parameterIndex, float theFloat)
507: throws SQLException;
508:
509: /**
510: * Sets the value of the specified parameter in the RowSet command with the
511: * supplied integer.
512: *
513: * @param parameterIndex
514: * index of the parameter to set, where the first parameter has
515: * index = 1.
516: * @param theInteger
517: * the integer value to set
518: * @throws SQLException
519: * if an error occurs accessing the database.
520: */
521: public void setInt(int parameterIndex, int theInteger)
522: throws SQLException;
523:
524: /**
525: * Sets the value of the specified parameter in the RowSet command with the
526: * supplied long.
527: *
528: * @param parameterIndex
529: * index of the parameter to set, where the first parameter has
530: * index = 1.
531: * @param theLong
532: * the long value to set
533: * @throws SQLException
534: * if an error occurs accessing the database.
535: */
536: public void setLong(int parameterIndex, long theLong)
537: throws SQLException;
538:
539: /**
540: * Sets the maximum number of bytes which can be returned for a column value
541: * where the column type BINARY, VARBINARY, LONGVARBINARYBINARY, CHAR,
542: * VARCHAR, or LONGVARCHAR. Data which exceeds this limit is silently
543: * discarded. For portability, a value greater than 256 is recommended.
544: *
545: * @param max
546: * the maximum size of the returned column value in bytes. 0
547: * means unlimited.
548: * @throws SQLException
549: * if an error occurs accessing the database.
550: */
551: public void setMaxFieldSize(int max) throws SQLException;
552:
553: /**
554: * Sets the maximum number of rows which can be held by the RowSet. Any
555: * additional rows are silently discarded.
556: *
557: * @param max
558: * the maximum number of rows which can be held in the RowSet. 0
559: * means no limit.
560: * @throws SQLException
561: * if an error occurs accessing the database.
562: */
563: public void setMaxRows(int max) throws SQLException;
564:
565: /**
566: * Sets the value of the specified parameter in the RowSet command to SQL
567: * NULL.
568: *
569: * @param parameterIndex
570: * index of the parameter to set, where the first parameter has
571: * index = 1.
572: * @param sqlType
573: * the type of the parameter, as defined by java.sql.Types.
574: * @throws SQLException
575: * if an error occurs accessing the database.
576: */
577: public void setNull(int parameterIndex, int sqlType)
578: throws SQLException;
579:
580: /**
581: * Sets the value of the specified parameter in the RowSet command to SQL
582: * NULL. This form of the <code>setNull</code> method should be used for
583: * User Defined Types and REF parameters.
584: *
585: * @param parameterIndex
586: * index of the parameter to set, where the first parameter has
587: * index = 1.
588: * @param sqlType
589: * the type of the parameter, as defined by java.sql.Types.
590: * @param typeName
591: * the fully qualified name of an SQL User Defined Type or the
592: * name of the SQL structured type referenced by a REF type.
593: * Ignored if the sqlType is not a UDT or REF type.
594: * @throws SQLException
595: * if an error occurs accessing the database.
596: */
597: public void setNull(int parameterIndex, int sqlType, String typeName)
598: throws SQLException;
599:
600: /**
601: * Sets the value of the specified parameter in the RowSet command to a
602: * supplied Java object.
603: * <p>
604: * The JDBC specification provides a standard mapping for Java objects to
605: * SQL data types. Database specific types can be mapped by JDBC driver
606: * specific Java types.
607: *
608: * @param parameterIndex
609: * index of the parameter to set, where the first parameter has
610: * index = 1.
611: * @param theObject
612: * the Java object containing the data value.
613: * @throws SQLException
614: * if an error occurs accessing the database.
615: */
616: public void setObject(int parameterIndex, Object theObject)
617: throws SQLException;
618:
619: /**
620: * Sets the value of the specified parameter in the RowSet command to a
621: * supplied Java object.
622: *
623: * @param parameterIndex
624: * index of the parameter to set, where the first parameter has
625: * index = 1.
626: * @param theObject
627: * the Java object containing the data value.
628: * @param targetSqlType
629: * the SQL type to send to the database, as defined in
630: * java.sql.Types.
631: * @throws SQLException
632: * if an error occurs accessing the database.
633: */
634: public void setObject(int parameterIndex, Object theObject,
635: int targetSqlType) throws SQLException;
636:
637: /**
638: * Sets the value of the specified parameter in the RowSet command to a
639: * supplied Java object.
640: *
641: * @param parameterIndex
642: * index of the parameter to set, where the first parameter has
643: * index = 1.
644: * @param theObject
645: * the Java object containing the data value.
646: * @param targetSqlType
647: * the SQL type to send to the database, as defined in
648: * java.sql.Types.
649: * @param scale
650: * the number of digits after the decimal point, for
651: * java.sql.Types.DECIMAL and java.sql.Types.NUMERIC types.
652: * Ignored for all other types.
653: * @throws SQLException
654: * if an error occurs accessing the database.
655: */
656: public void setObject(int parameterIndex, Object theObject,
657: int targetSqlType, int scale) throws SQLException;
658:
659: /**
660: * Sets the database Password for this RowSet.
661: *
662: * @param password
663: * a string holding the new password
664: * @throws SQLException
665: * if an error occurs accessing the database.
666: */
667: public void setPassword(String password) throws SQLException;
668:
669: /**
670: * Sets the Timeout value for this RowSet. The timeout is the maximum time
671: * that the driver will wait while executing a command - after this time, an
672: * SQLException is thrown.
673: *
674: * @param seconds
675: * the number of seconds for the Timeout.
676: * @throws SQLException
677: * if an error occurs accessing the database.
678: */
679: public void setQueryTimeout(int seconds) throws SQLException;
680:
681: /**
682: * Sets whether the RowSet is read only or is updateable.
683: *
684: * @param readOnly
685: * true to set the RowSet to readonly state, false to allow
686: * updates.
687: * @throws SQLException
688: * if an error occurs accessing the database.
689: */
690: public void setReadOnly(boolean readOnly) throws SQLException;
691:
692: /**
693: * Sets the value of the specified parameter in the RowSet command to a
694: * supplied java.sql.Ref. This is sent to the database as an SQL REF value.
695: *
696: * @param parameterIndex
697: * index of the parameter to set, where the first parameter has
698: * index = 1.
699: * @param theRef
700: * the Ref value to set
701: * @throws SQLException
702: * if an error occurs accessing the database.
703: */
704: public void setRef(int parameterIndex, Ref theRef)
705: throws SQLException;
706:
707: /**
708: * Sets the value of the specified parameter in the RowSet command to a
709: * supplied short integer.
710: *
711: * @param parameterIndex
712: * index of the parameter to set, where the first parameter has
713: * index = 1.
714: * @param theShort
715: * the short value to set
716: * @throws SQLException
717: * if an error occurs accessing the database.
718: */
719: public void setShort(int parameterIndex, short theShort)
720: throws SQLException;
721:
722: /**
723: * Sets the value of the specified parameter in the RowSet command to a
724: * supplied String. The String is placed into the database as a VARCHAR or
725: * LONGVARCHAR SQL value, depending on the database limits for the length of
726: * VARCHAR values.
727: *
728: * @param parameterIndex
729: * index of the parameter to set, where the first parameter has
730: * index = 1.
731: * @param theString
732: * @throws SQLException
733: * if an error occurs accessing the database.
734: */
735: public void setString(int parameterIndex, String theString)
736: throws SQLException;
737:
738: /**
739: * Sets the value of the specified parameter in the RowSet command to a
740: * supplied java.sql.Time, converting to an SQL TIME value using the system
741: * default Calendar.
742: *
743: * @param parameterIndex
744: * index of the parameter to set, where the first parameter has
745: * index = 1.
746: * @param theTime
747: * the Time value to set
748: * @throws SQLException
749: * if an error occurs accessing the database.
750: */
751: public void setTime(int parameterIndex, Time theTime)
752: throws SQLException;
753:
754: /**
755: * Sets the value of the specified parameter in the RowSet command to a
756: * supplied java.sql.Time, converting to an SQL TIME value using a supplied
757: * Calendar.
758: *
759: * @param parameterIndex
760: * index of the parameter to set, where the first parameter has
761: * index = 1.
762: * @param theTime
763: * the Time value to set
764: * @param theCalendar
765: * the Calendar to use in the conversion operation
766: * @throws SQLException
767: * if an error occurs accessing the database.
768: */
769: public void setTime(int parameterIndex, Time theTime,
770: Calendar theCalendar) throws SQLException;
771:
772: /**
773: * Sets the value of the specified parameter in the RowSet command to a
774: * supplied java.sql.Timestamp, converting to an SQL TIMESTAMP value using
775: * the system default Calendar.
776: *
777: * @param parameterIndex
778: * index of the parameter to set, where the first parameter has
779: * index = 1.
780: * @param theTimestamp
781: * @throws SQLException
782: * if an error occurs accessing the database.
783: */
784: public void setTimestamp(int parameterIndex, Timestamp theTimestamp)
785: throws SQLException;
786:
787: /**
788: * Sets the value of the specified parameter in the RowSet command to a
789: * supplied java.sql.Timestamp converting to an SQL TIMESTAMP value using a
790: * supplied Calendar.
791: *
792: * @param parameterIndex
793: * index of the parameter to set, where the first parameter has
794: * index = 1.
795: * @param theTimestamp
796: * @param theCalendar
797: * the Calendar to use in the conversion operation
798: * @throws SQLException
799: * if an error occurs accessing the database.
800: */
801: public void setTimestamp(int parameterIndex,
802: Timestamp theTimestamp, Calendar theCalendar)
803: throws SQLException;
804:
805: /**
806: * Updates the target instance's transaction isolation level to one of a
807: * discrete set of possible values.
808: *
809: * @param level
810: * the new transaction isolation level. One of:
811: * Connection.TRANSACTION_READ_UNCOMMITTED,
812: * Connection.TRANSACTION_READ_COMMITTED,
813: * Connection.TRANSACTION_REPEATABLE_READ, or
814: * Connection.TRANSACTION_SERIALIZABLE
815: * @throws SQLException
816: * if an error occurs accessing the database.
817: */
818: public void setTransactionIsolation(int level) throws SQLException;
819:
820: /**
821: * Sets the type of this RowSet. By default, the type is non-scrollable.
822: *
823: * @param type
824: * the new type for the RowSet. One of:
825: * ResultSet.TYPE_FORWARD_ONLY,
826: * ResultSet.TYPE_SCROLL_INSENSITIVE, or
827: * ResultSet.TYPE_SCROLL_SENSITIVE
828: * @throws SQLException
829: * if an error occurs accessing the database.
830: */
831: public void setType(int type) throws SQLException;
832:
833: /**
834: * Sets the Map used to map SQL User Defined Types to Java classes.
835: *
836: * @param theTypeMap
837: * a Map which defines the names of SQL UDTs and the Java classes
838: * to which they are mapped.
839: * @throws SQLException
840: * if an error occurs accessing the database.
841: */
842: public void setTypeMap(Map<String, Class<?>> theTypeMap)
843: throws SQLException;
844:
845: /**
846: * Sets the URL used by this RowSet to access the database via a
847: * <code>DriverManager</code>. The URL is optional - an alternative is to
848: * use a Data Source Name to create a connection.
849: *
850: * @param theURL
851: * a String containing the URL for the database. Can be null.
852: * @throws SQLException
853: * if an error occurs accessing the database.
854: */
855: public void setUrl(String theURL) throws SQLException;
856:
857: /**
858: * Sets the Username property for the RowSet, used to authenticate a
859: * connection to the database.
860: *
861: * @param theUsername
862: * a String containing the User Name
863: * @throws SQLException
864: * if an error occurs accessing the database.
865: */
866: public void setUsername(String theUsername) throws SQLException;
867: }
|