public abstract class TableResultSet
extends java.lang.Object
As transport, any instance of this class will be wrapped in a TableWrapper
instance
internally by P2J.
Note: In the process of building the internal data structures for dynamic temp-tables, internal generic indexed names are used for columns. To obtain the expected column name, the metadata will return the column's legacy name instead of internal database name.
Type | Property and Description |
---|---|
abstract PropertyDefinition |
next
Used in conjunction with
hasMoreProperties() , it provides a mechanism for
subclasses to send the property list in an iterator-like form. |
Modifier and Type | Class and Description |
---|---|
private class |
TableResultSet.DataHandler
Handler for the
ResultSet proxy. |
private class |
TableResultSet.MetaDataHandler
Handler for the
ResultSetMetaData proxy. |
Modifier and Type | Field and Description |
---|---|
private boolean |
append
Flag indicating this table is sent in APPEND mode.
|
private boolean |
input
Flag indicating this table is sent in INPUT or INPUT-OUTPUT mode.
|
private static java.util.logging.Logger |
LOG
logger
|
private boolean |
output
Flag indicating this table is sent in OUTPUT or INPUT-OUTPUT mode.
|
private java.util.List<PropertyDefinition> |
properties
The metadata sent by a remote side, after the remote appserver call, when this table is in
OUTPUT or INPUT-OUTPUT mode.
|
private java.util.List<java.lang.Object[]> |
rows
The data sent by a remote side, after the remote appserver call, when this table is in
OUTPUT or INPUT-OUTPUT mode.
|
Constructor and Description |
---|
TableResultSet()
Default c'tor, explicitly added to allow instances of this class to be created on
deserialization.
|
TableResultSet(boolean input,
boolean output,
boolean append)
Create a new instance of this result set.
|
Modifier and Type | Method and Description |
---|---|
java.sql.ResultSet |
asResultSet()
Get the data sent by a remote side, after the remote appserver call, as a
ResultSet
instance. |
java.util.List<PropertyDefinition> |
getProperties()
Get the metadata sent by a remote side, after the remote appserver call.
|
java.util.List<java.lang.Object[]> |
getRows()
Get the data sent by a remote side, after the remote appserver call.
|
abstract boolean |
hasMoreProperties()
Used in conjunction with
nextProperty() , it provides a mechanism for subclasses
to send the property list in an iterator-like form. |
abstract boolean |
hasMoreRows()
Used in conjunction with
hasMoreRows() , it provides a mechanism for subclasses to
send the data in an iterator-like form. |
boolean |
isAppend()
Check if this table is in APPEND mode.
|
boolean |
isInput()
Check if this table is in INPUT or INPUT-OUTPUT mode.
|
boolean |
isOutput()
Check if this table is in OUTPUT or INPUT-OUTPUT mode.
|
abstract PropertyDefinition |
nextProperty()
Used in conjunction with
hasMoreProperties() , it provides a mechanism for
subclasses to send the property list in an iterator-like form. |
abstract java.lang.Object[] |
nextRow()
Used in conjunction with
hasMoreRows() , it provides a mechanism for subclasses to
send the data in an iterator-like form. |
void |
setProperties(java.util.List<PropertyDefinition> properties)
Set the metadata sent by a remote side, after the remote appserver call.
|
void |
setRows(java.util.List<java.lang.Object[]> rows)
Set the data sent by a remote side, after the remote appserver call.
|
public abstract PropertyDefinition nextProperty
hasMoreProperties()
, it provides a mechanism for
subclasses to send the property list in an iterator-like form.
Override this method so that when hasMoreProperties()
returns true
, this
will return the name of the next property in the list.
WARNING: this allows only one iteration over the properties and is for internal usage
only. Use asResultSet()
and the associated ResultSetMetaData
instead.
private static final java.util.logging.Logger LOG
private boolean input
private boolean output
private boolean append
private java.util.List<java.lang.Object[]> rows
private java.util.List<PropertyDefinition> properties
public TableResultSet()
public TableResultSet(boolean input, boolean output, boolean append)
input
- Flag indicating this table is sent in INPUT or INPUT-OUTPUT mode.output
- Flag indicating this table is sent in OUTPUT or INPUT-OUTPUT mode.append
- Flag indicating this table is sent in APPEND mode.public abstract boolean hasMoreProperties()
nextProperty()
, it provides a mechanism for subclasses
to send the property list in an iterator-like form.
Override this method so that it returns false
when nextProperty()
has
sent all properties.
WARNING: this allows only one iteration over the properties and is for internal usage
only. Use asResultSet()
and the associated ResultSetMetaData
instead.
false
.public abstract PropertyDefinition nextProperty()
hasMoreProperties()
, it provides a mechanism for
subclasses to send the property list in an iterator-like form.
Override this method so that when hasMoreProperties()
returns true
, this
will return the name of the next property in the list.
WARNING: this allows only one iteration over the properties and is for internal usage
only. Use asResultSet()
and the associated ResultSetMetaData
instead.
public abstract boolean hasMoreRows()
hasMoreRows()
, it provides a mechanism for subclasses to
send the data in an iterator-like form.
Override this method so that it returns false
when nextRow()
has sent
all data.
WARNING: this allows only one iteration over the properties and is for internal usage
only. Use asResultSet()
instead.
false
.public abstract java.lang.Object[] nextRow()
hasMoreRows()
, it provides a mechanism for subclasses to
send the data in an iterator-like form.
Override this method so that when hasMoreRows()
returns true
, this will
return the next row in the table.
WARNING: this allows only one iteration over the properties and is for internal usage
only. Use asResultSet()
and instead.
null
.public void setRows(java.util.List<java.lang.Object[]> rows)
rows
- The data sent by the remote side.public java.util.List<java.lang.Object[]> getRows()
public void setProperties(java.util.List<PropertyDefinition> properties)
properties
- The metadata sent by the remote side.public java.util.List<PropertyDefinition> getProperties()
public boolean isInput()
input
flag.public boolean isOutput()
output
flag.public boolean isAppend()
append
flag.public java.sql.ResultSet asResultSet()
ResultSet
instance. This will be non-null only if the parameter is in OUTPUT or INPUT-OUTPUT mode.