|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.afcs.warts.handlers.DataHandlerSupport
org.afcs.warts.handlers.BinaryDataHandler
The BinaryDataHandler class handles binary data, which is stored in columns of type RAW and VARBINARY.
The object returned by loadValue(java.sql.ResultSet, int), and expected by
bindValue() and printValue() is a
BinaryDataHolder instance.
LICENSE: This code is released to the public domain and may be used for any purpose whatsoever without permission or acknowledgment.
| Constructor Summary | |
BinaryDataHandler(TableDescription tableDescription,
ColumnDescription columnDescription)
Constructs a new instance on behalf of subclasses that will handle data values for the specified column in the specified table. |
|
| Method Summary | |
void |
bindNonNullValue(java.sql.PreparedStatement statement,
int variableIndex,
java.lang.Object value)
This method binds the specified non-null value (which should be a BinaryDataHolder instance) to
the specified index in the specified statement. |
java.lang.Object |
loadValue(java.sql.ResultSet resultSet,
int columnIndex)
Returns a BinaryDataHolder
instance with the integer value of the specified column from the specified
result set, if non-null. |
java.lang.String |
printNonNullValue(java.lang.Object value)
Returns a string that could be used in a SQL script to set the data contained in the value received, which should be a BinaryDataHolder instance. |
| Methods inherited from class org.afcs.warts.handlers.DataHandlerSupport |
getColumnDescription, getNullType, getTableDescription, isCharacterData, isNullHandler, loadBytesFromStream, logWrongValueTypeWarning, postProcessBind, requiresBindPostProcessing, requiresStreamedLoading, toString, verifyObjectIsString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.afcs.warts.handlers.DataHandler |
getNullType, isCharacterData, isNullHandler, postProcessBind, requiresBindPostProcessing, requiresStreamedLoading |
| Constructor Detail |
public BinaryDataHandler(TableDescription tableDescription,
ColumnDescription columnDescription)
tableDescription - The table that the handler will be handling data
for.columnDescription - The column that this class will be processing
data for.| Method Detail |
public void bindNonNullValue(java.sql.PreparedStatement statement,
int variableIndex,
java.lang.Object value)
throws java.sql.SQLException
BinaryDataHolder instance) to
the specified index in the specified statement. A warning message is logged
if the value is not a BinaryDataHolder.
bindNonNullValue in interface DataHandlerstatement - The statement to bind the value in.variableIndex - The index of the variable to bind.value - The value to bind to the statement.
java.sql.SQLException - If a SQL error occurs during binding.
public java.lang.Object loadValue(java.sql.ResultSet resultSet,
int columnIndex)
throws java.sql.SQLException
BinaryDataHolder
instance with the integer value of the specified column from the specified
result set, if non-null.
loadValue in interface DataHandlerresultSet - The result set to load data from.columnIndex - The index of the column to load data from.
java.sql.SQLException - If a SQL exception occurs while loading data.public java.lang.String printNonNullValue(java.lang.Object value)
BinaryDataHolder instance. The
current string is generated by encoding the binary data as hex, and
wrapping it in a call to the HEXTORAW() function.
printNonNullValue in interface DataHandlervalue - The object value to print.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||