public class ValueLobDb extends Value implements Value.ValueClob, Value.ValueBlob
Value.ValueBlob, Value.ValueClob
ARRAY, BLOB, BOOLEAN, BYTE, BYTES, CLOB, DATE, DECIMAL, DOUBLE, FLOAT, INT, JAVA_OBJECT, LONG, NULL, RESULT_SET, SHORT, STRING, STRING_FIXED, STRING_IGNORECASE, TIME, TIMESTAMP, TYPE_COUNT, UNKNOWN, UUID
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the underlying resource, if any.
|
protected int |
compareSecure(Value v,
CompareMode mode)
Compare the value with another value of the same type.
|
Value |
convertPrecision(long precision,
boolean force)
Convert the precision to the requested value.
|
Value |
convertTo(int t)
Convert a lob to another data type.
|
ValueLobDb |
copyToTemp()
Create an independent copy of this temporary value.
|
static ValueLobDb |
create(int type,
LobStorage lobStorage,
String fileName,
int tableId,
long id,
long precision)
Create a LOB value.
|
static ValueLobDb |
createSmallLob(int type,
byte[] small,
long precision)
Create a small lob using the given byte array.
|
static ValueLobDb |
createTempBlob(InputStream in,
long length,
DataHandler handler)
Create a temporary BLOB value from a stream.
|
static ValueLobDb |
createTempClob(Reader in,
long length,
DataHandler handler)
Create a temporary CLOB value from a stream.
|
boolean |
equals(Object other)
Check if the two values have the same hash code.
|
byte[] |
getBytes() |
byte[] |
getBytesNoCopy() |
int |
getDisplaySize()
Get the display size in characters.
|
InputStream |
getInputStream() |
long |
getLobId() |
int |
getMemory()
Get the memory used by this object.
|
Object |
getObject()
Get the value as an object.
|
long |
getPrecision()
Get the precision.
|
Reader |
getReader() |
byte[] |
getSmall()
Get the data if this a small lob value.
|
String |
getSQL()
Get the SQL expression for this value.
|
String |
getString()
Get the value as a string.
|
int |
getTableId()
Get the current table id of this lob.
|
String |
getTraceSQL()
Get a medium size SQL expression for debugging or tracing.
|
int |
getType()
Get the value type.
|
int |
hashCode() |
boolean |
isFileBased()
Check if this value is stored in it's own file.
|
boolean |
isLinked()
Check if this value is linked to a specific table.
|
Value |
link(DataHandler h,
int tabId)
Link a large value to a given table.
|
void |
set(PreparedStatement prep,
int parameterIndex)
Set the value as a parameter in a prepared statement.
|
void |
setPrecision(long precision) |
String |
toString() |
void |
unlink()
Mark any underlying resource as 'not linked to any table'.
|
add, checkPrecision, clearCache, compareTo, compareTypeSave, convertScale, divide, getBigDecimal, getBoolean, getByte, getDate, getDouble, getFloat, getHigherOrder, getInt, getLong, getResultSet, getScale, getShort, getSignum, getTime, getTimestamp, modulus, multiply, negate, subtract, throwUnsupportedExceptionForType
public static ValueLobDb create(int type, LobStorage lobStorage, String fileName, int tableId, long id, long precision)
type
- the typelobStorage
- the storagefileName
- the file name (may be null)tableId
- the table idid
- the lob idprecision
- the precision (number of bytes / characters)public static ValueLobDb createSmallLob(int type, byte[] small, long precision)
type
- the type (Value.BLOB or CLOB)small
- the byte arrayprecision
- the precisionpublic Value convertTo(int t)
public boolean isLinked()
Value
public void close()
Value
public void unlink()
Value
public Value link(DataHandler h, int tabId)
Value
public int getTableId()
getTableId
in class Value
public int getType()
Value
public long getPrecision()
Value
getPrecision
in class Value
public byte[] getBytesNoCopy()
getBytesNoCopy
in class Value
protected int compareSecure(Value v, CompareMode mode)
Value
compareSecure
in class Value
v
- the other valuemode
- the compare modepublic Object getObject()
Value
public InputStream getInputStream()
getInputStream
in class Value
public void set(PreparedStatement prep, int parameterIndex) throws SQLException
Value
set
in class Value
prep
- the prepared statementparameterIndex
- the parameter indexSQLException
public String getSQL()
Value
public String getTraceSQL()
Value
getTraceSQL
in class Value
public byte[] getSmall()
public int getDisplaySize()
Value
getDisplaySize
in class Value
public boolean equals(Object other)
Value
public boolean isFileBased()
Value
isFileBased
in class Value
public int getMemory()
Value
public ValueLobDb copyToTemp()
copyToTemp
in class Value
public long getLobId()
public void setPrecision(long precision)
public static ValueLobDb createTempClob(Reader in, long length, DataHandler handler)
in
- the readerlength
- the number of characters to read, or -1 for no limithandler
- the data handlerpublic static ValueLobDb createTempBlob(InputStream in, long length, DataHandler handler)
in
- the input streamlength
- the number of characters to read, or -1 for no limithandler
- the data handlerpublic Value convertPrecision(long precision, boolean force)
Value
convertPrecision
in class Value
precision
- the new precisionforce
- true if losing numeric precision is allowedCopyright © 2012 JBoss by Red Hat. All Rights Reserved.