gr.forth.ics.thesaurus
Class ThesaurusParseAndStore

gr.forth.ics.thesaurus.ThesaurusParseAndStore

public class ThesaurusParseAndStore

Parse a thesaurus XML file and store results in db. See javadoc commencts of parseAndStore function for more details.

Version:
2.0 (23 July 2003)
Author:
Stavros Saxtouri

Constructor Summary
ThesaurusParseAndStore(int thesaurusId, java.lang.String thesaurusURI, java.sql.Connection con)
           
 
Method Summary
 void characters(char[] buf, int offset, int len)
           
 void endDocument()
           
 void endElement(java.lang.String namespaceURI, java.lang.String sName, java.lang.String qName)
           
static void main(java.lang.String[] args)
           
static boolean parseAndStore(java.lang.String inputFile, int thesaurusId, java.lang.String thesaurusURI, java.sql.Connection con)
          Parse an XML thesaurus file and store it in the given database by executing SQL queries
 void startDocument()
           
 void startElement(java.lang.String namespaceURI, java.lang.String sName, java.lang.String qName, gr.forth.ics.thesaurus.Attributes attrs)
           
 

Constructor Detail

ThesaurusParseAndStore

public ThesaurusParseAndStore(int thesaurusId,
                              java.lang.String thesaurusURI,
                              java.sql.Connection con)
                       throws java.lang.Exception
Method Detail

parseAndStore

public static boolean parseAndStore(java.lang.String inputFile,
                                    int thesaurusId,
                                    java.lang.String thesaurusURI,
                                    java.sql.Connection con)
Parse an XML thesaurus file and store it in the given database by executing SQL queries
Parameters:
inputFile - - the XML thesaurus file to parse
thesaurusId - - the id of the thesaurus
thesaurusURI - - the URI of the thesaurus
con - - the Connection object of the database
Returns:
boolean - true if parsing and storing is succesfull, false otherwse

startDocument

public void startDocument()
                   throws gr.forth.ics.thesaurus.SAXException

endDocument

public void endDocument()
                 throws gr.forth.ics.thesaurus.SAXException

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String sName,
                         java.lang.String qName,
                         gr.forth.ics.thesaurus.Attributes attrs)
                  throws gr.forth.ics.thesaurus.SAXException

endElement

public void endElement(java.lang.String namespaceURI,
                       java.lang.String sName,
                       java.lang.String qName)
                throws gr.forth.ics.thesaurus.SAXException

characters

public void characters(char[] buf,
                       int offset,
                       int len)
                throws gr.forth.ics.thesaurus.SAXException

main

public static void main(java.lang.String[] args)