Methods Summary |
---|
private java.lang.Object | getNextAttribute()Retrieves the next attribute in this SQLInputImpl object
as an Object in the Java programming language.
if (++idx >= attrib.length) {
throw new SQLException("SQLInputImpl exception: Invalid read " +
"position");
} else {
return attrib[idx];
}
|
public java.sql.Array | readArray()Reads an SQL ARRAY value from the stream and
returns it as an Array object in the Java programming
language.
This method does not perform type-safe checking to determine if the
returned type is the expected type as this responsibility is delegated
to the UDT mapping as implemented by a SQLData
implementation.
Array attrib = (Array)getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return null;
} else {
lastValueWasNull = false;
return attrib;
}
|
public java.io.InputStream | readAsciiStream()Returns the next attribute in this SQLInputImpl object
as a stream of ASCII characters.
This method does not perform type-safe checking to determine if the
returned type is the expected type as this responsibility is delegated
to the UDT mapping as implemented by a SQLData
implementation.
java.io.InputStream attrib = (java.io.InputStream)getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return null;
} else {
lastValueWasNull = false;
return attrib;
}
|
public java.math.BigDecimal | readBigDecimal()Retrieves the next attribute in this SQLInputImpl object
as a java.math.BigDecimal .
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a SQLData implementation.
java.math.BigDecimal attrib = (java.math.BigDecimal)getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return null;
} else {
lastValueWasNull = false;
return attrib;
}
|
public java.io.InputStream | readBinaryStream()Returns the next attribute in this SQLInputImpl object
as a stream of uninterpreted bytes.
This method does not perform type-safe checking to determine if the
returned type is the expected type as this responsibility is delegated
to the UDT mapping as implemented by a SQLData
implementation.
java.io.InputStream attrib = (java.io.InputStream)getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return null;
} else {
lastValueWasNull = false;
return attrib;
}
|
public java.sql.Blob | readBlob()Retrieves the BLOB value at the head of this
SQLInputImpl object as a Blob object
in the Java programming language.
This method does not perform type-safe checking to determine if the
returned type is the expected type as this responsibility is delegated
to the UDT mapping as implemented by a SQLData
implementation.
Blob attrib = (Blob)getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return null;
} else {
lastValueWasNull = false;
return attrib;
}
|
public boolean | readBoolean()Retrieves the next attribute in this SQLInputImpl object as
a boolean in the Java programming language.
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a SQLData
implementation.
Boolean attrib = (Boolean)getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return false;
} else {
lastValueWasNull = false;
return attrib.booleanValue();
}
|
public byte | readByte()Retrieves the next attribute in this SQLInputImpl object as
a byte in the Java programming language.
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a SQLData
implementation.
Byte attrib = (Byte)getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return (byte)0;
} else {
lastValueWasNull = false;
return attrib.byteValue();
}
|
public byte[] | readBytes()Retrieves the next attribute in this SQLInputImpl object
as an array of bytes.
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a SQLData implementation.
byte[] attrib = (byte[])getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return null;
} else {
lastValueWasNull = false;
return attrib;
}
|
public java.io.Reader | readCharacterStream()Retrieves the next attribute in this SQLInputImpl object
as a stream of Unicode characters.
This method does not perform type-safe checking to determine if the
returned type is the expected type as this responsibility is delegated
to the UDT mapping as implemented by a SQLData
implementation.
java.io.Reader attrib = (java.io.Reader)getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return null;
} else {
lastValueWasNull = false;
return attrib;
}
|
public java.sql.Clob | readClob()Retrieves the CLOB value at the head of this
SQLInputImpl object as a Clob object
in the Java programming language.
This method does not perform type-safe checking to determine if the
returned type is the expected type as this responsibility is delegated
to the UDT mapping as implemented by a SQLData
implementation.
Clob attrib = (Clob)getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return null;
} else {
lastValueWasNull = false;
return attrib;
}
|
public java.sql.Date | readDate()Retrieves the next attribute in this SQLInputImpl as
a java.sql.Date object.
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a SQLData implementation.
java.sql.Date attrib = (java.sql.Date)getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return null;
} else {
lastValueWasNull = false;
return attrib;
}
|
public double | readDouble()Retrieves the next attribute in this SQLInputImpl object
as a double in the Java programming language.
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a SQLData implementation.
Double attrib = (Double)getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return (double)0;
} else {
lastValueWasNull = false;
return attrib.doubleValue();
}
|
public float | readFloat()Retrieves the next attribute in this SQLInputImpl object
as a float in the Java programming language.
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a SQLData implementation.
Float attrib = (Float)getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return (float)0;
} else {
lastValueWasNull = false;
return attrib.floatValue();
}
|
public int | readInt()Retrieves the next attribute in this SQLInputImpl object
as an int in the Java programming language.
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a SQLData implementation.
Integer attrib = (Integer)getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return (int)0;
} else {
lastValueWasNull = false;
return attrib.intValue();
}
|
public long | readLong()Retrieves the next attribute in this SQLInputImpl object
as a long in the Java programming language.
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a SQLData implementation.
Long attrib = (Long)getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return (long)0;
} else {
lastValueWasNull = false;
return attrib.longValue();
}
|
public java.lang.Object | readObject()Retrieves the value at the head of this SQLInputImpl
object as an Object in the Java programming language. The
actual type of the object returned is determined by the default
mapping of SQL types to types in the Java programming language unless
there is a custom mapping, in which case the type of the object
returned is determined by this stream's type map.
The JDBC technology-enabled driver registers a type map with the stream
before passing the stream to the application.
When the datum at the head of the stream is an SQL NULL ,
this method returns null . If the datum is an SQL
structured or distinct type with a custom mapping, this method
determines the SQL type of the datum at the head of the stream,
constructs an object of the appropriate class, and calls the method
SQLData.readSQL on that object. The readSQL
method then calls the appropriate SQLInputImpl.readXXX
methods to retrieve the attribute values from the stream.
Object attrib = (Object)getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return null;
} else {
lastValueWasNull = false;
if (attrib instanceof Struct) {
Struct s = (Struct)attrib;
// look up the class in the map
Class c = (Class)map.get(s.getSQLTypeName());
if (c != null) {
// create new instance of the class
SQLData obj = null;
try {
obj = (SQLData)c.newInstance();
} catch (java.lang.InstantiationException ex) {
throw new SQLException("Unable to instantiate: " +
ex.getMessage());
} catch (java.lang.IllegalAccessException ex) {
throw new SQLException("Unable to instantiate: " +
ex.getMessage());
}
// get the attributes from the struct
Object attribs[] = s.getAttributes(map);
// create the SQLInput "stream"
SQLInputImpl sqlInput = new SQLInputImpl(attribs, map);
// read the values...
obj.readSQL(sqlInput, s.getSQLTypeName());
return (Object)obj;
}
}
return (Object)attrib;
}
|
public java.sql.Ref | readRef()Retrieves the value at the head of this SQLInputImpl object
as a Ref object in the Java programming language.
Ref attrib = (Ref)getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return null;
} else {
lastValueWasNull = false;
return attrib;
}
|
public short | readShort()Retrieves the next attribute in this SQLInputImpl object
as a short in the Java programming language.
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a SQLData implementation.
Short attrib = (Short)getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return (short)0;
} else {
lastValueWasNull = false;
return attrib.shortValue();
}
|
public java.lang.String | readString()Retrieves the next attribute in this SQLInputImpl object as
a String in the Java programming language.
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a SQLData
implementation.
String attrib = (String)getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return null;
} else {
lastValueWasNull = false;
return attrib;
}
|
public java.sql.Time | readTime()Retrieves the next attribute in this SQLInputImpl object as
a java.sql.Time object.
This method does not perform type-safe checking to determine if the
returned type is the expected type as this responsibility is delegated
to the UDT mapping as implemented by a SQLData
implementation.
java.sql.Time attrib = (java.sql.Time)getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return null;
} else {
lastValueWasNull = false;
return attrib;
}
|
public java.sql.Timestamp | readTimestamp()Retrieves the next attribute in this SQLInputImpl object as
a java.sql.Timestamp object.
java.sql.Timestamp attrib = (java.sql.Timestamp)getNextAttribute();
if (attrib == null) {
lastValueWasNull = true;
return null;
} else {
lastValueWasNull = false;
return attrib;
}
|
public java.net.URL | readURL()Reads an SQL DATALINK value from the stream and
returns it as an URL object in the Java programming
language.
This method does not perform type-safe checking to determine if the
returned type is the expected type as this responsibility is delegated
to the UDT mapping as implemented by a SQLData
implementation.
throw new SQLException("Operation not supported");
|
public boolean | wasNull()Ascertains whether the last value read from this
SQLInputImpl object was null .
return lastValueWasNull;
|