org.eclipse.datatools.connectivity.sqm.loader
Class JDBCCatalogLoader

java.lang.Object
  extended by org.eclipse.datatools.connectivity.sqm.loader.JDBCBaseLoader
      extended by org.eclipse.datatools.connectivity.sqm.loader.JDBCCatalogLoader

public class JDBCCatalogLoader
extends JDBCBaseLoader

Base loader implementation for loading a database's catalog objects. This class may be specialized as necessary to meet a particular vendor's needs.

Since:
1.0

Field Summary
static java.lang.String COLUMN_TABLE_CAT
          The column name containing the catalog name.
 
Constructor Summary
JDBCCatalogLoader(ICatalogObject catalogObject)
          This constructs the loader using a CatalogFilterProvider filter.
JDBCCatalogLoader(ICatalogObject catalogObject, IConnectionFilterProvider connectionFilterProvider)
           
 
Method Summary
 void clearCatalogs(java.util.Collection catalogs)
          Removes the specified catalogs from the model.
 java.util.Collection loadCatalogs()
          Deprecated. see loadCatalogs(List, Collection)
 void loadCatalogs(java.util.List containmentList, java.util.Collection existingCatalogs)
          Loads the "catalog" objects from the database.
 
Methods inherited from class org.eclipse.datatools.connectivity.sqm.loader.JDBCBaseLoader
getCatalogObject, setCatalogObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLUMN_TABLE_CAT

public static final java.lang.String COLUMN_TABLE_CAT
The column name containing the catalog name.

See Also:
java.sql.DatabaseMetaData.getCatalogs(), Constant Field Values
Constructor Detail

JDBCCatalogLoader

public JDBCCatalogLoader(ICatalogObject catalogObject)
This constructs the loader using a CatalogFilterProvider filter.

Parameters:
catalogObject - the Database object upon which this loader operates.

JDBCCatalogLoader

public JDBCCatalogLoader(ICatalogObject catalogObject,
                         IConnectionFilterProvider connectionFilterProvider)
Parameters:
catalogObject - the Database object upon which this loader operates.
connectionFilterProvider - the filter provider used for filtering the "catalog" objects being loaded
Method Detail

loadCatalogs

public java.util.Collection loadCatalogs()
                                  throws java.sql.SQLException
Deprecated. see loadCatalogs(List, Collection)

Returns:
a collection of Catalog objects
Throws:
java.sql.SQLException - if an error occurred during loading.

loadCatalogs

public void loadCatalogs(java.util.List containmentList,
                         java.util.Collection existingCatalogs)
                  throws java.sql.SQLException
Loads the "catalog" objects from the database. This method uses the result set from createResultSet() to load the "catalog" objects from the server. This method first checks the name of the "catalog" to determine whether or not it should be filtered. If it is not filtered, it checks to see if an object with that name was loaded previously. If it finds an existing object, it refreshes that object and adds it to the containment list. If the named object does not exist, the result set is passed to processRow(), which creates and initializes a new object. Catalog objects are created using the factory method, createCatalog() and initialized through the initialize() method. If no catalogs are loaded, the loader assumes catalogs are not supported and creates a default Catalog object with an empty name. (This is mimics the behavior of the JDBC meta-data API where objects not belonging to a catalog are associated with a "" named catalog.) This method should only be overridden as a last resort when the desired behavior cannot be acheived by overriding createResultSet(), closeResultSet(), processRow(), createCatalog() and initialize().

Parameters:
containmentList - the containment list held by parent
existingCatalogs - the catalog objects which were previously loaded
Throws:
java.sql.SQLException - if an error occurred during loading.

clearCatalogs

public void clearCatalogs(java.util.Collection catalogs)
Removes the specified catalogs from the model.

Parameters:
catalogs - the catalogs to be removed from the model.


Copyright © 2006 -- 2008 Actuate, IBM Corporation, Sybase, Inc. and others. All rights reserved.