|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.clazzes.jdbc2xml.sax.JDBCToSAXWriter
public class JDBCToSAXWriter
This class writes a series of JDBC select queries to an XML document using a SAX ContentHandler instance.
Constructor Summary | |
---|---|
JDBCToSAXWriter()
Create an uninitialized instance. |
|
JDBCToSAXWriter(Connection connection,
TimeZone timeZone,
ContentHandler contentHandler)
|
|
JDBCToSAXWriter(ISchemaEngine schemaEngine,
ContentHandler contentHandler)
|
Method Summary | |
---|---|
void |
addQueries(Collection<String> queries)
Add the given list of queries to the data being dumped. |
void |
addQuery(String sql)
Add the given SQL select query to the data being dumped. |
void |
addRestrictedTable(String table,
String sql)
Add the given database table and a query, which selects a subset of the table data to the data being dumped. |
void |
addTable(String table)
Add the given database table to the data being dumped. |
void |
addTable(TableInfo tableInfo)
Add the given database table to the data being dumped. |
void |
addTables(Collection<String> tables)
Add the given list of database tables to the data being dumped. |
Connection |
getConnection()
|
ContentHandler |
getContentHandler()
|
ProcessRestrictionFilter |
getProcessRestrictionFilter()
|
String |
getSchema()
|
TimeZone |
getTimeZone()
|
void |
processData()
Proceed by executing all SQL statement and writing the resulting data to the ContentHandler. |
void |
setConnection(Connection connection)
|
void |
setContentHandler(ContentHandler contentHandler)
|
void |
setProcessRestrictionFilter(ProcessRestrictionFilter processFilter)
|
void |
setSchema(String schema)
|
void |
setTimeZone(TimeZone timeZone)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JDBCToSAXWriter()
setConnection(Connection)
, setContentHandler(ContentHandler)
and
setTimeZone(TimeZone)
in order to initialize this instance.
public JDBCToSAXWriter(Connection connection, TimeZone timeZone, ContentHandler contentHandler) throws SQLException
connection
- The database connection to use.timeZone
- The time zone used to process date values.contentHandler
- The SAX content handler which drives the XML output.
SQLException
- Upon errors when inspecting the database.public JDBCToSAXWriter(ISchemaEngine schemaEngine, ContentHandler contentHandler) throws SQLException
schemaEngine
- The initialized SchemaEngine carrying the database connection
and default time zone.contentHandler
- The SAX content handler which drives the XML output.
SQLException
- Upon errors when inspecting the database.Method Detail |
---|
public Connection getConnection()
public void setConnection(Connection connection) throws SQLException
connection
- the connection to set
SQLException
public ContentHandler getContentHandler()
public void setContentHandler(ContentHandler contentHandler)
contentHandler
- the contentHandler to setpublic TimeZone getTimeZone()
public void setTimeZone(TimeZone timeZone)
timeZone
- the timeZone to setpublic String getSchema()
public void setSchema(String schema)
schema
- The schema to which the written tables belong to set.public void addTables(Collection<String> tables) throws SQLException
tables
- A list of database table names.
SQLException
public void addTable(String table) throws SQLException
table
- A database table name.
SQLException
public void addTable(TableInfo tableInfo) throws SQLException
tableInfo
- A database table description.
SQLException
public void addRestrictedTable(String table, String sql) throws SQLException
table
- A database table name.sql
- A query that selects data from this table, but restrict the
returned row to a subset of the whole table. Typically, such
a query looks like
select a.* from account a, person p where a.person_id=p.id and person.name='Me';assuming that table account has a foreign key to table person.
SQLException
public void addQueries(Collection<String> queries)
queries
- A list of SQL queries.public void addQuery(String sql)
sql
- An SQL query statement.public void processData() throws SQLException, SAXException
SQLException
SAXException
public ProcessRestrictionFilter getProcessRestrictionFilter()
public void setProcessRestrictionFilter(ProcessRestrictionFilter processFilter)
processFilter
- The processRestrictionFilter to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |