try
{
  tableColumns = databaseMetaData.getColumns(null, schemaName, tableName, null);
}
catch (SQLException e1)
{
  e1.printStackTrace();
}

new MetaDataColumns(tableColumns);

System.out.println
(
    "Ordinal position\t" +
    "Column Name\t" +
    "Nullable?\t" +
    "Data-type\t" +
    "Column size"
);

try
{
  while(tableColumns.next())
  {
    if (tableColumns.getString("TABLE_SCHEM").equals(schemaName))
    {
      columnElement = new ColumnElement();
      columnElement.setColumnId(tableColumns.getInt("ORDINAL_POSITION"));
      columnElement.setColumnName(tableColumns.getString("COLUMN_NAME"));
      columnElement.setDataLength(tableColumns.getInt("COLUMN_SIZE"));
      if (tableColumns.getString("IS_NULLABLE").equals("NO"))
        columnElement.setNullable("N");
      else
        columnElement.setNullable("Y");
      
      dataTypeCode = tableColumns.getInt("DATA_TYPE");
      
      dataTypeName = JDBCType.valueOf(dataTypeCode).getName();
      
      System.out.println
      (
        tableColumns.getInt("ORDINAL_POSITION") + "\t" +
        tableColumns.getString("COLUMN_NAME") + "\t" +
        tableColumns.getString("IS_NULLABLE") + "\t" +
        dataTypeName + "\t" +
        tableColumns.getInt("COLUMN_SIZE")
      );
      columnElement.setDataType(dataTypeName);
      
      this.add(columnElement);
    }
  }
}
catch (SQLException e1)
{
  e1.printStackTrace();
}
