|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.ucsb.nceas.metacat.DBQuery
A Class that searches a relational DB for elements and attributes that have free text matches a query string, or structured query matches to a path specified node in the XML hierarchy. It returns a result set consisting of the document ID for each document that satisfies the query
Constructor Summary | |
DBQuery(java.sql.Connection conn,
java.lang.String parserName)
construct an instance of the DBQuery class |
Method Summary | |
static java.lang.String |
createQuery(java.lang.String value)
format a simple free-text value query as an XML document that conforms to the pathquery.dtd and is appropriate for submission to the DBQuery structured query engine |
static java.lang.String |
createQuery(java.lang.String value,
java.lang.String doctype)
format a simple free-text value query as an XML document that conforms to the pathquery.dtd and is appropriate for submission to the DBQuery structured query engine |
java.util.Hashtable |
findDocuments(java.io.Reader xmlquery)
routine to search the elements and attributes looking to match query |
static void |
main(java.lang.String[] args)
the main routine used to test the DBQuery utility. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public DBQuery(java.sql.Connection conn, java.lang.String parserName) throws java.io.IOException, java.sql.SQLException, java.lang.ClassNotFoundException
Generally, one would call the findDocuments() routine after creating an instance to specify the search query
conn
- the JDBC connection that we use for the queryparserName
- the fully qualified name of a Java class implementing
the org.xml.sax.XMLReader interfaceMethod Detail |
public static void main(java.lang.String[] args)
Usage: java DBQuery
xmlfile
- the filename of the xml file containing the query
public java.util.Hashtable findDocuments(java.io.Reader xmlquery)
xmlquery
- the xml serialization of the query (@see pathquery.dtd)public static java.lang.String createQuery(java.lang.String value, java.lang.String doctype)
value
- the text string to search for in the xml catalogdoctype
- the type of documents to include in the result set -- use
"any" or "ANY" for unfiltered result setspublic static java.lang.String createQuery(java.lang.String value)
value
- the text string to search for in the xml catalog
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |