|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--dbxml.sax.ParserBase
|
+--dbxml.sax.JDBCSAXParser
SAX parser that uses a JDBC data source a input instead of an XML file of byte stream. This is a proof-of-concept implemention and does not address all the issues. Many improvements to this parser are possible. This parser treats a table in a database as a virtual XML document.
| Fields inherited from class dbxml.sax.ParserBase |
_documentHandler,
_dtdHandler,
_entityResolver,
_errorHandler |
| Constructor Summary | |
JDBCSAXParser()
|
|
| Method Summary | |
protected void |
generateSAXEventForColumn(java.sql.ResultSetMetaData rsmd,
java.sql.ResultSet rs,
int columnIndex)
Generate SAX event when visting a column. |
protected java.lang.String |
getColumnMarker(java.lang.String columnName)
Get the marker for indicating the start and end of a column. |
protected java.lang.String |
getRowMarker()
Get the marker for indicating the start and end of a row. |
protected java.lang.String |
getSelectorSQLStatement(java.lang.String tableName)
Get the select query that will be used to obtain the result set for parsing. |
protected java.lang.String |
getTableMarker(java.lang.String tableName)
Get the marker for indicating the start and end of the document. |
void |
parse(org.xml.sax.InputSource source)
Implement the method from base interface. |
void |
parse(JDBCInputSource source)
Parse the given JDBC source to generate SAX events. |
void |
parse(java.sql.ResultSet rs,
java.lang.String tableName)
Parse the given JDBC result set object to generate SAX events. |
void |
parse(java.lang.String systemId)
Implement the method from base interface. |
void |
parse(java.lang.String connectionURL,
java.lang.String userName,
java.lang.String passwd,
java.lang.String tableName)
A convenience method that creates a JDBCInputSource object from its argument and parses it |
| Methods inherited from class dbxml.sax.ParserBase |
setDocumentHandler,
setDTDHandler,
setEntityResolver,
setErrorHandler,
setLocale |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public JDBCSAXParser()
| Method Detail |
public void parse(org.xml.sax.InputSource source)
throws org.xml.sax.SAXException,
java.io.IOException
source - an input source (must be of type JDBCInputSource)
public void parse(java.lang.String systemId)
throws org.xml.sax.SAXException,
java.io.IOException
systemId - unused
public void parse(JDBCInputSource source)
throws org.xml.sax.SAXException,
java.io.IOException
getSelectorSQLStatement and then parses that result set.source - a input source describing database table to be parsed
public void parse(java.sql.ResultSet rs,
java.lang.String tableName)
throws org.xml.sax.SAXException,
java.sql.SQLException,
java.io.IOException
rs - result set object to be parsedtableName - the name of table name being parsed
public void parse(java.lang.String connectionURL,
java.lang.String userName,
java.lang.String passwd,
java.lang.String tableName)
throws org.xml.sax.SAXException,
java.io.IOException
connectionURL - a JDBC URL for the databaseuserName - user name to connect to the databasepasswd - password to connect to the databasetableName - the name of table name being parsed
protected void generateSAXEventForColumn(java.sql.ResultSetMetaData rsmd,
java.sql.ResultSet rs,
int columnIndex)
throws org.xml.sax.SAXException,
java.sql.SQLException
startElement event followed by a
characters event followed by endElement
event. No events are fired for a null data.
rsmd - meta data for the result setrs - the result setcolumnIndex - index of column being visited (1 for first column)protected java.lang.String getTableMarker(java.lang.String tableName)
tableName - the name of table name being parsedprotected java.lang.String getRowMarker()
protected java.lang.String getColumnMarker(java.lang.String columnName)
columnName - a value of type 'String'protected java.lang.String getSelectorSQLStatement(java.lang.String tableName)
tableName - the name of table name being parsed
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||