DSRG.MW
Class DBMAccess

java.lang.Object
  |
  +--DSRG.MW.DBManager
        |
        +--DSRG.MW.DBMAccess

public class DBMAccess
extends DBManager
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
private  java.lang.String className
           
private  java.lang.String DB
           
private  DBMAccess instance
           
private  java.lang.String passwd
           
private  java.lang.String url
           
private  java.lang.String user
           
 
Fields inherited from class DSRG.MW.DBManager
className, connected, connection, date_datatype, DEBUG, driver, ISName, numeric_datatype, passwd, url, user
 
Constructor Summary
DBMAccess()
          Default Constructor
DBMAccess(java.lang.String myISName, java.lang.String name, java.lang.String password, java.lang.String URL)
          Constructor with name/password
 
Method Summary
 boolean addAttribute(java.lang.String RelationName, java.lang.String AttributeName, java.lang.String type, int size)
          addAttribute.
private  boolean addAttributeAcc(java.lang.String relationName, java.lang.String attributeName, java.lang.String attributeType)
          function necessary since Access doesn't provide metadata info in the SQL interface (...)
 boolean addRelation(java.lang.String relName, java.util.Vector attNames, java.util.Vector attTypes)
          addRelation.
 boolean addRelationAcc(java.lang.String RelationName, java.lang.String schema)
          function necessary since Access doesn't provide metadata info in the SQL interface (...)
 boolean deleteAttribute(java.lang.String RelationName, java.lang.String attributeName)
          deleteAttribute.
private  boolean deleteAttributeAcc(java.lang.String relationName, java.lang.String attributeName)
          function necessary since Access doesn't provide metadata info in the SQL interface (...)
 boolean deleteRelation(java.lang.String name, boolean silent)
          deleteRelation.
private  boolean deleteRelationAcc(java.lang.String RelationName)
          function necessary since Access doesn't provide metadata info in the SQL interface (...)
 void getDBManager()
          Returns the handle to this instance of the DBManager or creates a new instance.
private  int getLengthFromType(java.lang.String type)
          Helper function.
private  java.lang.String getNameFromType(java.lang.String type)
          Helper function.
 java.lang.String getSchema(java.lang.String relationName)
          Helper function.
 boolean renameAttribute(java.lang.String RelationName, java.lang.String oldName, java.lang.String newName)
          renameAttribute.
private  boolean renameAttributeAcc(java.lang.String relationName, java.lang.String oldName, java.lang.String newName)
          function necessary since Access doesn't provide metadata info in the SQL interface (...)
 boolean renameRelation(java.lang.String oldName, java.lang.String newName)
          renames a table by dropping the old one and creating the new one.
private  boolean renameRelationAcc(java.lang.String oldName, java.lang.String newName)
          function necessary since Access doesn't provide metadata info in the SQL interface (...)
 void resetDB()
          Added by Xinz and koeller ;-) Reset the database
(package private)  void resetDB(java.lang.String filename)
          Added by Xinz
Reset the database
 boolean storeRelation(Table table)
          stores a Table object in a database.
 
Methods inherited from class DSRG.MW.DBManager
executeQuery, executeViewQuery, getAttributeExtent, getAttributeNames, getAttributeType, getISName, getRelationNames, getTableName, isConnected, makeSelectClause, privateExecuteQuery, renameAttributeInSchema, sendUpdate, stripAttributeFromSchema
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

instance

private DBMAccess instance

url

private java.lang.String url

user

private java.lang.String user

passwd

private java.lang.String passwd

className

private java.lang.String className

DB

private java.lang.String DB
Constructor Detail

DBMAccess

public DBMAccess()
Default Constructor

DBMAccess

public DBMAccess(java.lang.String myISName,
                 java.lang.String name,
                 java.lang.String password,
                 java.lang.String URL)
Constructor with name/password
Method Detail

getDBManager

public void getDBManager()
Returns the handle to this instance of the DBManager or creates a new instance.

addRelation

public boolean addRelation(java.lang.String relName,
                           java.util.Vector attNames,
                           java.util.Vector attTypes)
addRelation.
creates only the schema, does not insert data or anything
The types have to be like "VARCHAR(.." otherwise they're overwritten by "VARCHAR(31) 10/9/97 koeller
Overrides:
addRelation in class DBManager

deleteRelation

public boolean deleteRelation(java.lang.String name,
                              boolean silent)
deleteRelation.
10/6/97 koeller
Overrides:
deleteRelation in class DBManager

renameAttribute

public boolean renameAttribute(java.lang.String RelationName,
                               java.lang.String oldName,
                               java.lang.String newName)
renameAttribute.
10/6/97 koeller
Overrides:
renameAttribute in class DBManager

addAttribute

public boolean addAttribute(java.lang.String RelationName,
                            java.lang.String AttributeName,
                            java.lang.String type,
                            int size)
addAttribute.
Extents are being ignored, not needed/possible for the demo
10/6/97 koeller
patched 07/13/98, Error when creating "NUMBER" data type
Overrides:
addAttribute in class DBManager

deleteAttribute

public boolean deleteAttribute(java.lang.String RelationName,
                               java.lang.String attributeName)
deleteAttribute.
10/6/97 koeller
Overrides:
deleteAttribute in class DBManager

addRelationAcc

public boolean addRelationAcc(java.lang.String RelationName,
                              java.lang.String schema)
function necessary since Access doesn't provide metadata info in the SQL interface (...)

deleteRelationAcc

private boolean deleteRelationAcc(java.lang.String RelationName)
function necessary since Access doesn't provide metadata info in the SQL interface (...)

renameAttributeAcc

private boolean renameAttributeAcc(java.lang.String relationName,
                                   java.lang.String oldName,
                                   java.lang.String newName)
function necessary since Access doesn't provide metadata info in the SQL interface (...)

renameRelationAcc

private boolean renameRelationAcc(java.lang.String oldName,
                                  java.lang.String newName)
function necessary since Access doesn't provide metadata info in the SQL interface (...)

addAttributeAcc

private boolean addAttributeAcc(java.lang.String relationName,
                                java.lang.String attributeName,
                                java.lang.String attributeType)
function necessary since Access doesn't provide metadata info in the SQL interface (...)

deleteAttributeAcc

private boolean deleteAttributeAcc(java.lang.String relationName,
                                   java.lang.String attributeName)
function necessary since Access doesn't provide metadata info in the SQL interface (...)

storeRelation

public boolean storeRelation(Table table)
stores a Table object in a database.
Creates a schema and stores data in there. Uses the relation's name and attribute names and lengths everything is created as "VARCHAR2" !! This is for view recomputation and should only be used on LocalIS
Overrides:
storeRelation in class DBManager

getNameFromType

private java.lang.String getNameFromType(java.lang.String type)
Helper function.
extracts a name from a (simple) SQL-type

getLengthFromType

private int getLengthFromType(java.lang.String type)
Helper function.
extracts a data length from a (simple) SQL-type

renameRelation

public boolean renameRelation(java.lang.String oldName,
                              java.lang.String newName)
renames a table by dropping the old one and creating the new one.
Overrides:
renameRelation in class DBManager

getSchema

public java.lang.String getSchema(java.lang.String relationName)
Helper function.
This will read the Schema of a given table in the IS, concatenating it to a string of the form
([columnname type,] columnname type)

resetDB

public void resetDB()
Added by Xinz and koeller ;-) Reset the database

resetDB

void resetDB(java.lang.String filename)
Added by Xinz
Reset the database