edu.jhu.tmaj.beans.data
Class SqlFormatter

java.lang.Object
  extended by edu.jhu.tmaj.beans.data.SqlFormatter

public final class SqlFormatter
extends java.lang.Object


Field Summary
static int MAX_SINGLE_VALUE
          The largest a value in a SQL String can be.
static int MAX_VALUES_IN_COMMA_LIST
          Oracle only allows 1000 values in a list that looks like SELECT * FROM Table WHERE ID IN ('n1','n2','n3'...'n1000') This resolves the error: java.sql.SQLException: ORA-01795: maximum number of expressions in a list is 1000
 
Method Summary
static int getLongestValue(java.lang.String valueString)
          Determines the delimiter used in the value string, then gets the length of the longest single token within it.
static int getLongestValueDelimit(java.lang.String valueString, java.lang.String delimiter)
          Gets the length of the longest token that appears in the value string based on the supplied delimiter.
static java.lang.String getStringListAsFormattedString(java.util.List<java.lang.String> stringList)
           
static java.lang.String getValueFormat(java.lang.String fieldName, java.lang.String valueToFind)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_SINGLE_VALUE

public static final int MAX_SINGLE_VALUE
The largest a value in a SQL String can be.

See Also:
Constant Field Values

MAX_VALUES_IN_COMMA_LIST

public static final int MAX_VALUES_IN_COMMA_LIST
Oracle only allows 1000 values in a list that looks like SELECT * FROM Table WHERE ID IN ('n1','n2','n3'...'n1000') This resolves the error: java.sql.SQLException: ORA-01795: maximum number of expressions in a list is 1000

See Also:
Constant Field Values
Method Detail

getValueFormat

public static java.lang.String getValueFormat(java.lang.String fieldName,
                                              java.lang.String valueToFind)

getStringListAsFormattedString

public static java.lang.String getStringListAsFormattedString(java.util.List<java.lang.String> stringList)

getLongestValue

public static int getLongestValue(java.lang.String valueString)
Determines the delimiter used in the value string, then gets the length of the longest single token within it. If the value string does not contain a delimiter we are concerned with, it returns the length of the entire string.


getLongestValueDelimit

public static int getLongestValueDelimit(java.lang.String valueString,
                                         java.lang.String delimiter)
Gets the length of the longest token that appears in the value string based on the supplied delimiter.