|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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
public class SQLDocument
The SQL Document is the main controlling class the executesa SQL Query
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.xalan.lib.sql.DTMDocument |
---|
DTMDocument.CharacterNodeHandler |
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 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(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(boolean flushConnPool)
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. |
ExpressionContext |
getExpressionContext()
Return the context used to build this document |
static SQLDocument |
getNewDocument(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(ExpressionContext expr)
When building the SQL Document, we need to store the Expression Context that was used to create the document. |
void |
skip(int value)
Push the record set forward value rows. |
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 |
---|
private boolean DEBUG
private static final java.lang.String S_NAMESPACE
private static final java.lang.String S_SQL
private static final java.lang.String S_ROW_SET
private static final java.lang.String S_METADATA
private static final java.lang.String S_COLUMN_HEADER
private static final java.lang.String S_ROW
private static final java.lang.String S_COL
private static final java.lang.String S_OUT_PARAMETERS
private static final java.lang.String S_CATALOGUE_NAME
private static final java.lang.String S_DISPLAY_SIZE
private static final java.lang.String S_COLUMN_LABEL
private static final java.lang.String S_COLUMN_NAME
private static final java.lang.String S_COLUMN_TYPE
private static final java.lang.String S_COLUMN_TYPENAME
private static final java.lang.String S_PRECISION
private static final java.lang.String S_SCALE
private static final java.lang.String S_SCHEMA_NAME
private static final java.lang.String S_TABLE_NAME
private static final java.lang.String S_CASESENSITIVE
private static final java.lang.String S_DEFINITELYWRITABLE
private static final java.lang.String S_ISNULLABLE
private static final java.lang.String S_ISSIGNED
private static final java.lang.String S_ISWRITEABLE
private static final java.lang.String S_ISSEARCHABLE
private int m_SQL_TypeID
private int m_MetaData_TypeID
private int m_ColumnHeader_TypeID
private int m_RowSet_TypeID
private int m_Row_TypeID
private int m_Col_TypeID
private int m_OutParameter_TypeID
private int m_ColAttrib_CATALOGUE_NAME_TypeID
private int m_ColAttrib_DISPLAY_SIZE_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_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_ColAttrib_CASESENSITIVE_TypeID
private int m_ColAttrib_DEFINITELYWRITEABLE_TypeID
private int m_ColAttrib_ISNULLABLE_TypeID
private int m_ColAttrib_ISSIGNED_TypeID
private int m_ColAttrib_ISWRITEABLE_TypeID
private int m_ColAttrib_ISSEARCHABLE_TypeID
private java.sql.Statement m_Statement
private ExpressionContext m_ExpressionContext
private ConnectionPool m_ConnectionPool
private java.sql.ResultSet m_ResultSet
private SQLQueryParser m_QueryParser
private int[] m_ColHeadersIdx
private int m_ColCount
private int m_MetaDataIdx
private int m_RowSetIdx
private int m_SQLIdx
private int m_FirstRowIdx
private int m_LastRowIdx
private boolean m_StreamingMode
private boolean m_MultipleResults
private boolean m_HasErrors
private boolean m_IsStatementCachingEnabled
private XConnection m_XConnection
Constructor Detail |
---|
public SQLDocument(DTMManager mgr, int ident)
mgr
- ident
-
java.sql.SQLException
Method Detail |
---|
public static SQLDocument getNewDocument(ExpressionContext exprContext)
protected void setExpressionContext(ExpressionContext expr)
public ExpressionContext getExpressionContext()
public void execute(XConnection xconn, SQLQueryParser query) throws java.sql.SQLException
java.sql.SQLException
private void executeSQLStatement() throws java.sql.SQLException
java.sql.SQLException
public void skip(int value)
value
- private void extractSQLMetaData(java.sql.ResultSetMetaData meta)
meta
- protected void createExpandedNameTable()
createExpandedNameTable
in class DTMDocument
private boolean addRowToDTMFromResultSet()
public boolean hasErrors()
public void close(boolean flushConnPool)
protected boolean nextNode()
DTMDefaultBase
nextNode
in class DTMDocument
protected int _nextsib(int identity)
DTMDefaultBase
_nextsib
in class DTMDocument
identity
-
public void documentRegistration()
DTMDefaultBase
documentRegistration
in interface DTM
documentRegistration
in class DTMDefaultBase
public void documentRelease()
DTMDefaultBase
documentRelease
in interface DTM
documentRelease
in class DTMDefaultBase
public java.sql.SQLWarning checkWarnings()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |