java.lang.Object
org.jxbeans.AbstractJXBean
org.jxbeans.AbstractDocumentSource
org.jxbeans.integration.database.AbstractDatabaseJXBean
org.jxbeans.integration.database.Retriever
- All Implemented Interfaces:
- org.jxbeans.DocumentReadyListener, org.jxbeans.DocumentSource, java.util.EventListener, java.io.Serializable
- public class Retriever
- extends AbstractDatabaseJXBean
- implements org.jxbeans.DocumentReadyListener
The Retriever JXBean is used for retrieving data from a database using a
standard SQL query. The result set from the query is turned into an XML
document. The resulting XML document can optionally be inserted into the
incoming XML document by setting an XPath expression of the parent element
under which the new document should be inserted. Otherwise, output from
this JXBean is simply the result set of the query. This JXBean also
provides some control over the names of the result set and row elements
generated from a result set. Result set column name are used for elements
within rows.
- Since:
- 1.0
- Version:
- 1.0
| Methods inherited from class org.jxbeans.integration.database.AbstractDatabaseJXBean |
connect, getConnection, getConnectionURL, getDataSource, getDataSourceName, getDriverClassName, getPassword, getQuery, getQueryExpression, getQueryParameter, getQueryParameter, getUsername, prepareStatement, setConnection, setConnectionURL, setDataSource, setDataSourceName, setDriverClassName, setPassword, setQuery, setQueryExpression, setQueryParameter, setQueryParameter, setUsername |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static org.apache.log4j.Category log
resultElementName
private java.lang.String resultElementName
rowElementName
private java.lang.String rowElementName
parentElementExpression
private java.lang.String parentElementExpression
Retriever
public Retriever()
documentReady
public void documentReady(org.jxbeans.DocumentReadyEvent anEvent)
throws org.jxbeans.JXBeanException
- Description copied from interface:
org.jxbeans.DocumentReadyListener
- Classes implementing this method are expected to process the
document contained in the
DocumentReadyEvent in some fashion
specific to the class implementing this interface.
- Specified by:
documentReady in interface org.jxbeans.DocumentReadyListener
executeQuery
private org.jdom.Element executeQuery(org.jdom.Document aDocument)
throws org.jxbeans.JXBeanException
elementFromResultSet
private org.jdom.Element elementFromResultSet(java.sql.ResultSet aResultSet)
throws org.jxbeans.JXBeanException
documentFromResultSet
private org.jdom.Document documentFromResultSet(org.jdom.Document aDocument,
org.jdom.Element aResultSet)
throws org.jxbeans.JXBeanException
setParentElementExpression
public void setParentElementExpression(java.lang.String anXPathExpression)
- Sets the XPath expression that resolves to a location in the
incoming document where the results of the query will be inserted. The default
is null, which means that the results will not be inserted into the incoming
document, a new document will be generated.
- Since:
- 1.0
getParentElementExpression
public java.lang.String getParentElementExpression()
- Since:
- 1.0
setResultElementName
public void setResultElementName(java.lang.String anElementName)
- Sets the name of the element that will be created to contain the results of the query.
The default is "result-set".
- Since:
- 1.0
getResultElementName
public java.lang.String getResultElementName()
- Since:
- 1.0
setRowElementName
public void setRowElementName(java.lang.String anElementName)
- Sets the name of the element that will be created to contain each row in the
results of the query. The default is "row".
- Since:
- 1.0
getRowElementName
public java.lang.String getRowElementName()
- Since:
- 1.0