com.googlecode.jdbw.metadata
Class MetaDataResolver

java.lang.Object
  extended by com.googlecode.jdbw.metadata.MetaDataResolver

public class MetaDataResolver
extends Object

The MetaDataResolver is used to extract meta data from the database server. It is mostly a wrapper around the DatabaseMetaData class, but can also be overridden to provide a custom behavior. This can be useful, for example, if the database server doesn't support concepts such as Catalog or Schema.

Author:
Martin Berglund
See Also:
Catalog, Schema, Table

Field Summary
protected  DataSource dataSource
           
 
Constructor Summary
MetaDataResolver(DataSource dataSource)
           
 
Method Summary
protected  Column extractColumnFromMetaResult(ResultSet resultSet, Table table)
           
protected  void extractIndexDataFromMetaResult(ResultSet resultSet, Map<String,Index> indexMap, Table table)
           
 Catalog getCatalog(String catalogName)
           
protected  List<String> getCatalogNames()
           
 List<Catalog> getCatalogs()
           
protected  List<Column> getColumns(String catalogName, String schemaName, Table table)
           
protected  List<String> getFunctionNames(String catalogName, String schemaName)
           
protected  List<Index> getIndexes(String catalogName, String schemaName, Table table)
           
protected  MetaDataFactory getMetaDataFactory()
           
protected  List<String> getProcedureInputParameterNames(String catalogName, String schemaName, StoredProcedure procedure)
           
protected  List<String> getSchemaNames(String catalogName)
           
 String getStoredProcedureCode(String catalogName, String schemaName, String procedureName)
           
protected  List<String> getStoredProcedureNames(String catalogName, String schemaName)
           
protected  List<String> getSystemTableNames(String catalogName, String schemaName)
           
protected  List<String> getUserTableNames(String catalogName, String schemaName)
           
protected  List<String> getViewNames(String catalogName, String schemaName)
           
protected  List<String> readResultSetColumn(ResultSet resultSet, int index)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataSource

protected final DataSource dataSource
Constructor Detail

MetaDataResolver

public MetaDataResolver(DataSource dataSource)
Method Detail

getCatalogs

public List<Catalog> getCatalogs()
                          throws SQLException
Throws:
SQLException

getCatalog

public Catalog getCatalog(String catalogName)
                   throws SQLException
Throws:
SQLException

getStoredProcedureCode

public String getStoredProcedureCode(String catalogName,
                                     String schemaName,
                                     String procedureName)
                              throws SQLException
Throws:
SQLException

getMetaDataFactory

protected MetaDataFactory getMetaDataFactory()

getCatalogNames

protected List<String> getCatalogNames()
                                throws SQLException
Throws:
SQLException

getSchemaNames

protected List<String> getSchemaNames(String catalogName)
                               throws SQLException
Throws:
SQLException

getUserTableNames

protected List<String> getUserTableNames(String catalogName,
                                         String schemaName)
                                  throws SQLException
Throws:
SQLException

getSystemTableNames

protected List<String> getSystemTableNames(String catalogName,
                                           String schemaName)
                                    throws SQLException
Throws:
SQLException

getViewNames

protected List<String> getViewNames(String catalogName,
                                    String schemaName)
                             throws SQLException
Throws:
SQLException

getStoredProcedureNames

protected List<String> getStoredProcedureNames(String catalogName,
                                               String schemaName)
                                        throws SQLException
Throws:
SQLException

getFunctionNames

protected List<String> getFunctionNames(String catalogName,
                                        String schemaName)
                                 throws SQLException
Throws:
SQLException

getColumns

protected List<Column> getColumns(String catalogName,
                                  String schemaName,
                                  Table table)
                           throws SQLException
Throws:
SQLException

getIndexes

protected List<Index> getIndexes(String catalogName,
                                 String schemaName,
                                 Table table)
                          throws SQLException
Throws:
SQLException

getProcedureInputParameterNames

protected List<String> getProcedureInputParameterNames(String catalogName,
                                                       String schemaName,
                                                       StoredProcedure procedure)
                                                throws SQLException
Throws:
SQLException

extractColumnFromMetaResult

protected Column extractColumnFromMetaResult(ResultSet resultSet,
                                             Table table)
                                      throws SQLException
Throws:
SQLException

extractIndexDataFromMetaResult

protected void extractIndexDataFromMetaResult(ResultSet resultSet,
                                              Map<String,Index> indexMap,
                                              Table table)
                                       throws SQLException
Throws:
SQLException

readResultSetColumn

protected List<String> readResultSetColumn(ResultSet resultSet,
                                           int index)
                                    throws SQLException
Throws:
SQLException


Copyright © 2012. All Rights Reserved.