org.webdocwf.util.xml
Class XmlReader

java.lang.Object
  extended by org.webdocwf.util.xml.XmlReader

public class XmlReader
extends java.lang.Object

Class load existing XML file, creating DOM from file or creating new DOM.Class has methods for reading data from XML file.

Author:
Zoran Milakovic

Constructor Summary
XmlReader(java.lang.String fileName)
          Constructor will build Document from the specified file if file exist, or will create new Document if file not exist.
 
Method Summary
 java.util.ArrayList getResultSet()
           
 void select(java.lang.String tableName, java.lang.String[] columnNames, java.lang.String[] whereColumnNames, java.lang.String[] whereColumnValues)
          Gets data from database.Method will fill array list which will be result set.
 void selectTableNames()
          Gets table names from database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlReader

public XmlReader(java.lang.String fileName)
          throws java.sql.SQLException
Constructor will build Document from the specified file if file exist, or will create new Document if file not exist.

Parameters:
fileName - full pathname of the XML file
Throws:
java.sql.SQLException
Method Detail

select

public void select(java.lang.String tableName,
                   java.lang.String[] columnNames,
                   java.lang.String[] whereColumnNames,
                   java.lang.String[] whereColumnValues)
            throws java.sql.SQLException
Gets data from database.Method will fill array list which will be result set. ArrayList will contain arrays of strings.Every array of string will present one row in database.

Parameters:
tableName - Name of table.
columnNames - Names of columns from which will be select data.
whereColumnNames - Names of columns in where conditions.
whereColumnValues - Values of conditions.
Throws:
java.sql.SQLException

selectTableNames

public void selectTableNames()
                      throws java.sql.SQLException
Gets table names from database.

Throws:
java.sql.SQLException

getResultSet

public java.util.ArrayList getResultSet()
Returns:
list with results


Copyright © 2002-2007 Together - the Workgroup. All Rights Reserved.