edu.ucsb.nceas.metacat
Class DBSAXWriter

java.lang.Object
  |
  +--edu.ucsb.nceas.metacat.DBSAXWriter

public class DBSAXWriter
extends java.lang.Object

A Class that reads in an XML text document and write its contents to a database connection using SAX


Constructor Summary
DBSAXWriter(java.io.Reader xml, java.sql.Connection conn)
          construct a new instance of the class to write an XML file to the database
DBSAXWriter(java.lang.String filename, java.sql.Connection conn)
           
 
Method Summary
static java.net.URL fileToURL(java.io.File file)
          Utility method to convert a file handle into a URL
static void main(java.lang.String[] args)
          the main routine used to test the DBSAXWriter utility.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBSAXWriter

public DBSAXWriter(java.io.Reader xml,
                   java.sql.Connection conn)
            throws java.io.IOException,
                   java.sql.SQLException,
                   java.lang.ClassNotFoundException
construct a new instance of the class to write an XML file to the database
Parameters:
filename - the filename to be loaded into the database
conn - the database connection to which to write the XML file

DBSAXWriter

public DBSAXWriter(java.lang.String filename,
                   java.sql.Connection conn)
            throws java.io.IOException,
                   java.sql.SQLException,
                   java.lang.ClassNotFoundException
Method Detail

main

public static void main(java.lang.String[] args)
the main routine used to test the DBSAXWriter utility. Usage: java DBSAXWriter [dbstring]
Parameters:
filename - the filename to be loaded into the database
user - the username to use for the database connection
password - the password to use for the database connection
dbstring - the connection info to use for the database connection

fileToURL

public static java.net.URL fileToURL(java.io.File file)
Utility method to convert a file handle into a URL