Class SqlServerMetadataCollector

  extended by org.modeshape.connector.meta.jdbc.JdbcMetadataCollector
      extended by org.modeshape.connector.meta.jdbc.SqlServerMetadataCollector
All Implemented Interfaces:

public class SqlServerMetadataCollector
extends JdbcMetadataCollector

The Microsoft SQL Server JDBC drivers return a list of users from the DatabaseMetaData.getSchemas() method instead of the actual schemas. Unfortunately, the DatabaseMetaData.getTables(String, String, String, String[]) method actually returns schema names, so the default JdbcMetadataCollector implementation doesn't match up correctly. This class should be used when the Microsoft JDBC driver is used for database connectivity. The jTDS driver has already corrected this bug and can use the default JdbcMetadataCollector.

Constructor Summary
Method Summary
 List<String> getSchemaNames(Connection conn, String catalogName)
          Return the list of schema names that currently exist in the database to which connection is connected within the named catalog.
Methods inherited from class org.modeshape.connector.meta.jdbc.JdbcMetadataCollector
getCatalogNames, getColumns, getProcedures, getTables
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public SqlServerMetadataCollector()
Method Detail


public List<String> getSchemaNames(Connection conn,
                                   String catalogName)
                            throws JdbcMetadataException
Description copied from interface: MetadataCollector
Return the list of schema names that currently exist in the database to which connection is connected within the named catalog. If catalogName is null, then all schema names should be returned regardless of the catalog with which they are associated. The schema names must be sorted in a manner that is stable between successive calls to this method.

Specified by:
getSchemaNames in interface MetadataCollector
getSchemaNames in class JdbcMetadataCollector
conn - the connection to the database; must not be non-null and must be open. This connection should not be closed by this method.
catalogName - the name of the catalog to which returned schemas must belong, or null if all schemas are to be returned
An ordered list of the schemas in the database, or an empty list if no schemas exist; may not be null
JdbcMetadataException - if the schema names cannot be retrieved
See Also:

Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.