org.apache.xalan.xslt.extensions
Class RowSetLocator
java.lang.Object
|
+--org.apache.xalan.xpath.SimpleNodeLocator
|
+--org.apache.xalan.xslt.extensions.RowSetLocator
- public class RowSetLocator
- extends SimpleNodeLocator
RowSetLocator uses JDBC to connect to a database, execute a query, and return
a result set, then returns a lazy row-set DOM. This class can ONLY be used with
the Xerces liaison (org.apache.xalan.xpath.xdom.XercesLiaison) and Xerces XML parser,
since it extends the Xerces DOM implementation to create a lazy row-set DOM.
- See Also:
- Serialized Form
Field Summary |
java.sql.Connection |
m_connection
The JDBC connection. |
java.lang.String |
m_dbURL
A database URL of the form jdbc:subprotocol:subname. |
java.lang.String |
m_driver
A JDBC driver of the form "foo.bar.Driver". |
java.lang.String |
m_password
Password |
java.lang.String |
m_userID
User ID |
Constructor Summary |
RowSetLocator(java.lang.String driver,
java.lang.String dbURL)
Create a SimpleNodeLocator object. |
Method Summary |
static XLocator |
connect(java.lang.String driver,
java.lang.String dbURL,
java.lang.String sqlQuery)
Execute the proprietary connect() function, which returns an
instance of XLocator. |
XNodeSet |
connectToNodes(XPath xpath,
XPathSupport execContext,
org.w3c.dom.Node context,
int opPos,
java.util.Vector connectArgs)
Execute a connection and process the LocationPath,
The arguments to the static connect function
are re-passed to this function. |
static void |
protocol(XSLProcessorContext context,
ElemExtensionCall protocolElem)
A list of arbitrary string tag/value pairs as connection
arguments; normally at least a "user" and "password"
property should be included. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
m_driver
public java.lang.String m_driver
- A JDBC driver of the form "foo.bar.Driver".
m_dbURL
public java.lang.String m_dbURL
- A database URL of the form jdbc:subprotocol:subname.
m_userID
public java.lang.String m_userID
- User ID
m_password
public java.lang.String m_password
- Password
m_connection
public java.sql.Connection m_connection
- The JDBC connection.
RowSetLocator
public RowSetLocator(java.lang.String driver,
java.lang.String dbURL)
- Create a SimpleNodeLocator object.
protocol
public static void protocol(XSLProcessorContext context,
ElemExtensionCall protocolElem)
- A list of arbitrary string tag/value pairs as connection
arguments; normally at least a "user" and "password"
property should be included.
connect
public static XLocator connect(java.lang.String driver,
java.lang.String dbURL,
java.lang.String sqlQuery)
- Execute the proprietary connect() function, which returns an
instance of XLocator. When the XPath object sees a return type
of XLocator, it calls the locationPath function that passes
in the connectArgs. The opPos and args params are not used
by this function. This really is just a factory function
for the XLocator instance, but this fact is hidden from the
user.
- Parameters:
driver
- JDBC driver.dbURL
- database URL of the form jdbc:subprotocol:subname.sqlQuery
- typically a static SQL SELECT statement, which
is normally executed by the connectToNodes function when called by the XPath object.
connectToNodes
public XNodeSet connectToNodes(XPath xpath,
XPathSupport execContext,
org.w3c.dom.Node context,
int opPos,
java.util.Vector connectArgs)
- Execute a connection and process the LocationPath,
The arguments to the static connect function
are re-passed to this function.
- Parameters:
xpath
- The xpath that is executing.context
- The current source tree context node.opPos
- The current position in the xpath.m_opMap array.connectArgs
- The same arguments that were passed to the
static connect function.- Overrides:
- connectToNodes in class SimpleNodeLocator