com.synz.igor
Class Igor

java.lang.Object
  |
  +--com.synz.igor.Igor

public class Igor
extends java.lang.Object
implements IgorConstants

The main Igor class.


Constructor Summary
Igor()
           
 
Method Summary
 java.lang.String getVersionInfo()
           
static java.lang.StringBuffer rsToXml(java.lang.String setName, java.sql.ResultSet db_rs)
          This method loops through the resultset provided and returns the result in an XML-like format.
static java.lang.StringBuffer rsToXmlTemplate(java.lang.String templateFile, java.sql.ResultSet db_rs)
          This method parses a template(see sample in the Example directory) and replaces the variables with records from the DB ResultSet.
static java.lang.StringBuffer tableToXml(java.lang.String db_tableName, java.sql.Connection db_conn)
          This method selects *all* of the records from the tableName you supplied and returns them in an XML-like format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Igor

public Igor()
Method Detail

tableToXml

public static java.lang.StringBuffer tableToXml(java.lang.String db_tableName,
                                                java.sql.Connection db_conn)
This method selects *all* of the records from the tableName you supplied and returns them in an XML-like format. i.e. <(db_tableName)> <......> [all rows and columns contained in the specified table]
Parameters:
db_conn - - A reference to a Connection
db_tableName - - The name of the table to query
Returns:
- StringBuffer containing contents

rsToXml

public static java.lang.StringBuffer rsToXml(java.lang.String setName,
                                             java.sql.ResultSet db_rs)
This method loops through the resultset provided and returns the result in an XML-like format. i.e. this call, rsToXml("dogs", rs) would produce the following, <......> [values contained in resultset]
Parameters:
setName - - A reference to a sql resultset
db_rs - - Sets name of beginning and closing <> tags.
Returns:
- StringBuffer containing contents

rsToXmlTemplate

public static java.lang.StringBuffer rsToXmlTemplate(java.lang.String templateFile,
                                                     java.sql.ResultSet db_rs)
This method parses a template(see sample in the Example directory) and replaces the variables with records from the DB ResultSet. Template variables are of this form %table.column%. The ResultSet is iterated and placed into a hastable in this format, tablename.columnname '|' value When the template is parsed all variables are matched up against the hashtable, if the template variable does not exist in the hastable 'null' is returned.
Parameters:
db_rs - - A SQL ResultSet
templateFile - - The location of the xml template
Returns:
- StringBuffer containing contents

getVersionInfo

public java.lang.String getVersionInfo()
Returns:
- name and version information