|
|||||||||
| Home >> All >> org >> apache >> xalan >> lib >> [ sql overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.xalan.lib.sql
Class SQLDocument

java.lang.Objectorg.apache.xml.dtm.ref.DTMDefaultBase
org.apache.xml.dtm.ref.DTMDefaultBaseTraversers
org.apache.xml.dtm.ref.DTMDefaultBaseIterators
org.apache.xalan.lib.sql.DTMDocument
org.apache.xalan.lib.sql.SQLDocument
- All Implemented Interfaces:
- org.apache.xml.dtm.DTM
- public class SQLDocument
- extends DTMDocument
The SQL Document is the main controlling class the executesa SQL Query
| Nested Class Summary |
| Nested classes inherited from class org.apache.xalan.lib.sql.DTMDocument |
DTMDocument.CharacterNodeHandler |
| Nested classes inherited from class org.apache.xml.dtm.ref.DTMDefaultBaseIterators |
org.apache.xml.dtm.ref.DTMDefaultBaseIterators.AncestorIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.AttributeIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.ChildrenIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.DescendantIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.FollowingIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.FollowingSiblingIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.InternalAxisIteratorBase, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.NamespaceAttributeIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.NamespaceChildrenIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.NamespaceIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.NthDescendantIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.ParentIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.PrecedingIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.PrecedingSiblingIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.RootIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.SingletonIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.TypedAncestorIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.TypedAttributeIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.TypedChildrenIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.TypedDescendantIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.TypedFollowingIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.TypedFollowingSiblingIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.TypedNamespaceIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.TypedPrecedingIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.TypedPrecedingSiblingIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.TypedRootIterator, org.apache.xml.dtm.ref.DTMDefaultBaseIterators.TypedSingletonIterator |
| Nested classes inherited from class org.apache.xml.dtm.ref.DTMDefaultBaseTraversers |
|
| Field Summary | |
private boolean |
DEBUG
|
private int |
m_Col_TypeID
|
private int |
m_ColAttrib_CASESENSITIVE_TypeID
|
private int |
m_ColAttrib_CATALOGUE_NAME_TypeID
|
private int |
m_ColAttrib_COLUMN_LABEL_TypeID
|
private int |
m_ColAttrib_COLUMN_NAME_TypeID
|
private int |
m_ColAttrib_COLUMN_TYPE_TypeID
|
private int |
m_ColAttrib_COLUMN_TYPENAME_TypeID
|
private int |
m_ColAttrib_DEFINITELYWRITEABLE_TypeID
|
private int |
m_ColAttrib_DISPLAY_SIZE_TypeID
|
private int |
m_ColAttrib_ISNULLABLE_TypeID
|
private int |
m_ColAttrib_ISSEARCHABLE_TypeID
|
private int |
m_ColAttrib_ISSIGNED_TypeID
|
private int |
m_ColAttrib_ISWRITEABLE_TypeID
|
private int |
m_ColAttrib_PRECISION_TypeID
|
private int |
m_ColAttrib_SCALE_TypeID
|
private int |
m_ColAttrib_SCHEMA_NAME_TypeID
|
private int |
m_ColAttrib_TABLE_NAME_TypeID
|
private int |
m_ColCount
An indicator on how many columns are in this query |
private int[] |
m_ColHeadersIdx
As the column header array is built, keep the node index for each Column. |
private int |
m_ColumnHeader_TypeID
|
private ConnectionPool |
m_ConnectionPool
The Connection Pool where we has derived all of our connections for this document |
private org.apache.xalan.extensions.ExpressionContext |
m_ExpressionContext
Expression COntext used to creat this document may be used to grab variables from the XSL processor |
private int |
m_FirstRowIdx
Demark the first row element where we started adding rows into the Document. |
private boolean |
m_HasErrors
Flag to detect if an error occured during an operation Defines how errors are handled and how the SQL Connection is closed. |
private boolean |
m_IsStatementCachingEnabled
Is statement caching enabled. |
private int |
m_LastRowIdx
Keep track of the Last row inserted into the DTM from the ResultSet. |
private int |
m_MetaData_TypeID
|
private int |
m_MetaDataIdx
The Index of the MetaData Node. |
private boolean |
m_MultipleResults
Multiple Result sets mode (metadata inside rowset). |
private int |
m_OutParameter_TypeID
|
private SQLQueryParser |
m_QueryParser
The parameter definitions if this is a callable statement with output parameters. |
private java.sql.ResultSet |
m_ResultSet
The current ResultSet. |
private int |
m_Row_TypeID
|
private int |
m_RowSet_TypeID
|
private int |
m_RowSetIdx
The index of the Row Set node. |
private int |
m_SQL_TypeID
|
private int |
m_SQLIdx
|
private java.sql.Statement |
m_Statement
The Statement used to extract the data from the database connection. |
private boolean |
m_StreamingMode
Streaming Mode Control, In Streaming mode we reduce the memory footprint since we only use a single row instance. |
private XConnection |
m_XConnection
XConnection this document came from. |
private static java.lang.String |
S_CASESENSITIVE
|
private static java.lang.String |
S_CATALOGUE_NAME
|
private static java.lang.String |
S_COL
|
private static java.lang.String |
S_COLUMN_HEADER
|
private static java.lang.String |
S_COLUMN_LABEL
|
private static java.lang.String |
S_COLUMN_NAME
|
private static java.lang.String |
S_COLUMN_TYPE
|
private static java.lang.String |
S_COLUMN_TYPENAME
|
private static java.lang.String |
S_DEFINITELYWRITABLE
|
private static java.lang.String |
S_DISPLAY_SIZE
|
private static java.lang.String |
S_ISNULLABLE
|
private static java.lang.String |
S_ISSEARCHABLE
|
private static java.lang.String |
S_ISSIGNED
|
private static java.lang.String |
S_ISWRITEABLE
|
private static java.lang.String |
S_METADATA
|
private static java.lang.String |
S_NAMESPACE
|
private static java.lang.String |
S_OUT_PARAMETERS
|
private static java.lang.String |
S_PRECISION
|
private static java.lang.String |
S_ROW
|
private static java.lang.String |
S_ROW_SET
|
private static java.lang.String |
S_SCALE
|
private static java.lang.String |
S_SCHEMA_NAME
|
private static java.lang.String |
S_SQL
|
private static java.lang.String |
S_TABLE_NAME
|
| Fields inherited from class org.apache.xalan.lib.sql.DTMDocument |
m_attribute, m_Document_TypeID, m_DocumentIdx, m_ObjectArray, m_TextNode_TypeID, S_ATTRIB_NOT_SUPPORTED, S_DOCUMENT, S_ELEMENT_NODE, S_ISFALSE, S_ISTRUE, S_TEXT_NODE |
| Fields inherited from class org.apache.xml.dtm.ref.DTMDefaultBase |
DEFAULT_BLOCKSIZE, DEFAULT_NUMBLOCKS, DEFAULT_NUMBLOCKS_SMALL, m_documentBaseURI, m_dtmIdent, m_elemIndexes, m_expandedNameTable, m_exptype, m_firstch, m_indexing, m_mgr, m_mgrDefault, m_namespaceDeclSetElements, m_namespaceDeclSets, m_nextsib, m_parent, m_prevsib, m_shouldStripWhitespaceStack, m_shouldStripWS, m_size, m_traversers, m_wsfilter, m_xstrf, NOTPROCESSED, ROOTNODE |
| Fields inherited from interface org.apache.xml.dtm.DTM |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NAMESPACE_NODE, NOTATION_NODE, NTYPES, NULL, PROCESSING_INSTRUCTION_NODE, ROOT_NODE, TEXT_NODE |
| Constructor Summary | |
SQLDocument(org.apache.xml.dtm.DTMManager mgr,
int ident)
|
|
| Method Summary | |
protected int |
_nextsib(int identity)
Get the next sibling for the given node identity. |
private boolean |
addRowToDTMFromResultSet()
Pull a record from the result set and map it to a DTM based ROW If we are in Streaming mode, then only create a single row and keep copying the data into the same row. |
java.sql.SQLWarning |
checkWarnings()
|
void |
close()
Close down any resources used by this document. |
protected void |
createExpandedNameTable()
Populate the Expanded Name Table with the Node that we will use. |
void |
documentRegistration()
A dummy routine to satisify the abstract interface. |
void |
documentRelease()
A dummy routine to satisify the abstract interface. |
void |
execute(XConnection xconn,
SQLQueryParser query)
|
private void |
executeSQLStatement()
|
private void |
extractSQLMetaData(java.sql.ResultSetMetaData meta)
Extract the Meta Data and build the Column Attribute List. |
org.apache.xalan.extensions.ExpressionContext |
getExpressionContext()
Return the context used to build this document |
static SQLDocument |
getNewDocument(org.apache.xalan.extensions.ExpressionContext exprContext)
This static method simplifies the creation of an SQL Document and allows us to embedd the complexity of creating / handling the dtmIdent inside the document. |
boolean |
hasErrors()
Used by the XConnection to determine if the Document should handle the document differently. |
protected boolean |
nextNode()
This method should try and build one or more nodes in the table. |
protected void |
setExpressionContext(org.apache.xalan.extensions.ExpressionContext expr)
When building the SQL Document, we need to store the Expression Context that was used to create the document. |
| Methods inherited from class org.apache.xml.dtm.ref.DTMDefaultBase |
dumpDTM, dumpNode, getDocumentRoot, getDTMIDs, getFirstAttributeIdentity, getManager, getNextAttributeIdentity, getNodeHandle, getNodeIdent, getTypedAttribute, getTypedFirstChild, getTypedNextSibling, makeNodeHandle, makeNodeIdentity, migrateTo |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
DEBUG
private boolean DEBUG
S_NAMESPACE
private static final java.lang.String S_NAMESPACE
- See Also:
- Constant Field Values
S_SQL
private static final java.lang.String S_SQL
- See Also:
- Constant Field Values
S_ROW_SET
private static final java.lang.String S_ROW_SET
- See Also:
- Constant Field Values
S_METADATA
private static final java.lang.String S_METADATA
- See Also:
- Constant Field Values
S_COLUMN_HEADER
private static final java.lang.String S_COLUMN_HEADER
- See Also:
- Constant Field Values
S_ROW
private static final java.lang.String S_ROW
- See Also:
- Constant Field Values
S_COL
private static final java.lang.String S_COL
- See Also:
- Constant Field Values
S_OUT_PARAMETERS
private static final java.lang.String S_OUT_PARAMETERS
- See Also:
- Constant Field Values
S_CATALOGUE_NAME
private static final java.lang.String S_CATALOGUE_NAME
- See Also:
- Constant Field Values
S_DISPLAY_SIZE
private static final java.lang.String S_DISPLAY_SIZE
- See Also:
- Constant Field Values
S_COLUMN_LABEL
private static final java.lang.String S_COLUMN_LABEL
- See Also:
- Constant Field Values
S_COLUMN_NAME
private static final java.lang.String S_COLUMN_NAME
- See Also:
- Constant Field Values
S_COLUMN_TYPE
private static final java.lang.String S_COLUMN_TYPE
- See Also:
- Constant Field Values
S_COLUMN_TYPENAME
private static final java.lang.String S_COLUMN_TYPENAME
- See Also:
- Constant Field Values
S_PRECISION
private static final java.lang.String S_PRECISION
- See Also:
- Constant Field Values
S_SCALE
private static final java.lang.String S_SCALE
- See Also:
- Constant Field Values
S_SCHEMA_NAME
private static final java.lang.String S_SCHEMA_NAME
- See Also:
- Constant Field Values
S_TABLE_NAME
private static final java.lang.String S_TABLE_NAME
- See Also:
- Constant Field Values
S_CASESENSITIVE
private static final java.lang.String S_CASESENSITIVE
- See Also:
- Constant Field Values
S_DEFINITELYWRITABLE
private static final java.lang.String S_DEFINITELYWRITABLE
- See Also:
- Constant Field Values
S_ISNULLABLE
private static final java.lang.String S_ISNULLABLE
- See Also:
- Constant Field Values
S_ISSIGNED
private static final java.lang.String S_ISSIGNED
- See Also:
- Constant Field Values
S_ISWRITEABLE
private static final java.lang.String S_ISWRITEABLE
- See Also:
- Constant Field Values
S_ISSEARCHABLE
private static final java.lang.String S_ISSEARCHABLE
- See Also:
- Constant Field Values
m_SQL_TypeID
private int m_SQL_TypeID
m_MetaData_TypeID
private int m_MetaData_TypeID
m_ColumnHeader_TypeID
private int m_ColumnHeader_TypeID
m_RowSet_TypeID
private int m_RowSet_TypeID
m_Row_TypeID
private int m_Row_TypeID
m_Col_TypeID
private int m_Col_TypeID
m_OutParameter_TypeID
private int m_OutParameter_TypeID
m_ColAttrib_CATALOGUE_NAME_TypeID
private int m_ColAttrib_CATALOGUE_NAME_TypeID
m_ColAttrib_DISPLAY_SIZE_TypeID
private int m_ColAttrib_DISPLAY_SIZE_TypeID
m_ColAttrib_COLUMN_LABEL_TypeID
private int m_ColAttrib_COLUMN_LABEL_TypeID
m_ColAttrib_COLUMN_NAME_TypeID
private int m_ColAttrib_COLUMN_NAME_TypeID
m_ColAttrib_COLUMN_TYPE_TypeID
private int m_ColAttrib_COLUMN_TYPE_TypeID
m_ColAttrib_COLUMN_TYPENAME_TypeID
private int m_ColAttrib_COLUMN_TYPENAME_TypeID
m_ColAttrib_PRECISION_TypeID
private int m_ColAttrib_PRECISION_TypeID
m_ColAttrib_SCALE_TypeID
private int m_ColAttrib_SCALE_TypeID
m_ColAttrib_SCHEMA_NAME_TypeID
private int m_ColAttrib_SCHEMA_NAME_TypeID
m_ColAttrib_TABLE_NAME_TypeID
private int m_ColAttrib_TABLE_NAME_TypeID
m_ColAttrib_CASESENSITIVE_TypeID
private int m_ColAttrib_CASESENSITIVE_TypeID
m_ColAttrib_DEFINITELYWRITEABLE_TypeID
private int m_ColAttrib_DEFINITELYWRITEABLE_TypeID
m_ColAttrib_ISNULLABLE_TypeID
private int m_ColAttrib_ISNULLABLE_TypeID
m_ColAttrib_ISSIGNED_TypeID
private int m_ColAttrib_ISSIGNED_TypeID
m_ColAttrib_ISWRITEABLE_TypeID
private int m_ColAttrib_ISWRITEABLE_TypeID
m_ColAttrib_ISSEARCHABLE_TypeID
private int m_ColAttrib_ISSEARCHABLE_TypeID
m_Statement
private java.sql.Statement m_Statement
- The Statement used to extract the data from the database connection.
m_ExpressionContext
private org.apache.xalan.extensions.ExpressionContext m_ExpressionContext
- Expression COntext used to creat this document
may be used to grab variables from the XSL processor
m_ConnectionPool
private ConnectionPool m_ConnectionPool
- The Connection Pool where we has derived all of our connections
for this document
m_ResultSet
private java.sql.ResultSet m_ResultSet
- The current ResultSet.
m_QueryParser
private SQLQueryParser m_QueryParser
- The parameter definitions if this is a callable
statement with output parameters.
m_ColHeadersIdx
private int[] m_ColHeadersIdx
- As the column header array is built, keep the node index
for each Column.
The primary use of this is to locate the first attribute for
each column in each row as we add records.
m_ColCount
private int m_ColCount
- An indicator on how many columns are in this query
m_MetaDataIdx
private int m_MetaDataIdx
- The Index of the MetaData Node. Currently the MetaData Node contains the
m_RowSetIdx
private int m_RowSetIdx
- The index of the Row Set node. This is the sibling directly after
the last Column Header.
m_SQLIdx
private int m_SQLIdx
m_FirstRowIdx
private int m_FirstRowIdx
- Demark the first row element where we started adding rows into the
Document.
m_LastRowIdx
private int m_LastRowIdx
- Keep track of the Last row inserted into the DTM from the ResultSet.
This will be used as the index of the parent Row Element when adding
a row.
m_StreamingMode
private boolean m_StreamingMode
- Streaming Mode Control, In Streaming mode we reduce the memory
footprint since we only use a single row instance.
m_MultipleResults
private boolean m_MultipleResults
- Multiple Result sets mode (metadata inside rowset).
m_HasErrors
private boolean m_HasErrors
- Flag to detect if an error occured during an operation
Defines how errors are handled and how the SQL Connection
is closed.
m_IsStatementCachingEnabled
private boolean m_IsStatementCachingEnabled
- Is statement caching enabled.
m_XConnection
private XConnection m_XConnection
- XConnection this document came from.
| Constructor Detail |
SQLDocument
public SQLDocument(org.apache.xml.dtm.DTMManager mgr, int ident)
| Method Detail |
getNewDocument
public static SQLDocument getNewDocument(org.apache.xalan.extensions.ExpressionContext exprContext)
- This static method simplifies the creation of an SQL Document and allows
us to embedd the complexity of creating / handling the dtmIdent inside
the document. This type of method may better placed inside the DTMDocument
code
setExpressionContext
protected void setExpressionContext(org.apache.xalan.extensions.ExpressionContext expr)
- When building the SQL Document, we need to store the Expression
Context that was used to create the document. This will be se to
reference items int he XSLT process such as any variables that were
present.
getExpressionContext
public org.apache.xalan.extensions.ExpressionContext getExpressionContext()
- Return the context used to build this document
execute
public void execute(XConnection xconn, SQLQueryParser query) throws java.sql.SQLException
executeSQLStatement
private void executeSQLStatement()
throws java.sql.SQLException
extractSQLMetaData
private void extractSQLMetaData(java.sql.ResultSetMetaData meta)
- Extract the Meta Data and build the Column Attribute List.
createExpandedNameTable
protected void createExpandedNameTable()
- Populate the Expanded Name Table with the Node that we will use.
Keep a reference of each of the types for access speed.
- Overrides:
createExpandedNameTablein classDTMDocument
addRowToDTMFromResultSet
private boolean addRowToDTMFromResultSet()
- Pull a record from the result set and map it to a DTM based ROW
If we are in Streaming mode, then only create a single row and
keep copying the data into the same row. This will keep the memory
footprint constint independant of the RecordSet Size. If we are not
in Streaming mode then create ROWS for the whole tree.
hasErrors
public boolean hasErrors()
- Used by the XConnection to determine if the Document should
handle the document differently.
close
public void close()
- Close down any resources used by this document. If an SQL Error occure
while the document was being accessed, the SQL Connection used to create
this document will be released to the Connection Pool on error. This allows
the COnnection Pool to give special attention to any connection that may
be in a errored state.
nextNode
protected boolean nextNode()
- Description copied from class:
org.apache.xml.dtm.ref.DTMDefaultBase - This method should try and build one or more nodes in the table.
- Overrides:
nextNodein classDTMDocument
_nextsib
protected int _nextsib(int identity)
- Description copied from class:
org.apache.xml.dtm.ref.DTMDefaultBase - Get the next sibling for the given node identity.
- Overrides:
_nextsibin classDTMDocument
documentRegistration
public void documentRegistration()
- Description copied from class:
org.apache.xml.dtm.ref.DTMDefaultBase - A dummy routine to satisify the abstract interface. If the DTM
implememtation that extends the default base requires notification
of registration, they can override this method.
documentRelease
public void documentRelease()
- Description copied from class:
org.apache.xml.dtm.ref.DTMDefaultBase - A dummy routine to satisify the abstract interface. If the DTM
implememtation that extends the default base requires notification
when the document is being released, they can override this method
checkWarnings
public java.sql.SQLWarning checkWarnings()
|
|||||||||
| Home >> All >> org >> apache >> xalan >> lib >> [ sql overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC