com.wm.app.tn.db
Class SQLLimits

java.lang.Object
  extended by com.wm.app.tn.db.SQLLimits

public class SQLLimits
extends java.lang.Object


Constructor Summary
SQLLimits()
           
 
Method Summary
static java.lang.String chop(java.lang.String which, java.lang.String data)
          Chops a data value to the right length for a column.
static int getLimit(java.lang.String which)
          Get a column length
static java.util.Hashtable getLimits()
          Get all column lengths
static void init(java.io.File sqlFile)
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLLimits

public SQLLimits()
Method Detail

init

public static void init(java.io.File sqlFile)
                 throws java.io.IOException
Throws:
java.io.IOException

getLimits

public static java.util.Hashtable getLimits()
Get all column lengths

Returns:
a Hashtable of column lengths; key="TableName.ColumnName", value=Integer length

getLimit

public static int getLimit(java.lang.String which)
Get a column length

Parameters:
which - the column length to fetch
Returns:
the column length, or -1 if it's not defined

chop

public static java.lang.String chop(java.lang.String which,
                                    java.lang.String data)
Chops a data value to the right length for a column. This will emit a log message if data is truncated.

Parameters:
which - the column being set
data - the string being stored in the column
Returns:
a new string (possibly the same as the old one) of the right length

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception