SPT RWT Application API

com.sptci.rwt
Class DBMSAnalyser

java.lang.Object
  extended by com.sptci.rwt.Analyser
      extended by com.sptci.rwt.DBMSAnalyser

public class DBMSAnalyser
extends Analyser

An analyser for analysing metadata about a database.

© Copyright 2007 Sans Pareil Technologies, Inc.

Version:
$Id: DBMSAnalyser.java 4123 2008-05-25 21:49:01Z rakesh $
Author:
Rakesh Vidyadharan 2007-09-26

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sptci.rwt.Analyser
Analyser.CatalogueSchema
 
Field Summary
 
Fields inherited from class com.sptci.rwt.Analyser
logger, manager
 
Constructor Summary
DBMSAnalyser(ConnectionManager manager)
          Create a new instance of the class using the specified connection manager.
 
Method Summary
 DBMSMetaData analyse()
          Return a DBMSMetaData object that contains the basic information pertaining to the database connected to.
 Collection<DBMSMetaData> analyse(MetaData... parameters)
          Returns a collection of DBMSMetaData objects that contain the basic information pertaining to the database.
protected  JDBCMetaData processJdbcMetaData(DatabaseMetaData dmd)
          Fetch the JDBC driver metadata from the specified database meta data.
protected  LimitsMetaData processLimits(DatabaseMetaData dmd)
          Fetch the limits enforced by the database.
protected  DBMSMetaData.Transaction processTransaction(int value)
          Map the constants defined in Connection for transaction isolation levels to the DBMSMetaData.Transaction enumeration.
 
Methods inherited from class com.sptci.rwt.Analyser
getNames
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBMSAnalyser

public DBMSAnalyser(ConnectionManager manager)
Create a new instance of the class using the specified connection manager.

Parameters:
manager - The manager for obtaining database connections.
Method Detail

analyse

public Collection<DBMSMetaData> analyse(MetaData... parameters)
                                 throws SQLException
Returns a collection of DBMSMetaData objects that contain the basic information pertaining to the database.
   ConnectionManager manager = new ConnectionManager( "rwt" );
   Collection dmd = new DBMSAnalyser( manager ).analyse();
 

Specified by:
analyse in class Analyser
Parameters:
parameters - No values needed.
Returns:
Returns a collection with just one entry since there is only database about which metadata is retrieved.
Throws:
SQLException - If errors are encountered while analysisng the
See Also:
Analyser.analyse(com.sptci.rwt.MetaData...), analyse(), processTransaction(int), processJdbcMetaData(java.sql.DatabaseMetaData), processLimits(java.sql.DatabaseMetaData)

analyse

public DBMSMetaData analyse()
                     throws SQLException
Return a DBMSMetaData object that contains the basic information pertaining to the database connected to.

Returns:
The metadata about the database.
Throws:
SQLException - If errors are encountered while analysing the database.
See Also:
analyse( MetaData... )

processTransaction

protected DBMSMetaData.Transaction processTransaction(int value)
Map the constants defined in Connection for transaction isolation levels to the DBMSMetaData.Transaction enumeration.

Parameters:
value - The constant value that indicates the transaction level.
Returns:
The enumerated transaction value.

processJdbcMetaData

protected JDBCMetaData processJdbcMetaData(DatabaseMetaData dmd)
                                    throws SQLException
Fetch the JDBC driver metadata from the specified database meta data.

Parameters:
dmd - The database metadata from which the JDBC driver metadata is to be retrieved.
Throws:
SQLException - If errors are encountered while fetching the information.

processLimits

protected LimitsMetaData processLimits(DatabaseMetaData dmd)
                                throws SQLException
Fetch the limits enforced by the database.

Parameters:
dmd - The database metadata from which the database engine limits are to be retrieved.
Throws:
SQLException - If errors are encountered while fetching the information.

SPT RWT Application API