Parameter
|
Type
|
Description
|
INPUT
|
|
|
pBuffer
|
ByteBuffer
|
Byte buffer into which the NULL/not NULL indicator, lengths of string data, and the values for primitive types are to be added. The size of this buffer is controlled by the ServiceJavaIPByteBufferSize service attribute.
|
pCharData
|
char[ ]
|
char array into which data for CHAR, and VARCHAR, are added. Initially it points to the beginning. The size of this buffer is controlled by the ServiceJavaIPStringBufferSize service attribute. |
OUTPUT
|
|
|
piNumResRows
|
xo_int
|
Number of rows added to the buffer.
|
piStrDataLen
|
xo_int
|
Total length of CHAR and VARCHAR data written to the pCharData char array.
|
piStatus
|
xo_int
|
Status of the operation:
OADS_BUFFER_FULL – indicates that the next block of rows have been added to the buffer.
OADS_NO_DATA – all available rows have been added to the buffer or there are no rows to retrieve.
OADS_ERROR – error fetching a row. |
RETURN
|
|
|
|
Object[ ]
|
Array of objects for LONG data types. Each element represents a long column value. Each LONG column has one object element in the array.
Your IP must create the array return to SDK. We expect char[ ] object for LONG_VARCHAR data type. We expect byte[ ] object for LONG_VARBINARY data type. If the result set includes no long data then return NULL.
|
JDBC Data Type
|
OpenAccess SDK XO Type
|
Method for Adding the Value
|
TINYINT
SMALLINT
BIT
|
XO_TYPE_SMALLINT
|
Short value.
short sVal = rs.getShort(i);
bWasNull = rs.wasNull();
if(bWasNull)
{
pBuffer.put(NULL_INDICATOR);
}
else
{
pBuffer.put(NOT_NULL_INDICATOR);
pBuffer.putShort(sVal);
}
|
INTEGER
|
XO_TYPE_INTEGER
|
int iVal = rs.getInt(i);
bWasNull = rs.wasNull();
if(bWasNull)
{
pBuffer.put(NULL_INDICATOR);
}
else
{
pBufferr.put(NOT_NULL_INDICATOR);
pBuffer.putInt(iVal);
}
|
BIGINT
|
XO_TYPE_BIGINT
|
long lVal = rs.getLong(i);
bWasNull = rs.wasNull();
if(bWasNull)
{
pBuffer.put(bNullIndicator);
}
else
{
pBuffer.put(bNotNullIndicator);
pBuffer.putLong(lVal);
}
|
REAL
|
XO_TYPE_REAL
|
float iVal = rs.getFloat(i);
bWasNull = rs.wasNull();
if(bWasNull)
{
pBuffer.put(NULL_INDICATOR);
}
else
{
pBufferr.put(NOT_NULL_INDICATOR);
pBuffer.putFloat(iVal);
}
|
FLOAT
DOUBLE
|
XO_TYPE_DOUBLE
|
double iVal = rs.getDouble(i);
bWasNull = rs.wasNull();
if(bWasNull)
{
pBuffer.put(NULL_INDICATOR);
}
else
{
pBufferr.put(NOT_NULL_INDICATOR);
pBuffer.putDouble(iVal);
}
|
NUMERIC
DECIMAL
CHAR
VARCHAR
|
XO_TYPE_NUMERIC
XO_TYPE_NUMERIC
XO_TYPE_[W]CHAR
XO_TYPE_[W]VARCHAR |
String str = rs.getString(i);
bWasNull = rs.wasNull();
if(bWasNull)
{
pBuffer.put(NULL_INDICATOR);
}
else
{
int iLen = str.length();
pBufferr.put(NOT_NULL_INDICATOR);
pBufferr.putInt(iLen);
str.getChars(0,iLen,pCharData,iCharDataIndex);
iCharDataIndex += iLen;
}
|
LONGVARCHAR
|
XO_TYPE_[W]LONGVARCHAR
|
String str = rs.getString(i);
bWasNull = rs.wasNull();
if(bWasNull)
{
pBuffer.put(bNullIndicator);
}
else
{
int iLen = str.length();
pBuffer.put(bNotNullIndicator);
pBuffer.putInt(iLen);
LargeObjList.add(str.toCharArray());
}
}
|
DATE
|
XO_TYPE_DATE
|
Date dtVal = rs.getDate(i);
bWasNull = rs.wasNull();
if(bWasNull)
{
pBuffer.put(NULL_INDICATOR);
}else
{
pBuffer.put(NOT_NULL_INDICATOR);
pBuffer.putShort((short)(dtVal.getYear() + 1900));
pBuffer.put((byte)dtVal.getMonth())
pBuffer.put((byte)dtVal.getDate());
}
|
TIME
|
XO_TYPE_TIME
|
Time tVal = rs.getTime(i);
bWasNull = rs.wasNull();
if(bWasNull)
{
pBuffer.put(NULL_INDICATOR);
}else
{
pBuffer.put(NOT_NULL_INDICATOR);
pBuffer.put(tVal.getHours());
pBuffer.put(tVal.getMinutes())
pBuffer.put(tVal.getSeconds());
}
|
TIMESTAMP
|
XO_TYPE_TIMESTAMP
|
Timestamp tsVal = rs.getTimestamp(i);
bWasNull = rs.wasNull();
if(bWasNull)
{
pBuffer.put(NULL_INDICATOR);
}else
{
pBuffer.put(NOT_NULL_INDICATOR);
pBuffer.putShort(dtVal.getYear() + 1900);
pBuffer.put(dtVal.getMonth())
pBuffer.put(dtVal.getDate());
pBuffer.put(tsVal.getHours());
pBuffer.put(tsVal.getMinutes())
pBuffer.put(tsVal.getSeconds());
pBuffer.putInt(0); /* Fraction */
}
|
BINARY
VARBINARY
|
XO_TYPE_BINARY XO_TYPE_VARBINARY |
byte[] bData = rs.getBytes(i); bWasNull = rs.wasNull();
if(bWasNull)
{
pBuffer.put(NULL_INDICATOR);
}
else
{
pBuffer.put(NOT_NULL_INDICATOR);
pBuffer.putInt(bData.length());
pBuffer.put(bData); }
|
LONGVARBINARY
|
XO_TYPE_LONGVARBINARY
|
byte[] bData = rs.getBytes(i);
bWasNull = rs.wasNull();
if(bWasNull)
{
pBuffer.put(bNullIndicator);
}
else
{
pBuffer.put(bNotNullIndicator);
pBuffer.putInt(bData.length);
LargeObjList.add(bData);
}
|