snap.database
Class DBSchema

java.lang.Object
  |
  +--snap.database.DBSchema

public class DBSchema
extends java.lang.Object

This class retrieves schema information from the database for the DataCompass group project. Currently specifiable parameters are Database and Tablename Please ensure that only one of these objects is ever instantiated. This object takes a while to instantiate and isnt too lightweight, nor too efficient


Constructor Summary
DBSchema(java.sql.Connection connection)
          This is the default constructor for the DBSchema object
 
Method Summary
 java.sql.Connection getConnection()
          Retunrs the database connection.
 java.lang.String getPrimaryKey(java.lang.String table)
          Gets the primary key for a particular table.
 int getRelation(java.lang.String tableSrc, java.lang.String tableDest)
          Check from hashtable and return the relation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBSchema

public DBSchema(java.sql.Connection connection)
This is the default constructor for the DBSchema object

Method Detail

getPrimaryKey

public java.lang.String getPrimaryKey(java.lang.String table)
Gets the primary key for a particular table.


getConnection

public java.sql.Connection getConnection()
Retunrs the database connection.


getRelation

public int getRelation(java.lang.String tableSrc,
                       java.lang.String tableDest)
Check from hashtable and return the relation. The following are possible return values: 0 --> no relation 1 --> 1-M relation 2 --> M-1 relation