KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > types > DataValueDescriptor


1 /*
2
3    Derby - Class org.apache.derby.iapi.types.DataValueDescriptor
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.iapi.types;
23
24 import org.apache.derby.iapi.services.io.ArrayInputStream;
25
26 import org.apache.derby.iapi.error.StandardException;
27 import org.apache.derby.iapi.types.Orderable;
28 import org.apache.derby.iapi.services.io.Storable;
29
30 import java.io.InputStream JavaDoc;
31 import java.io.IOException JavaDoc;
32 import java.sql.Date JavaDoc;
33 import java.sql.ResultSet JavaDoc;
34 import java.sql.PreparedStatement JavaDoc;
35 import java.sql.Time JavaDoc;
36 import java.sql.Timestamp JavaDoc;
37 import java.sql.SQLException JavaDoc;
38 import java.util.Calendar JavaDoc;
39
40 /**
41  * The DataValueDescriptor interface provides methods to get the data from
42  * a column returned by a statement. This interface has the same methods
43  * as NoCastDataValueDescriptor - the only reason it exists is for purposes
44  * of internal documentation, to make it clear when the different getXXX
45  * methods throw exceptions for illegal conversions.
46  * <p>
47  * This interface matches the getXXX methods on java.sql.ResultSet. This means
48  * everyone satisfies getString and getObject; all of the numeric types, within
49  * the limits of representation, satisfy all of the numeric getXXX methods;
50  * all of the character types satisfy all of the getXXX methods except
51  * getBytes and getBinaryStream; all of the binary types satisfy getBytes and
52  * all of the getXXXStream methods; Date satisfies getDate and getTimestamp;
53  * Time satisfies getTime; and Timestamp satisfies all of the date/time getXXX
54  * methods.
55  * The "preferred" method (one that will always work, I presume) is the one that
56  * matches the type most closely. See the comments below for
57  * "preferences". See the JDBC guide for details.
58  * <p>
59  * This interface does not include the getXXXStream methods.
60  * <p>
61  * The preferred methods for JDBC are:
62  * <p>
63  * CHAR and VARCHAR - getString()
64  * <p>
65  * BIT - getBoolean()
66  * <p>
67  * TINYINT - getByte()
68  * <p>
69  * SMALLINT - getShort()
70  * <p>
71  * INTEGER - getInt()
72  * <p>
73  * BIGINT - getLong()
74  * <p>
75  * REAL - getFloat()
76  * <p>
77  * FLOAT and DOUBLE - getDouble()
78  * <p>
79  * DECIMAL and NUMERIC - getBigDecimal()
80  * <p>
81  * BINARY and VARBINARY - getBytes()
82  * <p>
83  * DATE - getDate()
84  * <p>
85  * TIME - getTime()
86  * <p>
87  * TIMESTAMP - getTimestamp()
88  * <p>
89  * No JDBC type corresponds to getObject(). Use this for user-defined types
90  * or to get the JDBC types as java Objects. All primitive types will be
91  * wrapped in their corresponding Object type, i.e. int will be
92  * wrapped in an Integer.
93  * <p>
94  * getStream()
95  *
96  * @author Jeff Lichtman
97  */

98
99 public interface DataValueDescriptor extends Storable, Orderable
100 {
101
102     /**
103      * Gets the length of the data value. The meaning of this is
104      * implementation-dependent. For string types, it is the number of
105      * characters in the string. For numeric types, it is the number of
106      * bytes used to store the number. This is the actual length
107      * of this value, not the length of the type it was defined as.
108      * For example, a VARCHAR value may be shorter than the declared
109      * VARCHAR (maximum) length.
110      *
111      * @return The length of the data value
112      *
113      * @exception StandardException On error
114      */

115     int getLength() throws StandardException;
116
117     /**
118      * Gets the value in the data value descriptor as a String.
119      * Throws an exception if the data value is not a string.
120      *
121      * @return The data value as a String.
122      *
123      * @exception StandardException Thrown on error
124      */

125     String JavaDoc getString() throws StandardException;
126
127     /**
128      * Gets the value in the data value descriptor as a trace string.
129      * If the value itself is not suitable for tracing purposes, a more
130      * suitable representation is returned. For instance, data values
131      * represented as streams are not materialized. Instead, information about
132      * the associated stream is given.
133      */

134     String JavaDoc getTraceString() throws StandardException;
135
136     /**
137      * Gets the value in the data value descriptor as a boolean.
138      * Throws an exception if the data value is not a boolean.
139      * For DataValueDescriptor, this is the preferred interface
140      * for BIT, but for this no-casting interface, it isn't, because
141      * BIT is stored internally as a Bit, not as a Boolean.
142      *
143      * @return The data value as a boolean.
144      *
145      * @exception StandardException Thrown on error
146      */

147     boolean getBoolean() throws StandardException;
148
149     /**
150      * Gets the value in the data value descriptor as a byte.
151      * Throws an exception if the data value is not a byte.
152      *
153      * @return The data value as a byte.
154      *
155      * @exception StandardException Thrown on error
156      */

157     byte getByte() throws StandardException;
158
159     /**
160      * Gets the value in the data value descriptor as a short.
161      * Throws an exception if the data value is not a short.
162      *
163      * @return The data value as a short.
164      *
165      * @exception StandardException Thrown on error
166      */

167     short getShort() throws StandardException;
168
169     /**
170      * Gets the value in the data value descriptor as an int.
171      * Throws an exception if the data value is not an int.
172      *
173      * @return The data value as a int.
174      *
175      * @exception StandardException Thrown on error
176      */

177     int getInt() throws StandardException;
178
179     /**
180      * Gets the value in the data value descriptor as a long.
181      * Throws an exception if the data value is not a long.
182      *
183      * @return The data value as a long.
184      *
185      * @exception StandardException Thrown on error
186      */

187     long getLong() throws StandardException;
188
189     /**
190      * Gets the value in the data value descriptor as a float.
191      * Throws an exception if the data value is not a float.
192      *
193      * @return The data value as a float.
194      *
195      * @exception StandardException Thrown on error
196      */

197     float getFloat() throws StandardException;
198
199     /**
200      * Gets the value in the data value descriptor as a double.
201      * Throws an exception if the data value is not a double.
202      *
203      * @return The data value as a double.
204      *
205      * @exception StandardException Thrown on error
206      */

207     double getDouble() throws StandardException;
208     
209     /**
210      * How should this value be obtained so that it can
211      * be converted to a BigDecimal representation.
212      * @return Types.CHAR for String conversion through getString
213      * Types.DECIMAL for BigDecimal through getObject or Types.BIGINT
214      * for long conversion through getLong
215      * @exception StandardException Conversion is not possible
216      */

217     int typeToBigDecimal() throws StandardException;
218
219     /**
220      * Gets the value in the data value descriptor as a byte array.
221      * Throws an exception if the data value is not a byte array.
222      *
223      * @return The data value as a byte[].
224      *
225      * @exception StandardException Thrown on error
226      */

227     byte[] getBytes() throws StandardException;
228
229     /**
230      * Gets the value in the data value descriptor as a java.sql.Date.
231      * Throws an exception if the data value is not a Date.
232      * @param cal calendar for object creation
233      * @return The data value as a java.sql.Date.
234      *
235      * @exception StandardException Thrown on error
236      */

237     Date JavaDoc getDate(java.util.Calendar JavaDoc cal) throws StandardException;
238
239     /**
240      * Gets the value in the data value descriptor as a java.sql.Time.
241      * Throws an exception if the data value is not a Time.
242      * @param cal calendar for object creation
243      *
244      * @return The data value as a java.sql.Time.
245      *
246      * @exception StandardException Thrown on error
247      */

248     Time JavaDoc getTime(java.util.Calendar JavaDoc cal) throws StandardException;
249
250     /**
251      * Gets the value in the data value descriptor as a java.sql.Timestamp.
252      * Throws an exception if the data value is not a Timestamp.
253      * @param cal calendar for object creation
254      * @return The data value as a java.sql.Timestamp.
255      *
256      * @exception StandardException Thrown on error
257      */

258     Timestamp JavaDoc getTimestamp(java.util.Calendar JavaDoc cal) throws StandardException;
259
260     /**
261      * Gets the value in the data value descriptor as a Java Object.
262      * The type of the Object will be the Java object type corresponding
263      * to the data value's SQL type. JDBC defines a mapping between Java
264      * object types and SQL types - we will allow that to be extended
265      * through user type definitions. Throws an exception if the data
266      * value is not an object (yeah, right).
267      *
268      * @return The data value as an Object.
269      *
270      * @exception StandardException Thrown on error
271      */

272     Object JavaDoc getObject() throws StandardException;
273
274     /**
275      * Gets the value in the data value descriptor as a Java InputStream.
276      * Only data types that implements StreamStorable will have stream states.
277      *
278      * @return The stream state of the data value.
279      *
280      * @exception StandardException Throws an exception if the data value
281      * cannot be received as a stream.
282      */

283     InputStream getStream() throws StandardException;
284
285     /**
286      * Clone this DataValueDescriptor. Results in a new object
287      * that has the same value as this but can be modified independently.
288      *
289      * @return A clone of the DataValueDescriptor with the same initial value as this.
290      */

291     public DataValueDescriptor getClone();
292
293     /**
294      * Get a new null value of the same type as this data value.
295      *
296      */

297     public DataValueDescriptor getNewNull();
298
299     /**
300      * Set the value based on the value for the specified DataValueDescriptor
301      * from the specified ResultSet.
302      *
303      * @param resultSet The specified ResultSet.
304      * @param colNumber The 1-based column # into the resultSet.
305      * @param isNullable Whether or not the column is nullable
306      * (No need to call wasNull() if not)
307      *
308      * @exception StandardException Thrown on error
309      * @exception SQLException Error accessing the result set
310      */

311     public void setValueFromResultSet(
312     ResultSet JavaDoc resultSet,
313     int colNumber,
314     boolean isNullable)
315         throws StandardException, SQLException JavaDoc;
316
317
318     /**
319         Set this value into a PreparedStatement. This method must
320         handle setting NULL into the PreparedStatement.
321
322         @exception SQLException thrown by the PreparedStatement object
323         @exception StandardException thrown by me accessing my value.
324     */

325     public void setInto(PreparedStatement JavaDoc ps, int position) throws SQLException JavaDoc, StandardException;
326
327     /**
328         Set this value into a ResultSet for a subsequent ResultSet.insertRow
329         or ResultSet.updateRow. This method will only be called for non-null values.
330
331         @exception SQLException thrown by the ResultSet object
332         @exception StandardException thrown by me accessing my value.
333     */

334     public void setInto(ResultSet JavaDoc rs, int position) throws SQLException JavaDoc, StandardException;
335     
336     /**
337      * Set the value of this DataValueDescriptor to the given int value
338      *
339      * @param theValue The value to set this DataValueDescriptor to
340      *
341      * @exception StandardException Thrown on error
342      */

343     public void setValue(int theValue) throws StandardException;
344
345
346     /**
347      * Set the value of this DataValueDescriptor to the given double value
348      *
349      * @param theValue The value to set this DataValueDescriptor to
350      *
351      * @exception StandardException Thrown on error
352      */

353     public void setValue(double theValue) throws StandardException;
354
355     /**
356      * Set the value of this DataValueDescriptor to the given double value
357      *
358      * @param theValue A Double containing the value to set this
359      * DataValueDescriptor to. Null means set the value
360      * to SQL null.
361      *
362      * @exception StandardException Thrown on error
363      */

364
365     public void setValue(float theValue) throws StandardException;
366
367     /**
368      * Set the value of this DataValueDescriptor to the given short value
369      *
370      * @param theValue The value to set this DataValueDescriptor to
371      *
372      * @exception StandardException Thrown on error
373      */

374     public void setValue(short theValue) throws StandardException;
375
376     /**
377      * Set the value of this DataValueDescriptor to the given long value
378      *
379      * @param theValue The value to set this DataValueDescriptor to
380      *
381      * @exception StandardException Thrown on error
382      */

383     public void setValue(long theValue) throws StandardException;
384
385     /**
386      * Set the value of this DataValueDescriptor to the given byte value
387      *
388      * @param theValue The value to set this DataValueDescriptor to
389      *
390      */

391     public void setValue(byte theValue) throws StandardException;
392
393     
394     /**
395      * Set the value.
396      *
397      * @param theValue Contains the boolean value to set this to
398      *
399      */

400     public void setValue(boolean theValue) throws StandardException;
401
402     /**
403      * Set the value of this DataValueDescriptor.
404      *
405      * @param theValue The byte value to set this DataValueDescriptor to
406      *
407      */

408     public void setValue(byte[] theValue) throws StandardException;
409
410     /**
411         Set this value from an application supplied java.math.BigDecimal.
412         This is to support the PreparedStatement.setBigDecimal method and
413         similar JDBC methods that allow an application to pass in a BigDecimal
414         to any SQL type.
415         Parameter is declared as java.lang.Number to allow compilation
416         under J2ME/CDC/Foundation. This method will not be called in
417         any environment that does not support java.math.BigDecimal.
418
419         @param bigDecimal required to be a BigDecimal or null.
420      */

421     public void setBigDecimal(Number JavaDoc bigDecimal) throws StandardException;
422
423     /**
424      * Set the value of this DataValueDescriptor.
425      *
426      * @param theValue The String value to set this DataValueDescriptor to
427      *
428      */

429     public void setValue(String JavaDoc theValue) throws StandardException;
430
431     /**
432      * Set the value of this DataValueDescriptor.
433      *
434      * @param theValue The Time value to set this DataValueDescriptor to
435      *
436      */

437     public void setValue(Time JavaDoc theValue) throws StandardException;
438
439     /**
440      * Set the value of this DataValueDescriptor.
441      *
442      * @param theValue The Time value to set this DataValueDescriptor to
443      * @param cal The time zone from the calendar is used to construct the database time value
444      *
445      */

446     public void setValue(Time JavaDoc theValue, Calendar JavaDoc cal) throws StandardException;
447
448     /**
449      * Set the value of this DataValueDescriptor.
450      *
451      * @param theValue The Timestamp value to set this DataValueDescriptor to
452      *
453      */

454     public void setValue(Timestamp JavaDoc theValue) throws StandardException;
455
456     /**
457      * Set the value of this DataValueDescriptor.
458      *
459      * @param theValue The Timestamp value to set this DataValueDescriptor to
460      * @param cal The time zone from the calendar is used to construct the database timestamp value
461      *
462      */

463     public void setValue(Timestamp JavaDoc theValue, Calendar JavaDoc cal) throws StandardException;
464
465     /**
466      * Set the value of this DataValueDescriptor.
467      *
468      * @param theValue The Date value to set this DataValueDescriptor to
469      *
470      */

471     public void setValue(Date JavaDoc theValue) throws StandardException;
472
473     /**
474      * Set the value of this DataValueDescriptor.
475      *
476      * @param theValue The Date value to set this DataValueDescriptor to
477      * @param cal The time zone from the calendar is used to construct the database date value
478      *
479      */

480     public void setValue(Date JavaDoc theValue, Calendar JavaDoc cal) throws StandardException;
481
482     /**
483      * Set the value of this DataValueDescriptor from another.
484      *
485      * @param theValue The Date value to set this DataValueDescriptor to
486      *
487      */

488     public void setValue(DataValueDescriptor theValue) throws StandardException;
489
490
491     /**
492      * Set the value to SQL null.
493      */

494
495     void setToNull();
496
497     /**
498         Normalize the source value to this type described by this class
499         and the passed in DataTypeDescriptor. The type of the DataTypeDescriptor
500         must match this class.
501     */

502     public void normalize(DataTypeDescriptor dtd, DataValueDescriptor source)
503         throws StandardException;
504
505     /**
506      * The SQL "IS NULL" operator. Returns true if this value
507      * is null.
508      * *
509      * @return True if this value is null.
510      *
511      */

512     public BooleanDataValue isNullOp();
513
514     /**
515      * The SQL "IS NOT NULL" operator. Returns true if this value
516      * is not null.
517      *
518      *
519      * @return True if this value is not null.
520      *
521      */

522     public BooleanDataValue isNotNull();
523
524     /**
525      * Get the SQL name of the datatype
526      *
527      * @return The SQL name of the datatype
528      */

529     public String JavaDoc getTypeName();
530
531     /**
532      * Set this value from an Object. Used from CAST of a Java type to
533      * another type, including SQL types. If the passed instanceOfResultType
534      * is false then the object is not an instance of the declared
535      * type resultTypeClassName. Usually an exception should be thrown.
536      *
537      * @param value The new value
538      * @param instanceOfResultType Whether or not the new value
539      * is an instanceof the result type.
540      * @param resultTypeClassName The class name of the resulting (declared) type
541      * (for error messages only).
542      *
543      * @exception StandardException Thrown on error
544      */

545     public void setObjectForCast(
546     Object JavaDoc value,
547     boolean instanceOfResultType,
548     String JavaDoc resultTypeClassName)
549         throws StandardException;
550
551     /**
552      * Read the DataValueDescriptor from the stream.
553      * <p>
554      * Initialize the data value by reading it's values from the
555      * ArrayInputStream. This interface is provided as a way to achieve
556      * possible performance enhancement when reading an array can be
557      * optimized over reading from a generic stream from readExternal().
558      *
559      * @param ais The array stream positioned at the beginning of the
560      * byte stream to read from.
561      *
562      * @exception IOException Usual error is if you try to read
563      * past limit on the stream.
564      * @exception ClassNotFoundException If a necessary class can not be
565      * found while reading the object from
566      * the stream.
567      **/

568     public void readExternalFromArray(
569     ArrayInputStream ais)
570         throws IOException JavaDoc, ClassNotFoundException JavaDoc;
571
572     /**
573      * Each built-in type in JSQL has a precedence. This precedence determines
574      * how to do type promotion when using binary operators. For example, float
575      * has a higher precedence than int, so when adding an int to a float, the
576      * result type is float.
577      *
578      * The precedence for some types is arbitrary. For example, it doesn't
579      * matter what the precedence of the boolean type is, since it can't be
580      * mixed with other types. But the precedence for the number types is
581      * critical. The SQL standard requires that exact numeric types be
582      * promoted to approximate numeric when one operator uses both. Also,
583      * the precedence is arranged so that one will not lose precision when
584      * promoting a type.
585      *
586      * @return The precedence of this type.
587      */

588     int typePrecedence();
589
590     /**
591      * The SQL language = operator. This method is called from the language
592      * module. The storage module uses the compare method in Orderable.
593      *
594      * @param left The value on the left side of the operator
595      * @param right The value on the right side of the operator
596      *
597      * @return A BooleanDataValue telling the result of the comparison
598      *
599      * @exception StandardException Thrown on error
600      */

601     public BooleanDataValue equals(DataValueDescriptor left,
602                                     DataValueDescriptor right)
603                         throws StandardException;
604
605     /**
606      * The SQL language <> operator. This method is called from the language
607      * module. The storage module uses the compare method in Orderable.
608      *
609      * @param left The value on the left side of the operator
610      * @param right The value on the right side of the operator
611      *
612      * @return A BooleanDataValue telling the result of the comparison
613      *
614      * @exception StandardException Thrown on error
615      */

616     public BooleanDataValue notEquals(DataValueDescriptor left,
617                                     DataValueDescriptor right)
618                         throws StandardException;
619
620     /**
621      * The SQL language < operator. This method is called from the language
622      * module. The storage module uses the compare method in Orderable.
623      *
624      * @param left The value on the left side of the operator
625      * @param right The value on the right side of the operator
626      *
627      * @return A BooleanDataValue telling the result of the comparison
628      *
629      * @exception StandardException Thrown on error
630      */

631     public BooleanDataValue lessThan(DataValueDescriptor left,
632                                     DataValueDescriptor right)
633                         throws StandardException;
634
635     /**
636      * The SQL language > operator. This method is called from the language
637      * module. The storage module uses the compare method in Orderable.
638      *
639      * @param left The value on the left side of the operator
640      * @param right The value on the right side of the operator
641      *
642      * @return A BooleanDataValue telling the result of the comparison
643      *
644      * @exception StandardException Thrown on error
645      */

646     public BooleanDataValue greaterThan(DataValueDescriptor left,
647                                     DataValueDescriptor right)
648                         throws StandardException;
649
650     /**
651      * The SQL language <= operator. This method is called from the language
652      * module. The storage module uses the compare method in Orderable.
653      *
654      * @param left The value on the left side of the operator
655      * @param right The value on the right side of the operator
656      *
657      * @return A BooleanDataValue telling the result of the comparison
658      *
659      * @exception StandardException Thrown on error
660      */

661     public BooleanDataValue lessOrEquals(DataValueDescriptor left,
662                                     DataValueDescriptor right)
663                         throws StandardException;
664
665     /**
666      * The SQL language >= operator. This method is called from the language
667      * module. The storage module uses the compare method in Orderable.
668      *
669      * @param left The value on the left side of the operator
670      * @param right The value on the right side of the operator
671      *
672      * @return A BooleanDataValue telling the result of the comparison
673      *
674      * @exception StandardException Thrown on error
675      */

676     public BooleanDataValue greaterOrEquals(DataValueDescriptor left,
677                                     DataValueDescriptor right)
678                         throws StandardException;
679
680
681     /**
682      * The SQL language COALESCE/VALUE function. This method is called from the language
683      * module.
684      *
685      * @param list The list of the arguments. Function will return the first non-nullable argument if any.
686      * @param returnValue The return value is the correct datatype for this function.
687      * The return value of this method is the type of the 2nd parameter.
688      *
689      * @return A DataValueDescriptor which will be either null or first non-null argument
690      *
691      * @exception StandardException Thrown on error
692      */

693     public DataValueDescriptor coalesce(DataValueDescriptor[] list, DataValueDescriptor returnValue)
694                         throws StandardException;
695
696     /**
697      * The SQL language IN operator. This method is called from the language
698      * module. This method allows us to optimize and short circuit the search
699      * if the list is ordered.
700      *
701      * @param left The value on the left side of the operator
702      * @param inList The values in the IN list
703      * @param orderedList True means that the values in the IN list are ordered,
704      * false means they are not.
705      *
706      * @return A BooleanDataValue telling the result of the comparison
707      *
708      * @exception StandardException Thrown on error
709      */

710     public BooleanDataValue in(DataValueDescriptor left,
711                                DataValueDescriptor[] inList,
712                                boolean orderedList)
713                         throws StandardException;
714
715     /**
716      * Compare this Orderable with a given Orderable for the purpose of
717      * index positioning. This method treats nulls as ordered values -
718      * that is, it treats SQL null as equal to null and less than all
719      * other values.
720      *
721      * @param other The Orderable to compare this one to.
722      *
723      * @return <0 - this Orderable is less than other.
724      * 0 - this Orderable equals other.
725      * >0 - this Orderable is greater than other.
726      *
727      * The code should not explicitly look for -1, or 1.
728      *
729      * @exception StandardException Thrown on error
730      */

731     int compare(DataValueDescriptor other) throws StandardException;
732
733     /**
734      * Compare this Orderable with a given Orderable for the purpose of
735      * qualification and sorting. The caller gets to determine how nulls
736      * should be treated - they can either be ordered values or unknown
737      * values.
738      *
739      * @param op Orderable.ORDER_OP_EQUALS means do an = comparison.
740      * Orderable.ORDER_OP_LESSTHAN means compare this < other.
741      * Orderable.ORDER_OP_LESSOREQUALS means compare this <= other.
742      * @param other The DataValueDescriptor to compare this one to.
743      * @param orderedNulls True means to treat nulls as ordered values,
744      * that is, treat SQL null as equal to null, and less
745      * than all other values.
746      * False means to treat nulls as unknown values,
747      * that is, the result of any comparison with a null
748      * is the UNKNOWN truth value.
749      * @param unknownRV The return value to use if the result of the
750      * comparison is the UNKNOWN truth value. In other
751      * words, if orderedNulls is false, and a null is
752      * involved in the comparison, return unknownRV.
753      * This parameter is not used orderedNulls is true.
754      *
755      * @return true if the comparison is true (duh!)
756      *
757      * @exception StandardException Thrown on error
758      */

759     boolean compare(
760     int op,
761     DataValueDescriptor other,
762     boolean orderedNulls,
763     boolean unknownRV)
764                 throws StandardException;
765
766     /**
767         Set the value to be the contents of the stream.
768         The reading of the stream may be delayed until execution time.
769         The format of the stream is required to be the format of this type.
770
771         @param theStream stream of correctly formatted data
772         @param valueLength logical length of the stream's value in units of this type (e.g. chars for string types).
773     */

774     public void setValue(InputStream theStream, int valueLength) throws StandardException;
775
776     /**
777         Check the value to seem if it conforms to the restrictions
778         imposed by DB2/JCC on host variables for this type.
779
780         @exception StandardException Variable is too big.
781     */

782     public void checkHostVariable(int declaredLength) throws StandardException;
783
784     /**
785      * Estimate the memory usage in bytes of the data value and the overhead of the class.
786      *
787      * @return the estimated memory usage
788      */

789     int estimateMemoryUsage();
790 }
791
Popular Tags