Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.iapi.types
Class SQLClob  view SQLClob download SQLClob.java

java.lang.Object
  extended byorg.apache.derby.iapi.types.DataType
      extended byorg.apache.derby.iapi.types.SQLChar
          extended byorg.apache.derby.iapi.types.SQLVarchar
              extended byorg.apache.derby.iapi.types.SQLClob
All Implemented Interfaces:
CloneableObject, ConcatableDataValue, DataValueDescriptor, java.io.Externalizable, org.apache.derby.iapi.services.io.Formatable, Orderable, java.io.Serializable, org.apache.derby.iapi.services.io.Storable, org.apache.derby.iapi.services.io.StreamStorable, StringDataValue, org.apache.derby.iapi.services.io.TypedFormat, VariableSizeDataValue

public class SQLClob
extends SQLVarchar

SQLClob uses SQLVarchar by inheritance. It satisfies the DataValueDescriptor interfaces (i.e., OrderableDataType). It implements a String holder, e.g. for storing a column value; it can be specified when constructed to not allow nulls. Nullability cannot be changed after construction.

Because OrderableDataType is a subclass of DataType, SQLLongvarchar can play a role in either a DataType/ValueRow or a OrderableDataType/KeyRow, interchangeably.


Field Summary
 
Fields inherited from class org.apache.derby.iapi.types.SQLChar
arg_passer, RETURN_SPACE_THRESHOLD, stream
 
Fields inherited from interface org.apache.derby.iapi.types.StringDataValue
BOTH, LEADING, TRAILING
 
Fields inherited from interface org.apache.derby.iapi.types.Orderable
ORDER_OP_EQUALS, ORDER_OP_GREATEROREQUALS, ORDER_OP_GREATERTHAN, ORDER_OP_LESSOREQUALS, ORDER_OP_LESSTHAN
 
Fields inherited from interface org.apache.derby.iapi.types.VariableSizeDataValue
IGNORE_PRECISION
 
Constructor Summary
SQLClob()
           
SQLClob(java.lang.String val)
           
 
Method Summary
 boolean getBoolean()
          Gets the value in the data value descriptor as a boolean.
 byte getByte()
          Gets the value in the data value descriptor as a byte.
 byte[] getBytes()
          Gets the value in the data value descriptor as a byte array.
 DataValueDescriptor getClone()
          Clone this DataValueDescriptor.
 java.sql.Date getDate(java.util.Calendar cal)
          Gets the value in the data value descriptor as a java.sql.Date.
 double getDouble()
          Gets the value in the data value descriptor as a double.
 float getFloat()
          Gets the value in the data value descriptor as a float.
 int getInt()
          Gets the value in the data value descriptor as an int.
 long getLong()
          Gets the value in the data value descriptor as a long.
 DataValueDescriptor getNewNull()
          Get a new null value of the same type as this data value.
 java.lang.Object getObject()
          Gets the value in the data value descriptor as a Java Object.
 short getShort()
          Gets the value in the data value descriptor as a short.
 java.sql.Time getTime(java.util.Calendar cal)
          Gets the value in the data value descriptor as a java.sql.Time.
 java.sql.Timestamp getTimestamp(java.util.Calendar cal)
          Gets the value in the data value descriptor as a java.sql.Timestamp.
 int getTypeFormatId()
          Return my format identifier.
 java.lang.String getTypeName()
          Get the SQL name of the datatype
 void setBigDecimal(java.lang.Number bigDecimal)
          Only to be called when an application through JDBC is setting a SQLChar to a java.math.BigDecimal.
 void setValue(boolean theValue)
          Set the value.
 void setValue(byte theValue)
          Set the value of this DataValueDescriptor to the given byte value
 void setValue(byte[] theValue)
          Set the value of this DataValueDescriptor.
 void setValue(java.sql.Date theValue, java.util.Calendar cal)
          Set the value of this DataValueDescriptor.
 void setValue(double theValue)
          Set the value of this DataValueDescriptor to the given double value
 void setValue(float theValue)
          Set the value of this DataValueDescriptor to the given double value
 void setValue(int theValue)
          Set the value of this DataValueDescriptor to the given int value
 void setValue(long theValue)
          Set the value of this DataValueDescriptor to the given long value
 void setValue(java.lang.Object theValue)
          Set the value of this DataValueDescriptor to the given value
 void setValue(short theValue)
          Set the value of this DataValueDescriptor to the given short value
 void setValue(java.sql.Time theValue, java.util.Calendar cal)
          Set the value of this DataValueDescriptor.
 void setValue(java.sql.Timestamp theValue, java.util.Calendar cal)
          Set the value of this DataValueDescriptor.
 int typePrecedence()
          Each built-in type in JSQL has a precedence.
 int typeToBigDecimal()
          CHAR/VARCHAR/LONG VARCHAR implementation.
 
Methods inherited from class org.apache.derby.iapi.types.SQLVarchar
growBy, normalize, normalize
 
Methods inherited from class org.apache.derby.iapi.types.SQLChar
appendBlanks, charLength, cloneObject, compare, compare, concatenate, copyState, equals, estimateMemoryUsage, getCharArray, getCollationKey, getDate, getDateFormat, getDateFormat, getLength, getLocaleFinder, getNewVarchar, getStream, getString, getTime, getTimeFormat, getTimeFormat, getTimestamp, getTimestampFormat, getTimestampFormat, greaterOrEquals, greaterThan, hashCode, hasNonBlankChars, isNationalString, isNull, lessOrEquals, lessThan, like, like, loadStream, locate, lower, nationalGetDate, nationalGetTime, nationalGetTimestamp, nationalHashCode, notEquals, readExternal, readExternalFromArray, restoreToNull, returnStream, setFrom, setInto, setLocaleFinder, setStream, setValue, setValue, setValueFromResultSet, setWidth, stringCollatorCompare, stringCompare, stringCompare, stringCompare, substring, toString, trim, upper, writeExternal, XMLParse
 
Methods inherited from class org.apache.derby.iapi.types.DataType
checkHostVariable, coalesce, dataTypeConversion, equals, flip, genericSetObject, getNationalString, in, invalidFormat, isNotNull, isNullOp, outOfRange, setInto, setObjectForCast, setToNull, setValue, setValue, setValue, setValue, throwLangSetMismatch, throwLangSetMismatch
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.derby.iapi.types.DataValueDescriptor
checkHostVariable, coalesce, in, isNotNull, isNullOp, setInto, setObjectForCast, setToNull, setValue, setValue, setValue, setValue
 

Constructor Detail

SQLClob

public SQLClob()

SQLClob

public SQLClob(java.lang.String val)
Method Detail

getTypeName

public java.lang.String getTypeName()
Description copied from interface: DataValueDescriptor
Get the SQL name of the datatype

Specified by:
getTypeName in interface DataValueDescriptor
Overrides:
getTypeName in class SQLVarchar

getClone

public DataValueDescriptor getClone()
Description copied from interface: DataValueDescriptor
Clone this DataValueDescriptor. Results in a new object that has the same value as this but can be modified independently.

Specified by:
getClone in interface DataValueDescriptor
Overrides:
getClone in class SQLVarchar

getNewNull

public DataValueDescriptor getNewNull()
Description copied from interface: DataValueDescriptor
Get a new null value of the same type as this data value.

Specified by:
getNewNull in interface DataValueDescriptor
Overrides:
getNewNull in class SQLVarchar

getTypeFormatId

public int getTypeFormatId()
Return my format identifier.

Specified by:
getTypeFormatId in interface org.apache.derby.iapi.services.io.TypedFormat
Overrides:
getTypeFormatId in class SQLVarchar

typePrecedence

public int typePrecedence()
Description copied from interface: DataValueDescriptor
Each built-in type in JSQL has a precedence. This precedence determines how to do type promotion when using binary operators. For example, float has a higher precedence than int, so when adding an int to a float, the result type is float. The precedence for some types is arbitrary. For example, it doesn't matter what the precedence of the boolean type is, since it can't be mixed with other types. But the precedence for the number types is critical. The SQL standard requires that exact numeric types be promoted to approximate numeric when one operator uses both. Also, the precedence is arranged so that one will not lose precision when promoting a type.

Specified by:
typePrecedence in interface DataValueDescriptor
Overrides:
typePrecedence in class SQLVarchar

getObject

public java.lang.Object getObject()
                           throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Gets the value in the data value descriptor as a Java Object. The type of the Object will be the Java object type corresponding to the data value's SQL type. JDBC defines a mapping between Java object types and SQL types - we will allow that to be extended through user type definitions. Throws an exception if the data value is not an object (yeah, right).

Specified by:
getObject in interface DataValueDescriptor
Overrides:
getObject in class SQLChar

getBoolean

public boolean getBoolean()
                   throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Gets the value in the data value descriptor as a boolean. Throws an exception if the data value is not a boolean. For DataValueDescriptor, this is the preferred interface for BIT, but for this no-casting interface, it isn't, because BIT is stored internally as a Bit, not as a Boolean.

Specified by:
getBoolean in interface DataValueDescriptor
Overrides:
getBoolean in class SQLChar

getByte

public byte getByte()
             throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Gets the value in the data value descriptor as a byte. Throws an exception if the data value is not a byte.

Specified by:
getByte in interface DataValueDescriptor
Overrides:
getByte in class SQLChar

getShort

public short getShort()
               throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Gets the value in the data value descriptor as a short. Throws an exception if the data value is not a short.

Specified by:
getShort in interface DataValueDescriptor
Overrides:
getShort in class SQLChar

getInt

public int getInt()
           throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Gets the value in the data value descriptor as an int. Throws an exception if the data value is not an int.

Specified by:
getInt in interface DataValueDescriptor
Overrides:
getInt in class SQLChar

getLong

public long getLong()
             throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Gets the value in the data value descriptor as a long. Throws an exception if the data value is not a long.

Specified by:
getLong in interface DataValueDescriptor
Overrides:
getLong in class SQLChar

getFloat

public float getFloat()
               throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Gets the value in the data value descriptor as a float. Throws an exception if the data value is not a float.

Specified by:
getFloat in interface DataValueDescriptor
Overrides:
getFloat in class SQLChar

getDouble

public double getDouble()
                 throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Gets the value in the data value descriptor as a double. Throws an exception if the data value is not a double.

Specified by:
getDouble in interface DataValueDescriptor
Overrides:
getDouble in class SQLChar

typeToBigDecimal

public int typeToBigDecimal()
                     throws org.apache.derby.iapi.error.StandardException
Description copied from class: SQLChar
CHAR/VARCHAR/LONG VARCHAR implementation. Convert to a BigDecimal using getString.

Specified by:
typeToBigDecimal in interface DataValueDescriptor
Overrides:
typeToBigDecimal in class SQLChar

getBytes

public byte[] getBytes()
                throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Gets the value in the data value descriptor as a byte array. Throws an exception if the data value is not a byte array.

Specified by:
getBytes in interface DataValueDescriptor
Overrides:
getBytes in class DataType

getDate

public java.sql.Date getDate(java.util.Calendar cal)
                      throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Gets the value in the data value descriptor as a java.sql.Date. Throws an exception if the data value is not a Date.

Specified by:
getDate in interface DataValueDescriptor
Overrides:
getDate in class SQLChar

getTime

public java.sql.Time getTime(java.util.Calendar cal)
                      throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Gets the value in the data value descriptor as a java.sql.Time. Throws an exception if the data value is not a Time.

Specified by:
getTime in interface DataValueDescriptor
Overrides:
getTime in class SQLChar

getTimestamp

public java.sql.Timestamp getTimestamp(java.util.Calendar cal)
                                throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Gets the value in the data value descriptor as a java.sql.Timestamp. Throws an exception if the data value is not a Timestamp.

Specified by:
getTimestamp in interface DataValueDescriptor
Overrides:
getTimestamp in class SQLChar

setValue

public void setValue(java.sql.Time theValue,
                     java.util.Calendar cal)
              throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Set the value of this DataValueDescriptor.

Specified by:
setValue in interface DataValueDescriptor
Overrides:
setValue in class SQLChar

setValue

public void setValue(java.sql.Timestamp theValue,
                     java.util.Calendar cal)
              throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Set the value of this DataValueDescriptor.

Specified by:
setValue in interface DataValueDescriptor
Overrides:
setValue in class SQLChar

setValue

public void setValue(java.sql.Date theValue,
                     java.util.Calendar cal)
              throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Set the value of this DataValueDescriptor.

Specified by:
setValue in interface DataValueDescriptor
Overrides:
setValue in class SQLChar

setBigDecimal

public void setBigDecimal(java.lang.Number bigDecimal)
                   throws org.apache.derby.iapi.error.StandardException
Description copied from class: SQLChar
Only to be called when an application through JDBC is setting a SQLChar to a java.math.BigDecimal.

Specified by:
setBigDecimal in interface DataValueDescriptor
Overrides:
setBigDecimal in class SQLChar

setValue

public void setValue(int theValue)
              throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Set the value of this DataValueDescriptor to the given int value

Specified by:
setValue in interface DataValueDescriptor
Overrides:
setValue in class SQLChar

setValue

public void setValue(double theValue)
              throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Set the value of this DataValueDescriptor to the given double value

Specified by:
setValue in interface DataValueDescriptor
Overrides:
setValue in class SQLChar

setValue

public void setValue(float theValue)
              throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Set the value of this DataValueDescriptor to the given double value

Specified by:
setValue in interface DataValueDescriptor
Overrides:
setValue in class SQLChar

setValue

public void setValue(short theValue)
              throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Set the value of this DataValueDescriptor to the given short value

Specified by:
setValue in interface DataValueDescriptor
Overrides:
setValue in class SQLChar

setValue

public void setValue(long theValue)
              throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Set the value of this DataValueDescriptor to the given long value

Specified by:
setValue in interface DataValueDescriptor
Overrides:
setValue in class SQLChar

setValue

public void setValue(byte theValue)
              throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Set the value of this DataValueDescriptor to the given byte value

Specified by:
setValue in interface DataValueDescriptor
Overrides:
setValue in class SQLChar

setValue

public void setValue(boolean theValue)
              throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Set the value.

Specified by:
setValue in interface DataValueDescriptor
Overrides:
setValue in class SQLChar

setValue

public void setValue(byte[] theValue)
              throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Set the value of this DataValueDescriptor.

Specified by:
setValue in interface DataValueDescriptor
Overrides:
setValue in class SQLChar

setValue

public void setValue(java.lang.Object theValue)
              throws org.apache.derby.iapi.error.StandardException
Description copied from interface: DataValueDescriptor
Set the value of this DataValueDescriptor to the given value

Specified by:
setValue in interface DataValueDescriptor
Overrides:
setValue in class SQLChar