net.sourceforge.schemaspy
Class DBAnalyzer

java.lang.Object
  extended by net.sourceforge.schemaspy.DBAnalyzer

public class DBAnalyzer
extends Object


Constructor Summary
DBAnalyzer()
           
 
Method Summary
static void dumpResultSetRow(ResultSet rs, String description)
          For debugging/analyzing result sets
static List getDefaultNullStringColumns(Collection tables)
          Returns a list of columns that have the word "NULL" or "null" as their default value instead of the likely candidate value null.
static List getForeignKeyConstraints(Collection tables)
          Returns a List of all of the ForeignKeyConstraints used by the specified tables.
static List getImpliedConstraints(Collection tables)
           
static List getMustBeUniqueNullableColumns(Collection tables)
          Return a list of TableColumns that are both nullable and have an index that specifies that they must be unique (a rather strange combo).
static List getOrphans(Collection tables)
           
static List getPopulatedSchemas(DatabaseMetaData meta)
          getSchemas - returns a List of schema names (Strings) that contain tables
static List getPopulatedSchemas(DatabaseMetaData meta, String schemaSpec)
          getSchemas - returns a List of schema names (Strings) that contain tables and match the schemaSpec regular expression
static List getSchemas(DatabaseMetaData meta)
          getSchemas - returns a List of schema names (Strings)
static List getTablesWithIncrementingColumnNames(Collection tables)
           
static List getTablesWithOneColumn(Collection tables)
           
static List getTablesWithoutIndexes(Collection tables)
          Return a list of Tables that have neither an index nor a primary key.
static List sortColumnsByTable(List columns)
           
static List sortTablesByName(List tables)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBAnalyzer

public DBAnalyzer()
Method Detail

getImpliedConstraints

public static List getImpliedConstraints(Collection tables)
                                  throws SQLException
Throws:
SQLException

getForeignKeyConstraints

public static List getForeignKeyConstraints(Collection tables)
Returns a List of all of the ForeignKeyConstraints used by the specified tables.

Parameters:
tables - Collection
Returns:
List

getOrphans

public static List getOrphans(Collection tables)

getMustBeUniqueNullableColumns

public static List getMustBeUniqueNullableColumns(Collection tables)
Return a list of TableColumns that are both nullable and have an index that specifies that they must be unique (a rather strange combo).


getTablesWithoutIndexes

public static List getTablesWithoutIndexes(Collection tables)
Return a list of Tables that have neither an index nor a primary key.


getTablesWithIncrementingColumnNames

public static List getTablesWithIncrementingColumnNames(Collection tables)

getTablesWithOneColumn

public static List getTablesWithOneColumn(Collection tables)

sortTablesByName

public static List sortTablesByName(List tables)

sortColumnsByTable

public static List sortColumnsByTable(List columns)

getDefaultNullStringColumns

public static List getDefaultNullStringColumns(Collection tables)
Returns a list of columns that have the word "NULL" or "null" as their default value instead of the likely candidate value null.

Parameters:
tables - Collection
Returns:
List

getSchemas

public static List getSchemas(DatabaseMetaData meta)
                       throws SQLException
getSchemas - returns a List of schema names (Strings)

Parameters:
meta - DatabaseMetaData
Throws:
SQLException

getPopulatedSchemas

public static List getPopulatedSchemas(DatabaseMetaData meta)
                                throws SQLException
getSchemas - returns a List of schema names (Strings) that contain tables

Parameters:
meta - DatabaseMetaData
Throws:
SQLException

getPopulatedSchemas

public static List getPopulatedSchemas(DatabaseMetaData meta,
                                       String schemaSpec)
                                throws SQLException
getSchemas - returns a List of schema names (Strings) that contain tables and match the schemaSpec regular expression

Parameters:
meta - DatabaseMetaData
Throws:
SQLException

dumpResultSetRow

public static void dumpResultSetRow(ResultSet rs,
                                    String description)
                             throws SQLException
For debugging/analyzing result sets

Parameters:
rs - ResultSet
Throws:
SQLException


Copyright © 2007-2010. All Rights Reserved.