Methods Summary |
---|
public void | writeArray(java.sql.Array x)Writes an Array object in the Java
programming language to this SQLOutputImpl
object. The driver converts this value to a serializable
SerialArray SQL ARRAY
value before returning it to the database.
if (x == null) {
attribs.add(x);
return;
}
attribs.add(new SerialArray(x, map));
|
public void | writeAsciiStream(java.io.InputStream x)Writes a stream of ASCII characters to this
SQLOutputImpl object. The driver will do any necessary
conversion from ASCII to the database CHAR format.
BufferedReader bufReader = new BufferedReader(new InputStreamReader(x));
try {
int i;
while( (i=bufReader.read()) != -1 ) {
char ch = (char)i;
StringBuffer strBuf = new StringBuffer();
strBuf.append(ch);
String str = new String(strBuf);
String strLine = bufReader.readLine();
writeString(str.concat(strLine));
}
}catch(IOException ioe) {
throw new SQLException(ioe.getMessage());
}
|
public void | writeBigDecimal(java.math.BigDecimal x)Writes a java.math.BigDecimal object in the Java programming
language to this SQLOutputImpl object. The driver converts
it to an SQL NUMERIC before returning it to the database.
attribs.add(x);
|
public void | writeBinaryStream(java.io.InputStream x)Writes a stream of uninterpreted bytes to this SQLOutputImpl
object.
BufferedReader bufReader = new BufferedReader(new InputStreamReader(x));
try {
int i;
while( (i=bufReader.read()) != -1 ) {
char ch = (char)i;
StringBuffer strBuf = new StringBuffer();
strBuf.append(ch);
String str = new String(strBuf);
String strLine = bufReader.readLine();
writeString(str.concat(strLine));
}
} catch(IOException ioe) {
throw new SQLException(ioe.getMessage());
}
|
public void | writeBlob(java.sql.Blob x)Writes a Blob object in the Java programming language
to this SQLOutputImpl object. The driver converts
it to a serializable SerialBlob SQL BLOB value
before returning it to the database.
if (x == null) {
attribs.add(x);
return;
}
attribs.add(new SerialBlob(x));
|
public void | writeBoolean(boolean x)Writes a boolean in the Java programming language
to this SQLOutputImpl object. The driver converts
it to an SQL BIT before returning it to the database.
attribs.add(new Boolean(x));
|
public void | writeByte(byte x)Writes a byte in the Java programming language
to this SQLOutputImpl object. The driver converts
it to an SQL BIT before returning it to the database.
attribs.add(new Byte(x));
|
public void | writeBytes(byte[] x)Writes an array of bytes in the Java programming language
to this SQLOutputImpl object. The driver converts
it to an SQL VARBINARY or LONGVARBINARY
before returning it to the database.
attribs.add(x);
|
public void | writeCharacterStream(java.io.Reader x)Writes a stream of Unicode characters to this
SQLOutputImpl object. The driver will do any necessary
conversion from Unicode to the database CHAR format.
BufferedReader bufReader = new BufferedReader(x);
try {
int i;
while( (i = bufReader.read()) != -1 ) {
char ch = (char)i;
StringBuffer strBuf = new StringBuffer();
strBuf.append(ch);
String str = new String(strBuf);
String strLine = bufReader.readLine();
writeString(str.concat(strLine));
}
} catch(IOException ioe) {
}
|
public void | writeClob(java.sql.Clob x)Writes a Clob object in the Java programming language
to this SQLOutputImpl object. The driver converts
it to a serializable SerialClob SQL CLOB value
before returning it to the database.
if (x == null) {
attribs.add(x);
return;
}
attribs.add(new SerialClob(x));
|
public void | writeDate(java.sql.Date x)Writes a java.sql.Date object in the Java programming
language to this SQLOutputImpl object. The driver converts
it to an SQL DATE before returning it to the database.
attribs.add(x);
|
public void | writeDouble(double x)Writes a double in the Java programming language
to this SQLOutputImpl object. The driver converts
it to an SQL DOUBLE before returning it to the database.
attribs.add(new Double(x));
|
public void | writeFloat(float x)Writes a float in the Java programming language
to this SQLOutputImpl object. The driver converts
it to an SQL REAL before returning it to the database.
attribs.add(new Float(x));
|
public void | writeInt(int x)Writes an int in the Java programming language
to this SQLOutputImpl object. The driver converts
it to an SQL INTEGER before returning it to the database.
attribs.add(new Integer(x));
|
public void | writeLong(long x)Writes a long in the Java programming language
to this SQLOutputImpl object. The driver converts
it to an SQL BIGINT before returning it to the database.
attribs.add(new Long(x));
|
public void | writeObject(java.sql.SQLData x)Writes to the stream the data contained in the given
SQLData object.
When the SQLData object is null , this
method writes an SQL NULL to the stream.
Otherwise, it calls the SQLData.writeSQL
method of the given object, which
writes the object's attributes to the stream.
The implementation of the method SQLData.writeSQ
calls the appropriate SQLOutputImpl.writeXXX method(s)
for writing each of the object's attributes in order.
The attributes must be read from an SQLInput
input stream and written to an SQLOutputImpl
output stream in the same order in which they were
listed in the SQL definition of the user-defined type.
/*
* Except for the types that are passed as objects
* this seems to be the only way for an object to
* get a null value for a field in a structure.
*
* Note: this means that the class defining SQLData
* will need to track if a field is SQL null for itself
*/
if (x == null) {
attribs.add(x);
return;
}
/*
* We have to write out a SerialStruct that contains
* the name of this class otherwise we don't know
* what to re-instantiate during readSQL()
*/
attribs.add(new SerialStruct((SQLData)x, map));
|
public void | writeRef(java.sql.Ref x)Writes a Ref object in the Java programming language
to this SQLOutputImpl object. The driver converts
it to a serializable SerialRef SQL REF value
before returning it to the database.
if (x == null) {
attribs.add(x);
return;
}
attribs.add(new SerialRef(x));
|
public void | writeShort(short x)Writes a short in the Java programming language
to this SQLOutputImpl object. The driver converts
it to an SQL SMALLINT before returning it to the database.
attribs.add(new Short(x));
|
public void | writeString(java.lang.String x)Writes a String in the Java programming language
to this SQLOutputImpl object. The driver converts
it to an SQL CHAR , VARCHAR , or
LONGVARCHAR before returning it to the database.
//System.out.println("Adding :"+x);
attribs.add(x);
|
public void | writeStruct(java.sql.Struct x)Writes a Struct object in the Java
programming language to this SQLOutputImpl
object. The driver converts this value to an SQL structured type
before returning it to the database.
This method should be used when an SQL structured type has been
mapped to a Struct object in the Java programming
language (the standard mapping). The method
writeObject should be used if an SQL structured type
has been custom mapped to a class in the Java programming language.
SerialStruct s = new SerialStruct(x,map);;
attribs.add(s);
|
public void | writeTime(java.sql.Time x)Writes a java.sql.Time object in the Java programming
language to this SQLOutputImpl object. The driver converts
it to an SQL TIME before returning it to the database.
attribs.add(x);
|
public void | writeTimestamp(java.sql.Timestamp x)Writes a java.sql.Timestamp object in the Java programming
language to this SQLOutputImpl object. The driver converts
it to an SQL TIMESTAMP before returning it to the database.
attribs.add(x);
|
public void | writeURL(java.net.URL url)Writes an java.sql.Type.DATALINK object in the Java
programming language to this SQLOutputImpl object. The
driver converts this value to a serializable SerialDatalink
SQL DATALINK value before return it to the database.
if (url == null) {
attribs.add(url);
return;
}
attribs.add(new SerialDatalink(url));
|