org.objectweb.cjdbc.common.sql.schema
Class DatabaseSQLMetaData

java.lang.Object
  extended byorg.objectweb.cjdbc.common.sql.schema.DatabaseSQLMetaData

public class DatabaseSQLMetaData
extends java.lang.Object

This class defines a DatabaseSQLMetaData. It is used to collect metadata from a live connection to a database

Version:
1.0
Author:
Nicolas Modrzyk

Field Summary
(package private)  java.sql.Connection connection
           
(package private)  int dynamicPrecision
           
(package private)  boolean gatherSystemTables
           
(package private)  Trace logger
           
(package private)  java.lang.String schemaPattern
           
 
Constructor Summary
DatabaseSQLMetaData(Trace logger, java.sql.Connection connection, int dynamicPrecision, boolean gatherSystemTables, java.lang.String schemaPattern)
          Creates a new MetaData object
 
Method Summary
 DatabaseSchema createDatabaseSchema()
          Create a database schema from the given connection
private  void getColumns(java.sql.DatabaseMetaData metaData, DatabaseTable table)
          Gets the list of columns of a given database table.
private  void getPrimaryKeys(java.sql.DatabaseMetaData metaData, DatabaseTable table)
          Gets the primary keys of a given database table.
private  void getProcedures(java.sql.DatabaseMetaData metaData, DatabaseSchema schema)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

Trace logger

connection

java.sql.Connection connection

dynamicPrecision

int dynamicPrecision

gatherSystemTables

boolean gatherSystemTables

schemaPattern

java.lang.String schemaPattern
Constructor Detail

DatabaseSQLMetaData

public DatabaseSQLMetaData(Trace logger,
                           java.sql.Connection connection,
                           int dynamicPrecision,
                           boolean gatherSystemTables,
                           java.lang.String schemaPattern)
Creates a new MetaData object

Parameters:
logger - the log4j logger to output to
connection - a jdbc connection to a database
dynamicPrecision - precision used to create the schema
gatherSystemTables - should we gather system tables
schemaPattern - schema pattern to look for (reduce the scope of gathering if not null)
Method Detail

createDatabaseSchema

public final DatabaseSchema createDatabaseSchema()
                                          throws java.sql.SQLException
Create a database schema from the given connection

Returns:
DataSchema contructed from the information collected through jdbc
Throws:
java.sql.SQLException - if an error occurs with the given connection

getProcedures

private void getProcedures(java.sql.DatabaseMetaData metaData,
                           DatabaseSchema schema)
See Also:
DatabaseMetaData.getProcedures(java.lang.String, java.lang.String, java.lang.String), DatabaseMetaData.getProcedureColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

getColumns

private void getColumns(java.sql.DatabaseMetaData metaData,
                        DatabaseTable table)
                 throws java.sql.SQLException
Gets the list of columns of a given database table. The caller must ensure that the parameters are not null.

Parameters:
metaData - the database meta data
table - the database table
Throws:
java.sql.SQLException - if an error occurs

getPrimaryKeys

private void getPrimaryKeys(java.sql.DatabaseMetaData metaData,
                            DatabaseTable table)
                     throws java.sql.SQLException
Gets the primary keys of a given database table. The caller must ensure that the parameters are not null.

Parameters:
metaData - the database meta data
table - the database table
Throws:
java.sql.SQLException - if an error occurs


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.