org.lateralnz.common.util
Class ResultSetConverter

java.lang.Object
  extended by org.lateralnz.common.util.ResultSetConverter
All Implemented Interfaces:
Constants

public class ResultSetConverter
extends java.lang.Object
implements Constants

a singleton utility class which creates (& compiles) a class based upon a JDBC resultset and then returns a list with objects of that class populated with the resultset data


Field Summary
 
Fields inherited from interface org.lateralnz.common.util.Constants
AMPERSAND, AND, APPLICATION_X_WWW_FORM_URLENCODED, ASTERISK, AT, BACK_SLASH, CHAR_LEFT_CHEV, CHAR_RIGHT_CHEV, COLON, COMMA, CRLF, DASH, DELETE, DOLLAR, DOT, DOT_CLASS, DOT_JAVA, EIGHT, EMPTY, EQUALS, FALSE, FILE_SEPARATOR, FIVE, FORWARD_SLASH, FOUR, FULLSTOP, HASH, HAT, INSERT, LEFT_BRACE, LEFT_BRACKET, LEFT_CHEV, MAX_LEN_APPCODE, MAX_LEN_APPGROUP, MAX_LEN_MSGCODE, MAX_LEN_MSGTEXT, MINUS_ONE, N, NEWLINE, NINE, NO, NULL_STRING, OFF, ON, ONE, ONE_DAY, ONE_HOUR, ONE_MINUTE, ONE_WEEK, PATH_SEPARATOR, PERCENT, PIPE, PLUS, QUESTION_MARK, QUOTE, REQUIRED, REQUIRES_NEW, RETURN, RIGHT_BRACE, RIGHT_BRACKET, RIGHT_CHEV, SELECT, SEMICOLON, SEVEN, SINGLE_QUOTE, SIX, SPACE, SQ_LEFT_BRACKET, SQ_RIGHT_BRACKET, SUPPORTS, TEXT_HTML, TEXT_PLAIN, TEXT_XML, THREE, TRUE, TWO, UNDERSCORE, UPDATE, UTF_8, Y, YES, ZERO
 
Method Summary
static ResultSetConverter getInstance()
           
static ResultSetConverter getInstance(java.lang.String compilerExecutable)
          Singleton method.
 java.util.List getResultSetAsList(java.lang.String resultSetName, java.sql.ResultSet rs, boolean forceClassReload)
          return a resultset as a list of objects representing the rows data of the resultset
 void reset(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ResultSetConverter getInstance()
                                      throws java.lang.Exception
Throws:
java.lang.Exception

getInstance

public static ResultSetConverter getInstance(java.lang.String compilerExecutable)
                                      throws java.lang.Exception
Singleton method.

Throws:
java.lang.Exception

getResultSetAsList

public java.util.List getResultSetAsList(java.lang.String resultSetName,
                                         java.sql.ResultSet rs,
                                         boolean forceClassReload)
                                  throws java.lang.Exception
return a resultset as a list of objects representing the rows data of the resultset

Parameters:
resultSetName - the name to refer to resultsets of this type (so we don't have to create the class every time we call this method
rs - the resultset data
forceClassReload - forces the class to be rebuilt
Throws:
java.lang.Exception

reset

public void reset(java.lang.String name)