com.jfw.database.metadata
Class TablesViews

java.lang.Object
  extended by com.jfw.database.metadata.MetaData
      extended by com.jfw.database.metadata.TablesViews
Direct Known Subclasses:
Tables, Views

public abstract class TablesViews
extends MetaData

Common methods for get tables or views.


Field Summary
 
Fields inherited from class com.jfw.database.metadata.MetaData
className, resourceName, TABLE, VIEW
 
Constructor Summary
TablesViews()
          Use the default db resource from the jfw.properties.
TablesViews(java.lang.String resourceName)
          Use the parameter resourceName as db resource.
 
Method Summary
 java.util.ArrayList get(java.lang.String catalogName, java.lang.String schemaName)
          Get the table or view names from a database schema.
 java.util.ArrayList getColumns(java.lang.String tableName)
          Get the columns names of a table.
 java.util.ArrayList getForeignKeys(java.lang.String tableName)
          Get the primary keys of a table.
 java.util.ArrayList getPrimaryKeys(java.lang.String tableName)
          Get the primary keys of a table.
 
Methods inherited from class com.jfw.database.metadata.MetaData
getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TablesViews

public TablesViews()
Use the default db resource from the jfw.properties.


TablesViews

public TablesViews(java.lang.String resourceName)
Use the parameter resourceName as db resource.

Parameters:
resourceName - the name of a resource as specified in the jfw.properties.
Method Detail

get

public java.util.ArrayList get(java.lang.String catalogName,
                               java.lang.String schemaName)
                        throws DatabaseException
Get the table or view names from a database schema.

Parameters:
catalogName - the catalog name to which the object belong.
schemaName - the schema name to which the object belong.
Returns:
list of the objects.
Throws:
DatabaseException

getColumns

public java.util.ArrayList getColumns(java.lang.String tableName)
                               throws DatabaseException
Get the columns names of a table.

Parameters:
tableName - the table name to which the fields belong.
Returns:
list of the table columns.
Throws:
DatabaseException

getPrimaryKeys

public java.util.ArrayList getPrimaryKeys(java.lang.String tableName)
                                   throws DatabaseException
Get the primary keys of a table.

Parameters:
tableName - the table name to which the fields belong.
Returns:
list of the table primary keys.
Throws:
DatabaseException

getForeignKeys

public java.util.ArrayList getForeignKeys(java.lang.String tableName)
                                   throws DatabaseException
Get the primary keys of a table.

Parameters:
tableName - the table name to which the fields belong.
Returns:
list of the table foreign keys.
Throws:
DatabaseException