private List getColumnsForTable(String tableName) throws SQLException
private List getColumnsForTable(DatabaseMetaData metaData, String tableName) throws SQLException
    private List getColumnsForTable(String tableName) throws SQLException    {        ResultSet columnData = null;        try        {            columnData = connection.getMetaData().getColumns(catalog, schema, tableName, null);            Set  availableColumns = determineAvailableColumns(columnData);            List columns          = new ArrayList();            List primaryKeys      = getPrimaryKeysForTable(tableName);            while (columnData.next())            {                Column col = new Column();                col.setName(getValueAsString(columnData, "COLUMN_NAME", availableColumns, "UNKNOWN"));                col.setTypeCode(getValueAsInt(columnData, "DATA_TYPE", availableColumns, java.sql.Types.OTHER));                col.setPrecisionRadix(getValueAsInt(columnData, "NUM_PREC_RADIX", availableColumns, 10));                col.setScale(getValueAsInt(columnData, "DECIMAL_DIGITS", availableColumns, 0));                // we're setting the size after the precision and radix in case                // the database prefers to return them in the size value                 col.setSize(getValueAsString(columnData, "COLUMN_SIZE", availableColumns, (String)defaultSizes.get(new Integer(col.getTypeCode()))));                col.setRequired("NO".equalsIgnoreCase(getValueAsString(columnData, "IS_NULLABLE", availableColumns, "YES").trim()));                if (primaryKeys.contains(col.getName()))                {                    col.setPrimaryKey(true);                }                else                {                    col.setPrimaryKey(false);                }                // sometimes the default comes back with parenthesis around it (jTDS/mssql)                String columnDefaultValue = getValueAsString(columnData, "COLUMN_DEF", availableColumns, null);                if (columnDefaultValue != null)                {                    Matcher m = defaultPattern.matcher(columnDefaultValue);                    if (m.matches())                    {                        columnDefaultValue = m.group(1);                    }                    col.setDefaultValue(columnDefaultValue);                }                columns.add(col);            }            return columns;        }        finally        {            if (columnData != null)            {                columnData.close();            }        }    }