public abstract class AbstractBaseUdx
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractBaseUdx.ColumnTransferInfo |
Modifier and Type | Field and Description |
---|---|
protected static int |
CACHE_IDX |
protected static int |
COL_IDX |
protected static int |
COL_INFO_ENTRY_LEN |
protected static int |
COL_MAP_ENTRY_LEN |
protected static int |
COL_TYPE |
protected java.util.Map<java.lang.String,int[]> |
colMap
UDX output column info.
|
protected java.util.Map<java.util.Map<java.lang.String,int[]>,AbstractBaseUdx.ColumnTransferInfo[]> |
columnMaps |
protected static int |
FAST_COPY_IDX |
protected static int |
IN_IDX |
protected java.sql.ResultSet |
inputRows |
protected static int |
OUT_IDX |
protected static int |
OUT_TYPE |
protected AbstractBaseUdx.ColumnTransferInfo[] |
passList |
protected java.util.Map<java.lang.String,int[]> |
passMap
Deprecated.
|
protected java.sql.PreparedStatement |
results |
protected java.util.logging.Logger |
tracer
Tracing / logging facility.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractBaseUdx(java.util.logging.Logger tracer,
java.sql.ResultSet inputRows,
java.sql.PreparedStatement results)
Creates a new AbstractBaseUdx.
|
Modifier and Type | Method and Description |
---|---|
protected AbstractBaseUdx.ColumnTransferInfo[] |
columnMapFor(java.util.Map<java.lang.String,int[]> xferMap) |
protected java.util.HashMap<java.lang.String,int[]> |
createColumnTransferMap(java.util.Map<java.lang.String,int[]> outColMap,
java.sql.ResultSetMetaData inMeta,
java.lang.String mapType)
Creates a column transfer map which identifies like-named columns
in the specified input ResultSet and the specified output column map
whose data is to be copied from input to output.
|
protected java.util.HashMap<java.lang.String,int[]> |
createColumnTransferMap(java.sql.ResultSetMetaData inMeta,
java.lang.String mapType)
Creates a column transfer map which identifies like-named columns
in the specified input ResultSet and the UDX output PreparedStatement
whose data is to be copied from input to output.
|
protected java.util.Map<java.lang.String,int[]> |
createPassMap()
Creates pass-through column map.
|
protected void |
passThruColumns() |
protected void |
setParam(java.sql.PreparedStatement results,
java.lang.String colName,
int colNum,
int colType,
java.lang.Object value)
Sets value for parameter
colNum in output ("results") row. |
protected void |
transferColumns(java.sql.ResultSet inputRows,
java.lang.Object[] row,
java.sql.PreparedStatement results,
AbstractBaseUdx.ColumnTransferInfo[] columnTransfers)
Transfers column data from input ResultSet
to output ("results") PreparedStatement
using specified column transfer map.
|
protected void |
transferColumns(java.sql.ResultSet inputRows,
java.lang.Object[] row,
java.sql.PreparedStatement results,
java.util.Map<java.lang.String,int[]> xferMap)
Deprecated.
|
protected void |
transferColumns(java.sql.ResultSet inputRows,
java.sql.PreparedStatement results,
AbstractBaseUdx.ColumnTransferInfo[] columnTransfers) |
protected static final int IN_IDX
protected static final int OUT_IDX
protected static final int CACHE_IDX
protected static final int OUT_TYPE
protected static final int FAST_COPY_IDX
protected static final int COL_MAP_ENTRY_LEN
protected static final int COL_IDX
protected static final int COL_TYPE
protected static final int COL_INFO_ENTRY_LEN
protected final java.util.logging.Logger tracer
protected java.util.Map<java.lang.String,int[]> colMap
COL_IDX
, COL_TYPE
.
The length of the array is set by COL_INFO_ENTRY_LEN
.@Deprecated protected java.util.Map<java.lang.String,int[]> passMap
IN_IDX
, OUT_IDX
,
CACHE_IDX
, OUT_TYPE
.
The length of the array is set by COL_MAP_ENTRY_LEN
.protected AbstractBaseUdx.ColumnTransferInfo[] passList
protected java.sql.ResultSet inputRows
protected java.sql.PreparedStatement results
protected final java.util.Map<java.util.Map<java.lang.String,int[]>,AbstractBaseUdx.ColumnTransferInfo[]> columnMaps
protected AbstractBaseUdx(java.util.logging.Logger tracer, java.sql.ResultSet inputRows, java.sql.PreparedStatement results) throws java.sql.SQLException
tracer
- logger for tracinginputRows
- streaming inputresults
- streaming outputjava.sql.SQLException
- metadata exceptionsprotected java.util.Map<java.lang.String,int[]> createPassMap() throws java.sql.SQLException
IN_IDX
, OUT_IDX
,
CACHE_IDX
, OUT_TYPE
.
The length of the array is set by COL_MAP_ENTRY_LEN
.java.sql.SQLException
- metadata exceptionsprotected java.util.HashMap<java.lang.String,int[]> createColumnTransferMap(java.sql.ResultSetMetaData inMeta, java.lang.String mapType) throws java.sql.SQLException
IN_IDX
, OUT_IDX
,
CACHE_IDX
, OUT_TYPE
.
The length of the array is set by COL_MAP_ENTRY_LEN
.inMeta
- input rowtypemapType
- used in trace log to identify the transfer mapjava.sql.SQLException
- metadata exceptionsprotected java.util.HashMap<java.lang.String,int[]> createColumnTransferMap(java.util.Map<java.lang.String,int[]> outColMap, java.sql.ResultSetMetaData inMeta, java.lang.String mapType) throws java.sql.SQLException
IN_IDX
, OUT_IDX
,
CACHE_IDX
, OUT_TYPE
.
The length of the array is set by COL_MAP_ENTRY_LEN
.outColMap
- maps output column names to output indexesinMeta
- ResultSetMetaData for the input rowtypemapType
- used in trace log to identify the transfer mapjava.sql.SQLException
- metadata exceptionsprotected void passThruColumns() throws java.sql.SQLException
java.sql.SQLException
@Deprecated protected void transferColumns(java.sql.ResultSet inputRows, java.lang.Object[] row, java.sql.PreparedStatement results, java.util.Map<java.lang.String,int[]> xferMap) throws java.sql.SQLException
If inputRows
is not null it is used as the data source,
otherwise row
is used as the data source.
If both inputRows
and row
are null the
corresponding output columns are assigned SQL null.
If both inputRows
and row
are not null,
then inputRows
is used as the data source
and row
is updated with column values
from inputRows
.
inputRows
- data source, can be table or streaming or nullrow
- is the set of data objects to be applied to resultsresults
- data destinationxferMap
- column transfer mapjava.sql.SQLException
- failed to transfer data
from input ResultSet to output PreparedStatementprotected void transferColumns(java.sql.ResultSet inputRows, java.lang.Object[] row, java.sql.PreparedStatement results, AbstractBaseUdx.ColumnTransferInfo[] columnTransfers) throws java.sql.SQLException
If inputRows
is not null it is used as the data source,
otherwise row
is used as the data source.
If both inputRows
and row
are null the
corresponding output columns are assigned SQL null.
If both inputRows
and row
are not null,
then inputRows
is used as the data source
and row
is updated with column values
from inputRows
.
inputRows
- data source, can be table or streaming or nullrow
- is the set of data objects to be applied to resultsresults
- data destinationcolumnTransfers
- column transfer listjava.sql.SQLException
- failed to transfer data
from input ResultSet to output PreparedStatementprotected void transferColumns(java.sql.ResultSet inputRows, java.sql.PreparedStatement results, AbstractBaseUdx.ColumnTransferInfo[] columnTransfers) throws java.sql.SQLException
java.sql.SQLException
protected AbstractBaseUdx.ColumnTransferInfo[] columnMapFor(java.util.Map<java.lang.String,int[]> xferMap)
protected void setParam(java.sql.PreparedStatement results, java.lang.String colName, int colNum, int colType, java.lang.Object value) throws java.sql.SQLException
colNum
in output ("results") row.
The parameter name, colName
is used only to identify
the column that had the error when logging data errors.results
- stream of output rowscolName
- name of column being set (used for trace log)colNum
- index of column to set (1-origined)colType
- SQL Type for setting null valuevalue
- value to setjava.sql.SQLException
- generally some form of data errorCopyright (C) 2003-2021 SQLstream, Inc.