本文整理汇总了Java中java.sql.SQLInput.readLong方法的典型用法代码示例。如果您正苦于以下问题:Java SQLInput.readLong方法的具体用法?Java SQLInput.readLong怎么用?Java SQLInput.readLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.sql.SQLInput
的用法示例。
在下文中一共展示了SQLInput.readLong方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readSQL
import java.sql.SQLInput; //导入方法依赖的package包/类
@Override
public void readSQL(SQLInput stream, String typeName) throws SQLException {
sqlType = typeName;
types[stringPos] = stream.readString();
types[datePos] = stream.readDate();
types[timePos] = stream.readTime();
types[timestampPos] = stream.readTimestamp();
types[intPos] = stream.readInt();
types[longPos] = stream.readLong();
types[shortPos] = stream.readShort();
types[bigDecimalPos] = stream.readBigDecimal();
types[doublePos] = stream.readDouble();
types[booleanPos] = stream.readBoolean();
types[floatPos] = stream.readFloat();
types[bytePos] = stream.readByte();
types[bytesPos] = stream.readBytes();
}
示例2: readSQL
import java.sql.SQLInput; //导入方法依赖的package包/类
/**
* Read object from SQLInput stream.
*/
public void readSQL(SQLInput stream, String typeName) throws SQLException {
long n = stream.readLong();
long d = stream.readLong();
this.value = new Rational(n, d);
this.typeName = typeName;
}
示例3: readSQL
import java.sql.SQLInput; //导入方法依赖的package包/类
@Function(effects=IMMUTABLE, onNullInput=RETURNS_NULL)
@Override
public void readSQL(SQLInput stream, String typeName) throws SQLException
{
m_typeName = typeName;
if ( ! s_bigdec.equals(stream.readBigDecimal()) )
throw new SQLException("BigDecimal mismatch");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
InputStream is = stream.readBinaryStream();
try
{
for ( int b ; -1 != (b = is.read()) ; )
baos.write(b);
}
catch ( IOException e )
{
throw new SQLException("Reading binary stream",
"58030", e);
}
if ( ! Arrays.equals(s_utfgedicht, baos.toByteArray()) )
throw new SQLException("binaryStream mismatch");
if ( s_bool != stream.readBoolean() )
throw new SQLException("boolean mismatch");
if ( s_byte != stream.readByte() )
throw new SQLException("byte mismatch");
if ( ! Arrays.equals(s_utfgedicht, stream.readBytes()) )
throw new SQLException("bytes mismatch");
String charstream = new Scanner(stream.readCharacterStream())
.useDelimiter("\\A").next();
if ( ! s_gedicht.equals(charstream) )
throw new SQLException("characterStream mismatch");
if ( ! s_date.equals(stream.readDate()) )
throw new SQLException("date mismatch");
if ( s_double != stream.readDouble() )
throw new SQLException("double mismatch");
if ( s_float != stream.readFloat() )
throw new SQLException("float mismatch");
if ( s_int != stream.readInt() )
throw new SQLException("int mismatch");
if ( s_long != stream.readLong() )
throw new SQLException("long mismatch");
if ( s_short != stream.readShort() )
throw new SQLException("short mismatch");
if ( ! s_gedicht.equals(stream.readString()) )
throw new SQLException("string mismatch");
if ( ! s_time.equals(stream.readTime()) )
throw new SQLException("time mismatch");
if ( ! s_timestamp.equals(stream.readTimestamp()) )
throw new SQLException("timestamp mismatch");
if ( ! s_url.equals(stream.readURL()) )
throw new SQLException("url mismatch");
}